    

 ## On this page

  

 

 # Class PHXReferenceArray

 Last update: 16.07.2025 

**Package:** `com.phoenix_int.aserver.types`

```
↳ java.lang.Object
  ↳ com.phoenix_int.aserver.types.PHXReferenceArray

```

**All Implemented Interfaces:**

- [IPHXAlwaysWriteable](../IPHXAlwaysWriteable.md)

---

**Declaration:**

```java
public class PHXReferenceArray
extends java.lang.Object
implements IPHXAlwaysWriteable

```

The type for references. This class matches up to references in ModelCenter. Users may define their own properties in addition to the value property.

- **value**: double\[\]
- **length**: int
- **autoGrow**: boolean
- **properties**: PHXRefArrayProperty\[\]
- **reference**: String\[\]

## Constructor Summary

Constructor and Description`PHXReferenceArray()`constructor## Method Summary

Modifier and TypeMethod and Description`IPHXRefPropInfo``createRefProp(java.lang.String&nbsp;name, java.lang.String&nbsp;type)`  
adds a ref prop to the variable.`boolean``getAutoGrow()`  
retrieves the autoGrow value`int``getLength()`  
retrieves the number of references in the array`PHXRefArrayProperty[]``getProperties()`  
get-set function for AServer`java.lang.String[]``getReference()`  
retrieves the current reference string.`java.lang.String``getReference(int&nbsp;i)``boolean``getRefPropValueBoolean(java.lang.String&nbsp;name, int&nbsp;index)``double``getRefPropValueDouble(java.lang.String&nbsp;name, int&nbsp;index)`  
gets a value for a ref prop`long``getRefPropValueLong(java.lang.String&nbsp;name, int&nbsp;index)``java.lang.String``getRefPropValueString(java.lang.String&nbsp;name, int&nbsp;index)``double[]``getValues()`  
retrieves the current value of the variable`void``setAutoGrow(boolean&nbsp;flag)`  
sets the autoGrow value.`void``setLength(int&nbsp;v)`  
sets the number of references`void``setProperties(PHXRefArrayProperty[]&nbsp;p)``void``setReference(int&nbsp;i, java.lang.String&nbsp;ref)``void``setReference(java.lang.String[]&nbsp;ref)`  
sets the value for the reference string.`void``setRefPropValue(java.lang.String&nbsp;name, int&nbsp;index, boolean&nbsp;value)``void``setRefPropValue(java.lang.String&nbsp;name, int&nbsp;index, double&nbsp;value)`  
sets a value for a ref prop`void``setRefPropValue(java.lang.String&nbsp;name, int&nbsp;index, long&nbsp;value)``void``setRefPropValue(java.lang.String&nbsp;name, int&nbsp;index, java.lang.String&nbsp;value)``void``setValues(double[]&nbsp;v)`  
sets the value for the variable### Methods inherited from class java.lang.Object

`clone`, `equals`, `finalize`, `getClass`, `hashCode`, `notify`, `notifyAll`, `toString`, `wait`, `wait`, `wait`

## Constructor Detail

### PHXReferenceArray

```java
public&nbsp;PHXReferenceArray()

```

Constructor

## Method Detail

### getProperties

```java
public&nbsp;PHXRefArrayProperty[]&nbsp;getProperties()

```

Get-set function for MCRE

### setProperties

```java
public&nbsp;void&nbsp;setProperties(PHXRefArrayProperty[]&nbsp;p)

```

### getValues

```java
public&nbsp;double[]&nbsp;getValues()

```

Retrieves the current value of the variable

**Returns:**

- the value of the variable

### setValues

```java
public&nbsp;void&nbsp;setValues(double[]&nbsp;v)

```

Sets the value for the variable

**Parameters:**

- `v` - the value

### getReference

```java
public&nbsp;java.lang.String[]&nbsp;getReference()

```

Retrieves the current reference string. This is a client-supplied value describing what the reference value points to.

**Returns:**

- the reference string

### getReference

```java
public&nbsp;java.lang.String&nbsp;getReference(int&nbsp;i)

```

### setReference

```java
public&nbsp;void&nbsp;setReference(java.lang.String[]&nbsp;ref)

```

