Skip to main content

ModelCenter Remote Execution Java API 2026 R1

Class: PHXLong

Last update: 22.06.2026

Package: com.phoenix_int.aserver.types

Class Hierarchy

↳ java.lang.Object
  ↳ com.phoenix_int.aserver.types.PHXSimpleType
    ↳ com.phoenix_int.aserver.types.PHXLong

Implemented Interfaces


Declaration

public class PHXLong
extends PHXSimpleType
implements IPHXFormat

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

  • value: long
  • valueStr: the source string for the value, useful for error checking when the value is NaN
  • hasUpperValue: boolean
  • upperValue: long
  • hasLowerValue: boolean
  • lowerValue: long
  • enumValues: long[]
  • enumAliases: String[]

If the variable has an upper or lower bound and an attempt is made to store an invalid value, then an exception will be thrown.

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
PHXLong()
Initializes value to 0.
PHXLong(long&nbsp;value)
Initializes value to the specified value
PHXLong(PHXLongother)
Clone another PHXLong's value and metadata.

Method Summary

Modifier and Type Method and Description
protected void _copyMetadataFromOther(PHXLongother)
Clone another PHXLong's metadata.
<t>&nbsp;T Accept(IPHXType2.IVisitor<t>&nbsp;visitor)
Accept a Visitor.
static java.lang.String arrayToString(long[]&nbsp;sa)
PHXLong 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
long[] getEnumValues()
Interface function to pass out the enumeration array
java.lang.String getEnumValuesStr()
Interface function to pass out the enumeration array as a comma separated string
java.lang.String getFormat()
Get the format string for the variable
boolean getHasFormat()
Deprecated in favor of hasFormat()
boolean getHasLowerBound()
retrieves the hasLowerBound flag
boolean getHasUpperBound()
retrieves the hasUpperBound flag
long getLowerBound()
retrieves the current lower bound value
long getUpperBound()
retrieves the current upper bound value
long getValue()
retrieves the current value of the variable
java.lang.String getValueStr()
retrieves the string value of this variable as passed into the last call to fromString().
boolean hasFormat()
Whether or not the variable has a format
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 strings which represent aliases for the enumValues.
void setEnumValues(long[]&nbsp;values)
sets the possible values a variable may be
void setEnumValues(java.lang.String&nbsp;strEnumList)
sets the possible values a variable may be
void setFormat(java.lang.String&nbsp;format)
Set the format string for the variable
void setHasLowerBound(boolean&nbsp;value)
sets the hasLowerBound flag
void setHasUpperBound(boolean&nbsp;value)
sets the hasUpperBound flag
void setIgnoreConversionErrors(boolean&nbsp;ignoreConversionErrors)
indicates whether the object should accept bad values in the fromString() method without throwning an exception.
void setLowerBound(long&nbsp;value)
sets the lower bound.
void setLowerBound(java.lang.String&nbsp;value)
void setUpperBound(long&nbsp;value)
sets the upper bound.
void setUpperBound(java.lang.String&nbsp;value)
void setValue(long&nbsp;v)
sets the value for the variable
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

PHXLong

public&nbsp;PHXLong()

Initializes value to 0.

PHXLong

public&nbsp;PHXLong(long&nbsp;value)

Initializes value to the specified value

Parameters: : value - the value to use

PHXLong

public&nbsp;PHXLong(PHXLong&nbsp;other)

Clone another PHXLong's value and metadata.

Parameters:

  • other - the other PHXLong to clone.

Method Detail

_copyMetadataFromOther

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

Clone another PHXLong's metadata.

Parameters:

getValue

public&nbsp;long&nbsp;getValue()

Retrieves the current value of the variable

Returns:

  • the value of the variable

getValueStr

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

Retrieves the string value of this variable as passed into the last call to fromString(). This may not be equivalent to the current value of the variable.

Returns:

  • the string last used to set the variable

setValue

public&nbsp;void&nbsp;setValue(long&nbsp;v)

Sets the value for the variable

Parameters:

  • v - the value

setUpperBound

public&nbsp;void&nbsp;setUpperBound(long&nbsp;value)

Sets the upper bound. The hasUpperBound value is set to true

Parameters:

  • value - the upper bound

setUpperBound

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

getUpperBound

public&nbsp;long&nbsp;getUpperBound()

Retrieves the current upper bound value

Returns:

  • the upper bound

setLowerBound

public&nbsp;void&nbsp;setLowerBound(long&nbsp;value)

Sets the lower bound. The hasLowerBound value is set to true

Parameters:

  • value - the lower bound

setLowerBound

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

getLowerBound

public&nbsp;long&nbsp;getLowerBound()

Retrieves the current lower bound value

Returns:

  • the lower bound

setHasUpperBound

public&nbsp;void&nbsp;setHasUpperBound(boolean&nbsp;value)

Sets the hasUpperBound flag

Parameters:

  • value - true or false

getHasUpperBound

public&nbsp;boolean&nbsp;getHasUpperBound()

Retrieves the hasUpperBound flag

Returns:

  • true or false

setHasLowerBound

public&nbsp;void&nbsp;setHasLowerBound(boolean&nbsp;value)

Sets the hasLowerBound flag

Parameters:

  • value - true or false

getHasLowerBound

public&nbsp;boolean&nbsp;getHasLowerBound()

Retrieves the hasLowerBound flag

Returns:

  • true or false

toString2

public&nbsp;PHXStringBuffer&nbsp;toString2()

Converts the variable to a PHXStringBuffer

Specified by:

Returns:

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

Specified by:

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

Specified by:

Parameters:

  • value - the value to convert

setIgnoreConversionErrors

public&nbsp;void&nbsp;setIgnoreConversionErrors(boolean&nbsp;ignoreConversionErrors)

Indicates whether the object should accept bad values in the fromString() method without throwning an exception. The raw values is stored in property valueStr regardless.

Parameters:

  • ignoreConversionErrors - true if errors should be ignored

setEnumValues

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

Sets the possible values a variable may be

Parameters:

  • strEnumList - the comma sepperated list to convert to values

setEnumValues

public&nbsp;void&nbsp;setEnumValues(long[]&nbsp;values)

Sets the possible values a variable may be

Parameters:

  • values - Array of longs which represents valid values

getEnumValues

public&nbsp;long[]&nbsp;getEnumValues()

Interface function to pass out the enumeration array

Returns:

  • an array of the possible values of the list

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

setEnumAliases

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

Takes an array of strings which represent aliases for the enumValues.

Parameters:

  • values - A String array of enumeration aliases

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

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

getHasFormat

@Deprecated
public&nbsp;boolean&nbsp;getHasFormat()

Deprecated in favor of hasFormat()

hasFormat

public&nbsp;boolean&nbsp;hasFormat()

Whether or not the variable has a format

Specified by:

Returns:

  • true if variable has a format

setFormat

public&nbsp;void&nbsp;setFormat(java.lang.String&nbsp;format)

Set the format string for the variable

Specified by:

Parameters:

  • format - format string

getFormat

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

Get the format string for the variable

Specified by:

Returns:

  • format string

arrayToString

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

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:

Throws:

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

Specified by:

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;PHXLong&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