    

 ## On this page

  

 

 # Class PHXStringArray

 Last update: 16.07.2025 

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

```
↳ java.lang.Object
  ↳ com.phoenix_int.aserver.types.PHXSimpleType
    ↳ com.phoenix_int.aserver.types.PHXSimpleArray<phxstring>
      ↳ com.phoenix_int.aserver.types.PHXStringArray

```

**All Implemented Interfaces:**

- [IPHXType](IPHXType.md), [IPHXType2](IPHXType2.md), [IPHXUnits](IPHXUnits.md), java.lang.Iterable[PHXString](PHXString.md)&gt;

---

```java
public class PHXStringArray
extends PHXSimpleArray<phxstring>

```

Class wraps an array of [PHXString](PHXString.md) variables for the ScriptWrapper utility.

**See Also:**

- [PHXSimpleArray](PHXSimpleArray.md)

## Nested Class Summary

### Nested classes/interfaces inherited from interface com.phoenix\_int.aserver.types.[IPHXType2](IPHXType2.md)

`IPHXType2.IVisitor<t>`

## Field Summary

### Fields inherited from class com.phoenix\_int.aserver.types.[PHXSimpleArray](PHXSimpleArray.md)

`_data,_lockDims,_lockResize`

## Constructor Summary

Constructor and Description`PHXStringArray()``PHXStringArray(java.lang.Object&nbsp;data)``PHXStringArray(PHXStringArrayother)`## Method Summary

Modifier and TypeMethod and Description`protected void``_getMetaData(PHXSimpleTypev2)`  
Worker which takes the meta data from an instance of PHXSimpleType and sets it into our meta data.`protected void``_setMetaData(PHXSimpleTypev2)`  
Sets a simple type's meta data based on the meta data in this object.`<t>&nbsp;T``Accept(IPHXType2.IVisitor<t>&nbsp;visitor)`  
Accept a Visitor.`PHXStringArray``createCopy()`  
Create a copy of this instance, including the value and metadata.`protected boolean``dataTypeOK(java.lang.Class&nbsp;c)`  
Must override this function and return `true` if the specified class is acceptable as an array element component type.`protected java.lang.Object``elementFromString(java.lang.String&nbsp;val)`  
Sub-classes must provide an implementation of this function which converts a string form of a single element to Object form.`void``fromObject(java.lang.Object&nbsp;toRead)`  
Load the value of this object from the specified object.`java.lang.String[]``getEnumAliases()`  
An interface function for the enumeration array`java.lang.String``getEnumAliasesStr()`  
An interface function for the enumeration array`java.lang.String[]``getEnumValues()`  
An interface function for the enumeration array`java.lang.String``getEnumValuesStr()`  
Interface function to pass out the enumeration array as a comma separated string`java.lang.String``getStringValue(int&nbsp;index)`  
Gets a particular element as a String`java.lang.String``getStringValue(int[]&nbsp;index)`  
Gets a particular element as a String`PHXString``getValue(int[]&nbsp;index)<br>`Gets a particular element as a PHXString`void``setEnumAliases(java.lang.String&nbsp;values)`  
takes a comma separated string of values and fills the enumeration aliases list with values.`void``setEnumAliases(java.lang.String[]&nbsp;values)`  
Sets the enumeration aliases list`void``setEnumValues(java.lang.String&nbsp;values)`  
takes a comma separated string of values and fills the enumeration List with values.`void``setEnumValues(java.lang.String[]&nbsp;values)`  
sets enum values`void``setValue(int[]&nbsp;index,PHXStringval)`  
Sets a particular element as a PHXString`void``setValue(int[]&nbsp;index, java.lang.String&nbsp;val)`  
Sets a particular element as a String`void``setValue(int&nbsp;index, java.lang.String&nbsp;val)`  
Sets a particular element as a String### Methods inherited from class com.phoenix\_int.aserver.types.[PHXSimpleArray](PHXSimpleArray.md)

