Skip to main content

ModelCenter Remote Execution Java API 2025 R2

Class PHXString

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.PHXString

All Implemented Interfaces:


public class PHXString
extends PHXSimpleType

The type for Strings. This class adds the following features to the PHXSimpleType:

  • value: String
  • enumValues: String[]
  • enumAliases: String[]

See Also:

Nested Class Summary

Nested classes/interfaces inherited from interface com.phoenix_int.aserver.types.IPHXType2

IPHXType2.IVisitor<t>

Constructor Summary

Constructor and Description
PHXString()
PHXString(PHXStringother)
Clone another PHXString's value and metadata.
PHXString(java.lang.String&nbsp;value)

Method Summary

Modifier and Type Method and Description
protected void _copyMetadataFromOther(PHXStringother)
Clone another PHXString's metadata.
<t>&nbsp;T Accept(IPHXType2.IVisitor<t>&nbsp;visitor)
Accept a Visitor.
static java.lang.String arrayToString(java.lang.String[]&nbsp;sa)
Deprecated.
static java.lang.String arrayToStringEscaped(java.lang.String[]&nbsp;sa)
Quotes each element of the array using c-style escape sequences, then builds a comma separated list of the elements with quotes around each element.
PHXString createCopy()
Create a copy of this instance, including the value and metadata.
boolean equalsNatural(PHXSimpleTypetoCompare)
Compare this PHXSimpleType to another PHXSimpleType.
void fromObject(java.lang.Object&nbsp;toRead)
Load the value of this object from the specified object.
void fromString(java.lang.String&nbsp;value)
converts a String representation to the internal value
void fromString2(PHXStringBuffervalue)
converts a PHXStringBuffer representation to the internal value
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()
lists enum values
java.lang.String getEnumValuesStr()
Interface function to pass out the enumeration array as a comma separated string
java.lang.String getValue()
retrieves the current value of the variable
static void main(java.lang.String[]&nbsp;args)
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)
Takes an array of values and fills the enumeration aliases list with values.
void setEnumValues(java.lang.String&nbsp;input)
sets enum values
void setEnumValues(java.lang.String[]&nbsp;values)
sets enum values
void setValue(PHXStringBufferv)
sets the value for the variable
void setValue(java.lang.String&nbsp;v)
sets the value for the variable
static java.lang.String[] stringToArray(java.lang.String&nbsp;s)
java.lang.String toString()
converts the variable to a string
PHXStringBuffer toString2()
converts the variable to a PHXStringBuffer

Methods inherited from class com.phoenix_int.aserver.types.PHXSimpleType

_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

Constructor Detail

PHXString

public&nbsp;PHXString()

PHXString

public&nbsp;PHXString(java.lang.String&nbsp;value)

PHXString

public&nbsp;PHXString(PHXString&nbsp;other)

Clone another PHXString's value and metadata.

Parameters:

  • other - the other PHXString to clone.

Method Detail

getValue

public&nbsp;java.lang.String&nbsp;getValue()

Retrieves the current value of the variable

Returns:

  • the value of the variable

setValue

public&nbsp;void&nbsp;setValue(java.lang.String&nbsp;v)
              throws java.lang.IllegalArgumentException

Sets the value for the variable

Parameters:

  • v - the value

Throws:

  • java.lang.IllegalArgumentException

setValue

public&nbsp;void&nbsp;setValue(PHXStringBuffer&nbsp;v)
              throws java.lang.IllegalArgumentException

Sets the value for the variable

Parameters:

  • v - the value

Throws:

  • java.lang.IllegalArgumentException

toString2

public&nbsp;PHXStringBuffer&nbsp;toString2()

Converts the variable to a PHXStringBuffer

Returns:

  • a PHXStringBuffer representation of the variable

toString

public&nbsp;java.lang.String&nbsp;toString()

Converts the variable to a string

Specified by:

Overrides:

  • toString in class java.lang.Object

Returns:

  • a String representation of the variable

fromString2

public&nbsp;void&nbsp;fromString2(PHXStringBuffer&nbsp;value)

Converts a PHXStringBuffer representation to the internal value

Parameters:

  • value - the value to convert

fromString

public&nbsp;void&nbsp;fromString(java.lang.String&nbsp;value)

Converts a String representation to the internal value

Parameters:

  • value - the value to convert

getEnumValues

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

Lists enum values

Returns:

  • enum values

getEnumValuesStr

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

setEnumValues

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

Sets enum values

Parameters:

  • input: - list of enum values

setEnumValues

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

Sets enum values

Parameters:

  • values: - list of enum values

setEnumAliases

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

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

Takes an array of values and fills the enumeration aliases list with values. If null, aliases will be set to an empty list.

Parameters:

  • values - string array of enumeration aliases

getEnumAliases

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

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

_copyMetadataFromOther

protected final&nbsp;void&nbsp;_copyMetadataFromOther(PHXString&nbsp;other)

Clone another PHXString's metadata.

Parameters:

  • other - the other PHXString

arrayToString

@Deprecated
public static&nbsp;java.lang.String&nbsp;arrayToString(java.lang.String[]&nbsp;sa)

Deprecated. Do not use, does not generate correct strings.

Parameters:

  • sa -

Returns:

stringToArray

public static&nbsp;java.lang.String[]&nbsp;stringToArray(java.lang.String&nbsp;s)

arrayToStringEscaped

public static&nbsp;java.lang.String&nbsp;arrayToStringEscaped(java.lang.String[]&nbsp;sa)

Quotes each element of the array using c-style escape sequences, then builds a comma separated list of the elements with quotes around each element.

Parameters:

  • sa - The array to read

Returns:

  • The generated string.

main

public static&nbsp;void&nbsp;main(java.lang.String[]&nbsp;args)

equalsNatural

public&nbsp;boolean&nbsp;equalsNatural(PHXSimpleType&nbsp;toCompare)
                      throws PHXTypeMismatchException

Compare this PHXSimpleType to another PHXSimpleType. This type of comparison is different than Comparable in that it does a natural comparison between numbers. It is not designed, nor suited, for use in things such as sets, and may behave oddly if put in those circumstances.

Specified by:

Parameters:

  • toCompare -

Returns:

  • a negative number if this object is less than toCompare, a positive number if this object is greater than toCompare, and zero if these two objects are equal.

Throws:

  • PHXTypeMismatchException - if the given PHXSimpleType cannot be compared with this object.

fromObject

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. If there is an error in conversion, it will also throw a PHXInvalidTypeException.

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:

Parameters:

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

Throws:

Accept

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

public&nbsp;PHXString&nbsp;createCopy()

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

Specified by:

Returns:

  • a newly constructed copy of this instance.

Connect with Ansys