com.isti.util
Class CfgPropItem

java.lang.Object
  extended bycom.isti.util.CfgPropItem
All Implemented Interfaces:
java.lang.Comparable, IstiNamedValueInterface, PropItemInterface, java.io.Serializable

public class CfgPropItem
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable, PropItemInterface

Class CfgPropItem defines a configuration property item used with the 'CfgProperties' (or 'AppletProperties') class. The item has a name, a value, a default value, a loaded-flag (set true if the item has been "loaded"), a required-flag (set true if the item must be "loaded"), a command-line parameter name, a description string, and several additional flags.

See Also:
Serialized Form

Nested Class Summary
static class CfgPropItem.ItemGroupSelector
          Class ItemGroupSelector defines a run-time-configurable group selector for 'CfgPropItem' objects.
(package private)  class CfgPropItem.MapEntry
           
 
Field Summary
protected  java.lang.Object auxiliaryObj
           
protected  boolean booleanValue
           
protected  boolean cmdLnEnbFlag
           
protected  boolean cmdLnLoadedFlag
           
protected  boolean cmdLnOnlyFlag
           
protected  java.lang.String cmdLnParamName
           
protected  java.awt.Color colorValue
           
protected  java.lang.Object defaultValue
           
protected  java.lang.String descriptionStr
           
protected  boolean emptyStringDefaultFlag
           
protected  java.lang.Object groupSelObj
           
protected  boolean helpScreenFlag
           
protected  boolean ignoreItemFlag
           
protected  long lastChangeTime
           
protected  java.util.Vector listenersVec
           
protected  boolean loadedFlag
           
protected  java.lang.String name
           
protected  java.lang.Number numberValue
           
protected  boolean requiredFlag
           
protected  boolean startupConfigFlag
           
protected  java.lang.String stringValue
           
static char SWITCH1_CHAR
           
static char SWITCH2_CHAR
           
protected  CfgPropValidator validatorObj
           
protected  java.lang.Object value
           
 
Fields inherited from interface com.isti.util.IstiNamedValueInterface
sepCh
 
Constructor Summary
CfgPropItem(java.lang.String name, java.lang.Object defaultValue)
          Creates a configuration property item.
CfgPropItem(java.lang.String name, java.lang.Object defaultValue, boolean requiredFlag)
          Creates a configuration property item.
CfgPropItem(java.lang.String name, java.lang.Object defaultValue, boolean requiredFlag, java.lang.String cmdLnParamName, java.lang.String descriptionStr)
          Creates a configuration property item.
CfgPropItem(java.lang.String name, java.lang.Object defaultValue, boolean requiredFlag, java.lang.String paramNameStr, java.lang.String descriptionStr, boolean cmdLnEnbFlag, boolean helpScreenFlag, boolean cmdLnOnlyFlag)
          Creates a configuration property item.
CfgPropItem(java.lang.String name, java.lang.Object defaultValue, java.lang.String cmdLnParamName)
          Creates a configuration property item.
CfgPropItem(java.lang.String name, java.lang.Object defaultValue, java.lang.String cmdLnParamName, java.lang.String descriptionStr)
          Creates a configuration property item.
CfgPropItem(java.lang.String name, java.lang.Object defaultValue, java.lang.String cmdLnParamName, java.lang.String descriptionStr, boolean cmdLnEnbFlag, boolean helpScreenFlag)
          Creates a configuration property item.
CfgPropItem(java.lang.String name, java.lang.Object defaultValue, java.lang.String cmdLnParamName, java.lang.String descriptionStr, boolean cmdLnEnbFlag, boolean helpScreenFlag, boolean cmdLnOnlyFlag)
          Creates a configuration property item.
 