`_getMetaData`, `_setMetaData`, `allocateElement`, `checkRectangular`, `copy`, `equalsNatural`, `fromString`, `fromString`, `fromString`, `fromString`, `fromString2`, `generateFor`, `generateFor`, `getArray`, `getArrayElement`, `getArrayElement`, `getComponentType`, `getComponentType`, `getDimensions`, `getDimensions`, `getFirst`, `getLength`, `getLength`, `getLockResize`, `getnDIndex`, `getNumDimensions`, `getNumDimensions`, `getSelf`, `getValue`, `incrementIndex`, `iterator`, `lockDimensions`, `newIndex`, `parseIndex`, `resize`, `setArray`, `setArrayElement`, `setArrayElement`, `setDimensions`, `setFirst`, `setLength`, `setLength`, `setLockResize`, `setValue`, `toString`, `toString`, `toString`, `toString`, `toString2`, `toString2`, `toString2`, `validElement`

### Methods inherited from class com.phoenix\_int.aserver.types.[PHXSimpleType](PHXSimpleType.md)

`_copyMetadataFromOther`, `addPropertyChangeListener`, `getDescription`, `getEnumTokens`, `getHasChanged`, `getUnits`, `removePropertyChangeListener`, `setDescription`, `setHasChanged`, `setUnits`

### Methods inherited from class java.lang.Object

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

### Methods inherited from interface java.lang.Iterable

`forEach`, `spliterator`

## Constructor Detail

### PHXStringArray

```java
public&nbsp;PHXStringArray()

```

### PHXStringArray

```java
public&nbsp;PHXStringArray(java.lang.Object&nbsp;data)

```

### PHXStringArray

```java
public&nbsp;PHXStringArray(PHXStringArray&nbsp;other)

```

### Method Detail

### dataTypeOK

```java
protected&nbsp;boolean&nbsp;dataTypeOK(java.lang.Class&nbsp;c)

```

Description copied from class: [`PHXSimpleArray`](PHXSimpleArray.md)

Must override this function and return `true` if the specified class is acceptable as an array element component type.

**Specified by:**

- `dataTypeOK` in class `PHXSimpleArray<phxstring>`

### setEnumValues

```java
public&nbsp;void&nbsp;setEnumValues(java.lang.String&nbsp;values)

```

Takes a comma separated string of values and fills the enumeration List with values.

**Parameters:**

- `values` - A comma separated string of enumeration values

### setEnumValues

```java
public&nbsp;void&nbsp;setEnumValues(java.lang.String[]&nbsp;values)

```

Sets enum values

**Parameters:**

- `values:` - list of enum values

### getEnumValues

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

```

An interface function for the enumeration array

**Returns:**

- an array of the possible values of the list

### getEnumValuesStr

```java
public&nbsp;java.lang.String&nbsp;getEnumValuesStr()

```

Interface function to pass out the enumeration array as a comma separated string

**Returns:**

- comma separated string of the possible values of the list

### setEnumAliases

```java
public&nbsp;void&nbsp;setEnumAliases(java.lang.String&nbsp;values)

```

Takes a comma separated string of values and fills the enumeration aliases list with values.

**Parameters:**

- `values` - A comma separated string of enumeration aliases

### setEnumAliases

```java
public&nbsp;void&nbsp;setEnumAliases(java.lang.String[]&nbsp;values)

```

Sets the enumeration aliases list

**Parameters:**

- `values` - An array of strings

### getEnumAliases

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

```

An interface function for the enumeration array

**Returns:**

- an array of the possible values of the list

### getEnumAliasesStr

```java
public&nbsp;java.lang.String&nbsp;getEnumAliasesStr()

```

An interface function for the enumeration array

**Returns:**

- an comma separated string of the possible values of the list

### \_setMetaData

```java
protected&nbsp;void&nbsp;_setMetaData(PHXSimpleType&nbsp;v2)

```

Description copied from class: [`PHXSimpleArray`](PHXSimpleArray.md)

Sets a simple type's meta data based on the meta data in this object. Override this to set additional information in sub-classes. Be sure to call `super._setMetaData(PHXSimpleType)`.

**Overrides:**

- `_setMetaData` in class `PHXSimpleArray<phxstring>`

### \_getMetaData

```java
protected&nbsp;void&nbsp;_getMetaData(PHXSimpleType&nbsp;v2)

```

Description copied from class: [`PHXSimpleArray`](PHXSimpleArray.md)

