com.phoenix_int.aserver.types
Class PHXLong

java.lang.Object
  extended by com.phoenix_int.aserver.types.PHXSimpleType
      extended by com.phoenix_int.aserver.types.PHXLong
All Implemented Interfaces:
IPHXFormat, IPHXType, IPHXType2, IPHXUnits

public class PHXLong
extends PHXSimpleType
implements IPHXFormat

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

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:
PHXSimpleType

Constructor Summary
PHXLong()
           
 
Method Summary
static java.lang.String arrayToString(long[] sa)
           
 void fromString(java.lang.String value)
          converts a String representation to the internal value
 void fromString2(PHXStringBuffer value)
          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 values)
          takes a comma seperated string of values and fills the enumeration aliases list with values.
 void setEnumAliases(java.lang.String[] values)
          Takes an array of strings which represent aliases for the enumValues.
 void setEnumValues(long[] values)
          sets the possible values a variable may be
 void setEnumValues(java.lang.String strEnumList)
          sets the possible values a variable may be
 void setFormat(java.lang.String format)
          Set the format string for the variable
 void setHasLowerBound(boolean value)
          sets the hasLowerBound flag
 void setHasUpperBound(boolean value)
          sets the hasUpperBound flag
 void setIgnoreConversionErrors(boolean ignoreConversionErrors)
          indicates whether the object should accept bad values in the fromString() method without throwning an exception.
 void setLowerBound(long value)
          sets the lower bound.
 void setLowerBound(java.lang.String value)
           
 void setUpperBound(long value)
          sets the upper bound.
 void setUpperBound(java.lang.String value)
           
 void setValue(long 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
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 PHXLong()
Method Detail

getValue

public long getValue()
retrieves the current value of the variable

Returns:
the value of the variable

getValueStr

public java.lang.String 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 void setValue(long v)
sets the value for the variable

Parameters:
v - the value

setUpperBound

public void setUpperBound(long value)
sets the upper bound. The hasUpperBound value is set to true

Parameters:
value - the upper bound

setUpperBound

public void setUpperBound(java.lang.String value)

getUpperBound

public long getUpperBound()
retrieves the current upper bound value

Returns:
the upper bound

setLowerBound

public void setLowerBound(long value)
sets the lower bound. The hasLowerBound value is set to true

Parameters:
value - the lower bound

setLowerBound

public void setLowerBound(java.lang.String value)

getLowerBound

public long getLowerBound()
retrieves the current lower bound value

Returns:
the lower bound

setHasUpperBound

public void setHasUpperBound(boolean value)
sets the hasUpperBound flag

Parameters:
value - true or false

getHasUpperBound

public boolean getHasUpperBound()
retrieves the hasUpperBound flag

Returns:
true or false

setHasLowerBound

public void setHasLowerBound(boolean value)
sets the hasLowerBound flag

Parameters:
value - true or false

getHasLowerBound

public boolean getHasLowerBound()
retrieves the hasLowerBound flag

Returns:
true or false

toString2

public PHXStringBuffer toString2()
converts the variable to a PHXStringBuffer

Specified by:
toString2 in interface IPHXType2
Returns:
a PHXStringBuffer representation of the variable

toString

public java.lang.String toString()
converts the variable to a string

Specified by:
toString in interface IPHXType
Overrides:
toString in class java.lang.Object
Returns:
a String representation of the variable

fromString2

public void fromString2(PHXStringBuffer value)
converts a PHXStringBuffer representation to the internal value

Specified by:
fromString2 in interface IPHXType2
Parameters:
value - the value to convert

fromString

public void fromString(java.lang.String value)
converts a String representation to the internal value

Specified by:
fromString in interface IPHXType
Parameters:
value - the value to convert

setIgnoreConversionErrors

public void setIgnoreConversionErrors(boolean 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 void setEnumValues(java.lang.String strEnumList)
sets the possible values a variable may be

Parameters:
strEnumList - the comma sepperated list to convert to values

setEnumValues

public void setEnumValues(long[] values)
sets the possible values a variable may be

Parameters:
values - Array of longs which represents valid values

getEnumValues

public long[] getEnumValues()
Interface function to pass out the enumeration array

Returns:
an array of the possible values of the list

getEnumValuesStr

public java.lang.String 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 void setEnumAliases(java.lang.String[] values)
Takes an array of strings which represent aliases for the enumValues.

Parameters:
values - A String array of enumeration aliases

setEnumAliases

public void setEnumAliases(java.lang.String values)
takes a comma seperated string of values and fills the enumeration aliases list with values.

Parameters:
values - A comma seperated string of enumeration aliases

getEnumAliases

public java.lang.String[] getEnumAliases()
An interface function for the enumeration array

Returns:
an array of the possible values of the list

getEnumAliasesStr

public java.lang.String getEnumAliasesStr()
An interface function for the enumeration array

Returns:
an comma separated string of the possible values of the list

getHasFormat

@Deprecated
public boolean getHasFormat()
Deprecated. in favor of hasFormat()


hasFormat

public boolean hasFormat()
Whether or not the variable has a format

Specified by:
hasFormat in interface IPHXFormat
Returns:
true if variable has a format

setFormat

public void setFormat(java.lang.String format)
Set the format string for the variable

Specified by:
setFormat in interface IPHXFormat
Parameters:
format - format string

getFormat

public java.lang.String getFormat()
Get the format string for the variable

Specified by:
getFormat in interface IPHXFormat
Returns:
format string

arrayToString

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