Method Summary
 CfgPropItem addDataChangedListener(DataChangedListener listenerObj)
          Registers the given 'DataChangedListener' object to be notified when this object is changed.
 boolean booleanValue()
          Returns the value of the property object as a boolean, or false if the object cannot be converted.
 byte byteValue()
          Returns the value of the property object as a byte, or zero if the object cannot be converted.
 boolean checkType(java.lang.Object obj)
          Checks the class type of the given object against the class type of default object for the property item.
 java.lang.Object clone()
          Creates and returns a clone of this object.
 java.awt.Color colorValue()
          Returns the value of the property object as a Color, or null if the object cannot be converted.
 int compareTo(java.lang.Object obj)
          Compares the value object of this property item with the given object.
 boolean compareValueString(java.lang.String str)
          Interprets the given string and compares it to the value Object for this property item.
 java.lang.Object convertValueString(java.lang.String str)
          Interprets the given string and returns it as a data value Object that could be entered for this property item.
 double doubleValue()
          Returns the value of the property object as a double, or zero if the object cannot be converted.
 CfgPropItem duplicate()
          Returns a duplicate of this object.
 boolean equals(java.lang.Object obj)
          Returns true if the given object is a 'CfgPropItem' whose value is equal to the value object of the property item or if the given object itself is equal to the value object of the property item.
 void fireDataChanged()
          Called to indicate that this object has changed.
 float floatValue()
          Returns the value of the property object as a float, or zero if the object cannot be converted.
 java.lang.Object getAuxiliaryObj()
          Returns the "auxiliary" object for this item (usually a 'CfgPropComponent' object).
 boolean getCmdLnEnbFlag()
          Returns the "enable via command line" flag.
 boolean getCmdLnLoadedFlag()
          Returns the loaded-from-command-line flag for the property item.
 boolean getCmdLnOnlyFlag()
          Returns the "via command line only" flag.
 java.lang.String getCmdLnParamName()
          Returns the command-line parameter name for item.
 java.lang.Object getDefaultValue()
          Returns the default value object for the property item.
 java.lang.String getDescriptionStr()
          Returns the property item description string.
 boolean getEmptyStringDefaultFlag()
          Returns the empty-string-default flag for the property item.
 java.lang.Object getGroupSelObj()
          Returns the group-select object for this item.
 boolean getHelpScreenFlag()
          Returns the "show in help screen data" flag.
 boolean getIgnoreItemFlag()
          Returns the ignore flag for the property item.
 long getLastChangeTime()
          Returns the time of last change to this item's value, in milliseconds since 1/1/1970.
 boolean getLoadedFlag()
          Returns the 'loaded' flag for the property item.
 java.util.Map.Entry getMapEntry()
          Map Entry interface
 java.lang.String getName()
          Returns the name of the property item.
 boolean getRequiredFlag()
          Returns the 'required' flag for the property item.
 CfgPropValidator getValidator()
          Gets the validator object for this item.
 java.lang.Object getValue()
          Returns the value object for the property item.
 java.lang.Class getValueClass()
          Returns a class object representing the data type used for the property item's value and default-value.
 int hashCode()
          Returns a hash code for the value object of the property item.
 int intValue()
          Returns the value of the property object as an int, or zero if the object cannot be converted.
 boolean isDefaultValue()
          Determines if the current value is the same as the default value.
 boolean isStartupConfigFlag()
          Determines if the item should be selected at startup.
 long longValue()
          Returns the value of the property object as a long, or zero if the object cannot be converted.
 void removeDataChangedListener(DataChangedListener listenerObj)
          Unregisters the given 'DataChangedListener' object from the list of listeners for this object.
 CfgPropItem setAuxiliaryObj(java.lang.Object obj)
          Sets the "auxiliary" object for this item (usually a 'CfgPropComponent' object).
 CfgPropItem setCmdLnLoadedFlag(boolean flg)
          Sets the loaded-from-command-line flag for the property item.
 void setDefaultAndValue(java.lang.Object valueObj)
          Sets the default value and the value object for the property item to the given value.
 void setDefaultValue(java.lang.Object defaultValue)
          Sets the default value object for the property item.
 CfgPropItem setEmptyStringDefaultFlag(boolean flg)
          Sets the empty-string-default flag for the property item.
 CfgPropItem setGroupSelObj(java.lang.Object obj)
          Sets the group-select object for this item.
 CfgPropItem setHelpScreenFlag(boolean flg)
          Sets the "show in help screen data" flag for the property item.
 CfgPropItem setIgnoreItemFlag(boolean flg)
          Sets the ignore flag for the property item.
 CfgPropItem setLoadedFlag(boolean flg)
          Sets the 'loaded' flag for the property item.
 CfgPropItem setRequiredFlag(boolean flg)
          Sets the 'required' flag for the property item.
 CfgPropItem setStartupConfigFlag(boolean b)
          Sets the startup config flag.
 CfgPropItem setValidator(byte minValue, byte maxValue)
          Sets the validator for this item.
 CfgPropItem setValidator(CfgPropValidator validatorObj)
          Sets the validator for this item.
 CfgPropItem setValidator(java.lang.Comparable minValueCompObj, java.lang.Comparable maxValueCompObj)
          Sets the validator for this item.
 CfgPropItem setValidator(double minValue, double maxValue)
          Sets the validator for this item.
 CfgPropItem setValidator(float minValue, float maxValue)
          Sets the validator for this item.
 CfgPropItem setValidator(int minValue, int maxValue)
          Sets the validator for this item.
 CfgPropItem setValidator(long minValue, long maxValue)
          Sets the validator for this item.
 CfgPropItem setValidator(java.lang.Object[] objArr)
          Sets the validator for this item.
 CfgPropItem setValidator(short minValue, short maxValue)
          Sets the validator for this item.
 boolean setValue(boolean flg)
          Sets the value object for the property item.
 boolean setValue(byte val)
          Sets the value object for the property item.
 boolean setValue(double val)
          Sets the value object for the property item.
 boolean setValue(float val)
          Sets the value object for the property item.
 boolean setValue(int val)
          Sets the value object for the property item.
 boolean setValue(long val)
          Sets the value object for the property item.
 boolean setValue(java.lang.Object valueObj)
          Sets the value object for the property item.
 boolean setValue(short val)
          Sets the value object for the property item.