Worker which takes the meta data from an instance of PHXSimpleType and sets it into our meta data. Override this in order to add more custom meta data in sub-classes. Be sure to call `super._getMetaData(PHXSimpleType)`, though!

**Overrides:**

- `_getMetaData` in class `PHXSimpleArray<phxstring>`

### getValue

```java
public&nbsp;PHXString&nbsp;getValue(int[]&nbsp;index)

```

Gets a particular element as a PHXString

**Specified by:**

- `getValue` in class `PHXSimpleArray<phxstring>`

**Parameters:**

- `index` - 1D array index

**Returns:**

- referenced array value

### getStringValue

```java
public&nbsp;java.lang.String&nbsp;getStringValue(int&nbsp;index)

```

Gets a particular element as a String

**Parameters:**

- `index` - nD array index

**Returns:**

- referenced array value

**Throws:**

- `java.lang.IllegalArgumentException` - thrown if called on non-1D array

### getStringValue

```java
public&nbsp;java.lang.String&nbsp;getStringValue(int[]&nbsp;index)

```

Gets a particular element as a String

**Parameters:**

- `index` - nD array index

**Returns:**

- referenced array value

### setValue

```java
public&nbsp;void&nbsp;setValue(int[]&nbsp;index,
                     PHXString&nbsp;val)

```

Sets a particular element as a PHXString

**Specified by:**

- `setValue` in class `PHXSimpleArray<phxstring>`

**Parameters:**

- `index` - 1D array index
- `val` - value to set

### setValue

```java
public&nbsp;void&nbsp;setValue(int&nbsp;index,
                     java.lang.String&nbsp;val)

```

Sets a particular element as a String

**Parameters:**

- `index` - 1D array index
- `val` - value to set

**Throws:**

- `java.lang.IllegalArgumentException` - thrown if called on non-1D array

### setValue

```java
public&nbsp;void&nbsp;setValue(int[]&nbsp;index,
                     java.lang.String&nbsp;val)

```

Sets a particular element as a String

**Parameters:**

- `index` - 1D array index
- `val` - value to set

### elementFromString

```java
protected&nbsp;java.lang.Object&nbsp;elementFromString(java.lang.String&nbsp;val)

```

Description copied from class: [`PHXSimpleArray`](PHXSimpleArray.md)

Sub-classes must provide an implementation of this function which converts a string form of a single element to Object form. This is only used when the element type does not implement [IPHXType](IPHXType.md) or [IPHXType2](IPHXType2.md). For primitives, return the wrapper objects.

**Specified by:**

- `elementFromString` in class `PHXSimpleArray<phxstring>`

### fromObject

```java
public&nbsp;void&nbsp;fromObject(java.lang.Object&nbsp;toRead)
                throws PHXInvalidTypeException

```

Load the value of this object from the specified object. This will read the object and attempt to convert it if it is a known type. If the type isn't recognized, it will throw a [`PHXInvalidTypeException`](PHXInvalidTypeException.md). If there is an error in conversion, it will also throw a [`PHXInvalidTypeException`](PHXInvalidTypeException.md).

NOTE: while it might be logical to think you can create a `PHX(Type)Array` from, say, an array of `java.lang.(Type)`, that is not currently upported. You MUST use the PHX string array formatting style.

**Specified by:**

- `fromObject` in class [`PHXSimpleType`](PHXSimpleType.md)

**Parameters:**

- `toRead` - to object from which to load this objects value.

**Throws:**

- [`PHXInvalidTypeException`](PHXInvalidTypeException.md) - if the specified object is of an invalid type or there is an error in conversion.

### Accept

```java
public&nbsp;<t>&nbsp;T&nbsp;Accept(IPHXType2.IVisitor<t>&nbsp;visitor)

```

Accept a Visitor.

**Type Parameters:**

- `T` - Type of the result of the visit.

**Parameters:**

- `visitor` - The visitor to accept.

**Returns:**

- The results of the visit.

### createCopy

```java
public&nbsp;PHXStringArray&nbsp;createCopy()

```

Description copied from class: [`PHXSimpleType`](PHXSimpleType.md)

Create a copy of this instance, including the value and metadata.

**Specified by:**

- `createCopy` in class [`PHXSimpleType`](PHXSimpleType.md)

**Returns:**

- a newly constructed copy of this instance.