Sets the value for the reference string. This should only be called by the client application, e.g. ModelCenter.

**Parameters:**

- `ref` - the reference string

### setReference

```java
public&nbsp;void&nbsp;setReference(int&nbsp;i,
                         java.lang.String&nbsp;ref)

```

### getLength

```java
public&nbsp;int&nbsp;getLength()

```

Retrieves the number of references in the array

**Returns:**

- the number of references

### setLength

```java
public&nbsp;void&nbsp;setLength(int&nbsp;v)

```

Sets the number of references

**Parameters:**

- `v` - the number of references

### getAutoGrow

```java
public&nbsp;boolean&nbsp;getAutoGrow()

```

Retrieves the `autoGrow` value

**Returns:**

- `true` or `false`

### setAutoGrow

```java
public&nbsp;void&nbsp;setAutoGrow(boolean&nbsp;flag)

```

Sets the `autoGrow` value. If `true`, the client application is allowed to resize the array as needed.

**Parameters:**

- `flag` - `true` or `false`

### createRefProp

```java
public&nbsp;IPHXRefPropInfo&nbsp;createRefProp(java.lang.String&nbsp;name,
                                     java.lang.String&nbsp;type)

```

Adds a ref prop to the variable.

**Parameters:**

- `name` - the name of the property
- `type` - property type: "long", "double", "boolean", or "string"

### getRefPropValueDouble

```java
public&nbsp;double&nbsp;getRefPropValueDouble(java.lang.String&nbsp;name,
                                    int&nbsp;index)
                             throws PHXTypeMismatchException

```

Gets a value for a ref prop

**Parameters:**

- `name` - the name of the property
- `index` - the array element

**Returns:**

- the value of the property

**Throws:**

- [`PHXTypeMismatchException`](PHXTypeMismatchException.md)

### getRefPropValueLong

```java
public&nbsp;long&nbsp;getRefPropValueLong(java.lang.String&nbsp;name,
                                int&nbsp;index)
                         throws PHXTypeMismatchException

```

**Throws:**

- [`PHXTypeMismatchException`](PHXTypeMismatchException.md)

### getRefPropValueBoolean

```java
public&nbsp;boolean&nbsp;getRefPropValueBoolean(java.lang.String&nbsp;name,
                                      int&nbsp;index)
                               throws PHXTypeMismatchException

```

**Throws:**

- [`PHXTypeMismatchException`](PHXTypeMismatchException.md)

### getRefPropValueString

```java
public&nbsp;java.lang.String&nbsp;getRefPropValueString(java.lang.String&nbsp;name,
                                              int&nbsp;index)
                                       throws PHXTypeMismatchException

```

**Throws:**

- [`PHXTypeMismatchException`](PHXTypeMismatchException.md)

### setRefPropValue

```java
public&nbsp;void&nbsp;setRefPropValue(java.lang.String&nbsp;name,
                            int&nbsp;index,
                            double&nbsp;value)
                     throws PHXTypeMismatchException

```

Sets a value for a ref prop

**Parameters:**

- `name` - the name of the property
- `index` - the array element
- `value` - the value of the property

**Throws:**

- [`PHXTypeMismatchException`](PHXTypeMismatchException.md)

### setRefPropValue

```java
public&nbsp;void&nbsp;setRefPropValue(java.lang.String&nbsp;name,
                            int&nbsp;index,
                            long&nbsp;value)
                     throws PHXTypeMismatchException

```

**Throws:**

- [`PHXTypeMismatchException`](PHXTypeMismatchException.md)

### setRefPropValue

```java
public&nbsp;void&nbsp;setRefPropValue(java.lang.String&nbsp;name,
                            int&nbsp;index,
                            boolean&nbsp;value)
                     throws PHXTypeMismatchException

```

**Throws:**

- [`PHXTypeMismatchException`](PHXTypeMismatchException.md)

### setRefPropValue

```java
public&nbsp;void&nbsp;setRefPropValue(java.lang.String&nbsp;name,
                            int&nbsp;index,
                            java.lang.String&nbsp;value)
                     throws PHXTypeMismatchException

```

**Throws:**

- [`PHXTypeMismatchException`](PHXTypeMismatchException.md)