protected  void setValueObject(java.lang.Object valueObj)
          Sets the value object for the property item.
 boolean setValueString(java.lang.String str)
          Interprets the given string and enters it as the value Object for the property item.
 boolean setValueString(java.lang.String str, boolean defaultFlag)
          Interprets the given string and enters it as the default value Object for the property item.
static java.lang.Object setValueString(java.lang.String str, java.lang.Object defValObj)
          Interprets the given string and enters it as the value object for the property item.
 short shortValue()
          Returns the value of the property object as a short, or zero if the object cannot be converted.
 java.lang.String stringValue()
          Returns a String object representing the value of the property item.
 java.lang.String toArchivedForm()
          Returns the archivable representation for this object.
 java.lang.String toString()
          Returns a String object representing the value of the property item.
static boolean validateValue(CfgPropValidator validatorObj, java.lang.Object valueObj)
          Checks that the given object is a valid data value using the specified validator.
 boolean validateValue(java.lang.Object valueObj)
          Checks that the given object is a valid data value using this item's validator.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SWITCH1_CHAR

public static final char SWITCH1_CHAR
See Also:
Constant Field Values

SWITCH2_CHAR

public static final char SWITCH2_CHAR
See Also:
Constant Field Values

name

protected final java.lang.String name

value

protected java.lang.Object value

numberValue

protected java.lang.Number numberValue

booleanValue

protected boolean booleanValue

stringValue

protected java.lang.String stringValue

colorValue

protected java.awt.Color colorValue

defaultValue

protected java.lang.Object defaultValue

loadedFlag

protected boolean loadedFlag

requiredFlag

protected boolean requiredFlag

cmdLnLoadedFlag

protected boolean cmdLnLoadedFlag

cmdLnParamName

protected final java.lang.String cmdLnParamName

descriptionStr

protected final java.lang.String descriptionStr

cmdLnEnbFlag

protected final boolean cmdLnEnbFlag

helpScreenFlag

protected boolean helpScreenFlag

cmdLnOnlyFlag

protected final boolean cmdLnOnlyFlag

ignoreItemFlag

protected boolean ignoreItemFlag

emptyStringDefaultFlag

protected boolean emptyStringDefaultFlag

validatorObj

protected CfgPropValidator validatorObj

listenersVec

protected final java.util.Vector listenersVec

lastChangeTime

protected long lastChangeTime

groupSelObj

protected java.lang.Object groupSelObj

auxiliaryObj

protected java.lang.Object auxiliaryObj

startupConfigFlag

protected boolean startupConfigFlag
Constructor Detail

CfgPropItem

public CfgPropItem(java.lang.String name,
                   java.lang.Object defaultValue,
                   boolean requiredFlag,
                   java.lang.String paramNameStr,
                   java.lang.String descriptionStr,
                   boolean cmdLnEnbFlag,
                   boolean helpScreenFlag,
                   boolean cmdLnOnlyFlag)
Creates a configuration property item.

Parameters:
name - property name.
defaultValue - default value for the property.
requiredFlag - the value for the item's required-flag (see 'setRequiredFlag()').
paramNameStr - command-line parameter name for item.
descriptionStr - description text for item.
cmdLnEnbFlag - true to enable use of item as command-line parameter.
helpScreenFlag - true to include item in help screen data.
cmdLnOnlyFlag - true for item via command line only.

CfgPropItem

public CfgPropItem(java.lang.String name,
                   java.lang.Object defaultValue,
                   boolean requiredFlag,
                   java.lang.String cmdLnParamName,
                   java.lang.String descriptionStr)
Creates a configuration property item.

Parameters:
name - property name.
defaultValue - default value for the property.
requiredFlag - the value for the item's required-flag (see 'setRequiredFlag()').
cmdLnParamName - command-line parameter name for item.
descriptionStr - description text for item.

CfgPropItem

public CfgPropItem(java.lang.String name,
                   java.lang.Object defaultValue,
                   boolean requiredFlag)
Creates a configuration property item.

Parameters:
name - property name.
defaultValue - default value for the property.
requiredFlag - the value for the item's required-flag (see 'setRequiredFlag()').

CfgPropItem

public CfgPropItem(java.lang.String name,
                   java.lang.Object defaultValue,
                   java.lang.String cmdLnParamName,
                   java.lang.String descriptionStr,
                   boolean cmdLnEnbFlag,
                   boolean helpScreenFlag)
Creates a configuration property item. Its required-flag is set to false (see 'setRequiredFlag()').

Parameters:
name - property name.
defaultValue - default value for the property.
cmdLnParamName - command-line parameter name for item.
descriptionStr - description text for item.
cmdLnEnbFlag - true to enable use of item as command-line parameter.
helpScreenFlag - true to include item in help screen data.

CfgPropItem

public CfgPropItem(java.lang.String name,
                   java.lang.Object defaultValue,
                   java.lang.String cmdLnParamName,
                   java.lang.String descriptionStr,
                   boolean cmdLnEnbFlag,
                   boolean helpScreenFlag,
                   boolean cmdLnOnlyFlag)
Creates a configuration property item. Its required-flag is set to false (see 'setRequiredFlag()').

Parameters:
name - property name.
defaultValue - default value for the property.
cmdLnParamName - command-line parameter name for item.
descriptionStr - description text for item.
cmdLnEnbFlag - true to enable use of item as command-line parameter.
helpScreenFlag - true to include item in help screen data.
cmdLnOnlyFlag - true for item via command line only.

CfgPropItem

public CfgPropItem(java.lang.String name,
                   java.lang.Object defaultValue,
                   java.lang.String cmdLnParamName,
                   java.lang.String descriptionStr)
Creates a configuration property item. Its required-flag is set to false (see 'setRequiredFlag()').

Parameters:
name - property name.
defaultValue - default value for the property.
cmdLnParamName - command-line parameter name for item.
descriptionStr - description text for item.

CfgPropItem

public CfgPropItem(java.lang.String name,
                   java.lang.Object defaultValue,
                   java.lang.String cmdLnParamName)
Creates a configuration property item. Its required-flag is set to false (see 'setRequiredFlag()').

Parameters:
name - property name.
defaultValue - default value for the property.
cmdLnParamName - command-line parameter name for item.

CfgPropItem

public CfgPropItem(java.lang.String name,
                   java.lang.Object defaultValue)
Creates a configuration property item. Its required-flag is set to false (see 'setRequiredFlag()').

Parameters:
name - property name.
defaultValue - default value for the property.
Method Detail

getName

public java.lang.String getName()
Returns the name of the property item.

Specified by:
getName in interface IstiNamedValueInterface
Returns:
String

getDefaultValue

public java.lang.Object getDefaultValue()
Returns the default value object for the property item.

Specified by:
getDefaultValue in interface IstiNamedValueInterface
Returns:
Object

setDefaultValue

public final void setDefaultValue(java.lang.Object defaultValue)
Sets the default value object for the property item.

Parameters:
defaultValue - the default value object.

setDefaultAndValue

public void setDefaultAndValue(java.lang.Object valueObj)
Sets the default value and the value object for the property item to the given value.

Parameters:
valueObj - the value object to use.

getValue

public java.lang.Object getValue()
Returns the value object for the property item.

Specified by:
getValue in interface IstiNamedValueInterface
Returns:
Object

setValueObject

protected final void setValueObject(java.lang.Object valueObj)
Sets the value object for the property item.

Parameters:
valueObj - the value of the object.

setValue

public boolean setValue(java.lang.Object valueObj)
Sets the value object for the property item.

Specified by:
setValue in interface IstiNamedValueInterface
Parameters:
valueObj - the value of the object.
Returns:
true if successful, false if given object's type does not match the item's default-value object's type.

setValue

public boolean setValue(int val)
Sets the value object for the property item.

Parameters:
val - the value of the object.
Returns:
true if successful, false if given object's type does not match the item's default-value object's type.

setValue

public boolean setValue(long val)
Sets the value object for the property item.

Parameters:
val - the value of the object.
Returns:
true if successful, false if given object's type does not match the item's default-value object's type.

setValue

public boolean setValue(float val)
Sets the value object for the property item.

Parameters:
val - the value of the object.
Returns:
true if successful, false if given object's type does not match the item's default-value object's type.

setValue

public boolean setValue(double val)
Sets the value object for the property item.

Parameters:
val - the value of the object.
Returns:
true if successful, false if given object's type does not match the item's default-value object's type.

setValue

public boolean setValue(byte val)
Sets the value object for the property item.

Parameters:
val - the value of the object.
Returns:
true if successful, false if given object's type does not match the item's default-value object's type.

setValue

public boolean setValue(short val)
Sets the value object for the property item.

Parameters:
val - the value of the object.
Returns:
true if successful, false if given object's type does not match the item's default-value object's type.

setValue

public boolean setValue(boolean flg)
Sets the value object for the property item.

Parameters:
flg - the value of the object.
Returns:
true if successful, false if given object's type does not match the item's default-value object's type.

setValueString

public static java.lang.Object setValueString(java.lang.String str,
                                              java.lang.Object defValObj)
Interprets the given string and enters it as the value object for the property item. The string is converted to an object of the same type as the given default value object for the property item.

Parameters:
str - the string value to interpret.
defValObj - the default value object to use for type checking (this parameter allows for multiple values and types to be dealt with).
Returns:
an Object filled via the given string, or null if the string could not be converted to the proper type.

setValueString

public boolean setValueString(java.lang.String str,
                              boolean defaultFlag)
Interprets the given string and enters it as the default value Object for the property item. The string is converted to an Object of the same type as the default value object for the property item.

Parameters:
str - the string value to interpret.
defaultFlag - true to update the default value, false otherwise.
Returns:
true if successful, false if the string could not be converted to the proper type.

setValueString

public boolean setValueString(java.lang.String str)
Interprets the given string and enters it as the value Object for the property item. The string is converted to an Object of the same type as the default value object for the property item.

Specified by:
setValueString in interface IstiNamedValueInterface
Parameters:
str - the string value to interpret.
Returns:
true if successful, false if the string could not be converted to the proper type.

compareValueString

public boolean compareValueString(java.lang.String str)
Interprets the given string and compares it to the value Object for this property item. The string is converted to an Object of the same type as the default value object for the property item.

Parameters:
str - the string value to interpret.
Returns:
true if the given string converts to a value equal to the current value of this property item, false if not (or if the given string could not be converted to the proper data type).

convertValueString

public java.lang.Object convertValueString(java.lang.String str)
Interprets the given string and returns it as a data value Object that could be entered for this property item. The string is converted to an Object of the same type as the default value object for the property item. Note that this method does not validate the given value.

Parameters:
str - the string value to interpret.
Returns:
the converted object, or null if the string could not be converted to the proper type.

checkType

public boolean checkType(java.lang.Object obj)
Checks the class type of the given object against the class type of default object for the property item.

Parameters:
obj - the object to check.
Returns:
true if the types match.

getValueClass

public java.lang.Class getValueClass()
Returns a class object representing the data type used for the property item's value and default-value.

Returns:
the value-class object.

setLoadedFlag

public CfgPropItem setLoadedFlag(boolean flg)
Sets the 'loaded' flag for the property item. A 'loaded' flag value of 'true' indicates that the property item has been loaded from a configuration file.

Parameters:
flg - the 'loaded' flag value.
Returns:
A handle to this object.

getLoadedFlag

public boolean getLoadedFlag()
Returns the 'loaded' flag for the property item. A 'loaded' flag value of 'true' indicates that the property item has been loaded from a configuration file.

Returns:
the 'loaded' flag value.

setRequiredFlag

public CfgPropItem setRequiredFlag(boolean flg)
Sets the 'required' flag for the property item. A 'required' flag value of 'true' indicates that the property item must loaded when the 'CfgProperties.load()' function is used.

Parameters:
flg - the 'required' flag value.
Returns:
A handle to this object.

getRequiredFlag

public boolean getRequiredFlag()
Returns the 'required' flag for the property item. A 'required' flag value of 'true' indicates that the property item must loaded when the 'CfgProperties.load()' function is used.

Returns:
the 'required' flag value.

setCmdLnLoadedFlag

public CfgPropItem setCmdLnLoadedFlag(boolean flg)
Sets the loaded-from-command-line flag for the property item. A value of 'true' indicates that the property item has been loaded from a the command line.

Parameters:
flg - value for the loaded-from-command-line flag.
Returns:
A handle to this object.

getCmdLnLoadedFlag

public boolean getCmdLnLoadedFlag()
Returns the loaded-from-command-line flag for the property item. A value of 'true' indicates that the property item has been loaded from a the command line.

Returns:
value for the loaded-from-command-line flag.

setIgnoreItemFlag

public CfgPropItem setIgnoreItemFlag(boolean flg)
Sets the ignore flag for the property item. A value of 'true' will prevent the item from being included when storing or displaying in the help screen. The allows an obsolete item to disappear while not generating an error if found in a configuration file. When this flag is set the help-screen flag is cleared.

Parameters:
flg - value for the ignore-item flag, true==ignore.
Returns:
A handle to this object.

getIgnoreItemFlag

public boolean getIgnoreItemFlag()
Returns the ignore flag for the property item.

Returns:
value for the ignore-item flag, true==ignore.

setHelpScreenFlag

public CfgPropItem setHelpScreenFlag(boolean flg)
Sets the "show in help screen data" flag for the property item. A value of 'true' indicates that the property item will be shown.

Parameters:
flg - value for the "show in help screen data" flag.
Returns:
A handle to this object.

setEmptyStringDefaultFlag

public CfgPropItem setEmptyStringDefaultFlag(boolean flg)
Sets the empty-string-default flag for the property item. A value of 'true' will make an empty string read from the configuration file be converted to the default value for the item, and it will make an item value equal to the default value be converted to the empty string when written to the configuration file.

Parameters:
flg - the flag value to use.
Returns:
A handle to this object.

getEmptyStringDefaultFlag

public boolean getEmptyStringDefaultFlag()
Returns the empty-string-default flag for the property item. A value of 'true' will make an empty string read from the configuration file be converted to the default value for the item, and it will make an item value equal to the default value be converted to the empty string when written to the configuration file.

Returns:
The current value of the empty-string-default flag for this item.

toArchivedForm

public java.lang.String toArchivedForm()
Returns the archivable representation for this object. When the object is recreated from the string, it should be identical to the original.

Returns:
A String representing the archived form of the object.

toString

public java.lang.String toString()
Returns a String object representing the value of the property item.

Returns:
the String object.

hashCode

public int hashCode()
Returns a hash code for the value object of the property item.

Returns:
an integer hash code.

equals

public boolean equals(java.lang.Object obj)
Returns true if the given object is a 'CfgPropItem' whose value is equal to the value object of the property item or if the given object itself is equal to the value object of the property item.

Parameters:
obj - the object to compare.
Returns:
true if the given object is a 'CfgPropItem' whose value is equal to the value object of the property item or if the given object itself is equal to the value object of the property item.

intValue

public int intValue()
Returns the value of the property object as an int, or zero if the object cannot be converted.

Returns:
the integer value.

longValue

public long longValue()
Returns the value of the property object as a long, or zero if the object cannot be converted.

Returns:
the long value.

floatValue

public float floatValue()
Returns the value of the property object as a float, or zero if the object cannot be converted.

Returns:
the float value.

doubleValue

public double doubleValue()
Returns the value of the property object as a double, or zero if the object cannot be converted.

Returns:
the double value.

byteValue

public byte byteValue()
Returns the value of the property object as a byte, or zero if the object cannot be converted.

Returns:
the byte value.

shortValue

public short shortValue()
Returns the value of the property object as a short, or zero if the object cannot be converted.

Returns:
the short value.

booleanValue

public boolean booleanValue()
Returns the value of the property object as a boolean, or false if the object cannot be converted.

Returns:
the boolean value.

stringValue

public java.lang.String stringValue()
Returns a String object representing the value of the property item.

Specified by:
stringValue in interface IstiNamedValueInterface
Returns:
the String value.

clone

public java.lang.Object clone()
Creates and returns a clone of this object.

Specified by:
clone in interface IstiNamedValueInterface
Returns:
a clone of the this object.

colorValue

public java.awt.Color colorValue()
Returns the value of the property object as a Color, or null if the object cannot be converted.

Returns:
the Color value.

compareTo

public int compareTo(java.lang.Object obj)
              throws java.lang.ClassCastException
Compares the value object of this property item with the given object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the value of the object.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this Object.

getCmdLnParamName

public java.lang.String getCmdLnParamName()
Returns the command-line parameter name for item.

Returns:
the name string.

getDescriptionStr

public java.lang.String getDescriptionStr()
Returns the property item description string.

Specified by:
getDescriptionStr in interface PropItemInterface
Returns:
the description string.

getCmdLnEnbFlag

public boolean getCmdLnEnbFlag()
Returns the "enable via command line" flag.

Returns:
true if this item may be entered via a command-line parameter.

getHelpScreenFlag

public boolean getHelpScreenFlag()
Returns the "show in help screen data" flag.

Returns:
true if this item will be shown in the help screen.

getCmdLnOnlyFlag

public boolean getCmdLnOnlyFlag()
Returns the "via command line only" flag.

Returns:
true if this item may only be entered via a command-line parameter.

duplicate

public CfgPropItem duplicate()
Returns a duplicate of this object.

Returns:
handle to this object.

setValidator

public CfgPropItem setValidator(CfgPropValidator validatorObj)
Sets the validator for this item.

Parameters:
validatorObj - a 'CfgPropValidator' object.
Returns:
A handle to this object.

setValidator

public CfgPropItem setValidator(java.lang.Comparable minValueCompObj,
                                java.lang.Comparable maxValueCompObj)
Sets the validator for this item.

Parameters:
minValueCompObj - a "minimum" value object that implements the 'Comparable' interface (or null for no minimum).
maxValueCompObj - a "maximum" value object that implements the 'Comparable' interface (or null for no maximum).
Returns:
A handle to this object.

setValidator

public CfgPropItem setValidator(java.lang.Object[] objArr)
Sets the validator for this item.

Parameters:
objArr - an array of acceptable-value 'Object's.
Returns:
A handle to this object.

setValidator

public CfgPropItem setValidator(int minValue,
                                int maxValue)
Sets the validator for this item.

Parameters:
minValue - minimum valid value.
maxValue - maximum valid value.
Returns:
A handle to this object.

setValidator

public CfgPropItem setValidator(long minValue,
                                long maxValue)
Sets the validator for this item.

Parameters:
minValue - minimum valid value.
maxValue - maximum valid value.
Returns:
A handle to this object.

setValidator

public CfgPropItem setValidator(short minValue,
                                short maxValue)
Sets the validator for this item.

Parameters:
minValue - minimum valid value.
maxValue - maximum valid value.
Returns:
A handle to this object.

setValidator

public CfgPropItem setValidator(byte minValue,
                                byte maxValue)
Sets the validator for this item.

Parameters:
minValue - minimum valid value.
maxValue - maximum valid value.
Returns:
A handle to this object.

setValidator

public CfgPropItem setValidator(float minValue,
                                float maxValue)
Sets the validator for this item.

Parameters:
minValue - minimum valid value.
maxValue - maximum valid value.
Returns:
A handle to this object.

setValidator

public CfgPropItem setValidator(double minValue,
                                double maxValue)
Sets the validator for this item.

Parameters:
minValue - minimum valid value.
maxValue - maximum valid value.
Returns:
A handle to this object.

getValidator

public CfgPropValidator getValidator()
Gets the validator object for this item.

Specified by:
getValidator in interface PropItemInterface
Returns:
handle to the validator object.

validateValue

public static boolean validateValue(CfgPropValidator validatorObj,
                                    java.lang.Object valueObj)
Checks that the given object is a valid data value using the specified validator.

Parameters:
validatorObj - a 'CfgPropValidator' object.
valueObj - the value of the object.
Returns:
true if the given object is valid (or if no validator has been setup), false if not.

validateValue

public boolean validateValue(java.lang.Object valueObj)
Checks that the given object is a valid data value using this item's validator.

Parameters:
valueObj - the value of the object.
Returns:
true if the given object is valid (or if no validator has been setup), false if not.

addDataChangedListener

public CfgPropItem addDataChangedListener(DataChangedListener listenerObj)
Registers the given 'DataChangedListener' object to be notified when this object is changed.

Parameters:
listenerObj - the 'DataChangedListener' object.
Returns:
A handle to this object.

removeDataChangedListener

public void removeDataChangedListener(DataChangedListener listenerObj)
Unregisters the given 'DataChangedListener' object from the list of listeners for this object.

Parameters:
listenerObj - the 'DataChangedListener' object.

fireDataChanged

public void fireDataChanged()
Called to indicate that this object has changed. Each registered listener's 'dataChanged()' method is called.


getLastChangeTime

public long getLastChangeTime()
Returns the time of last change to this item's value, in milliseconds since 1/1/1970. If the value has not been changed since the item was constructed then zero will be returned.

Returns:
the time value.

setGroupSelObj

public CfgPropItem setGroupSelObj(java.lang.Object obj)
Sets the group-select object for this item. If this object is of type 'String' or 'ItemGroupSelector' then it can be used by the 'CfgPropertyInspector' class to place this item onto a "settings" tab.

Parameters:
obj - the group-select object to use.
Returns:
A handle to this object.

getGroupSelObj

public java.lang.Object getGroupSelObj()
Returns the group-select object for this item. If this object is of type 'String' or 'ItemGroupSelector' then it can be used by the 'CfgPropertyInspector' class to place this item onto a "settings" tab.

Specified by:
getGroupSelObj in interface PropItemInterface
Returns:
handle to the group-select object.

setAuxiliaryObj

public CfgPropItem setAuxiliaryObj(java.lang.Object obj)
Sets the "auxiliary" object for this item (usually a 'CfgPropComponent' object).

Parameters:
obj - the value of the object.
Returns:
A handle to this object.

getAuxiliaryObj

public java.lang.Object getAuxiliaryObj()
Returns the "auxiliary" object for this item (usually a 'CfgPropComponent' object).

Specified by:
getAuxiliaryObj in interface PropItemInterface
Returns:
A handle to the "auxiliary" object.

setStartupConfigFlag

public CfgPropItem setStartupConfigFlag(boolean b)
Sets the startup config flag.

Parameters:
b - true if the item should be selected at startup.
Returns:
A handle to this object.

isDefaultValue

public boolean isDefaultValue()
Determines if the current value is the same as the default value.

Specified by:
isDefaultValue in interface IstiNamedValueInterface
Returns:
true if the current value is the same as the default value.

isStartupConfigFlag

public boolean isStartupConfigFlag()
Determines if the item should be selected at startup.

Returns:
true if the item should be selected at startup.

getMapEntry

public java.util.Map.Entry getMapEntry()
Map Entry interface

Returns:
Map.Entry