org.jlf.dataMap
Class LongAttribute

java.lang.Object
  |
  +--org.jlf.dataMap.DataAttribute
        |
        +--org.jlf.dataMap.LongAttribute
All Implemented Interfaces:
java.io.Serializable

public class LongAttribute
extends DataAttribute

This class is used to hold attributes of type Long. It converts any Number type atribute into a Long, losing precision automatically if called for.

See Also:
DataAttribute, DataAttributeDescriptor, Serialized Form

Field Summary
 
Fields inherited from class org.jlf.dataMap.DataAttribute
hasChanged, name, originalValue, value
 
Constructor Summary
LongAttribute()
          Default constructor.
LongAttribute(java.lang.String name)
          Normal attribute constructor.
 
Method Summary
 void basicSetValue(java.lang.Number newValue)
          Main setter for Number values to ensure the resulting value set is of type Long.
 void basicSetValue(java.lang.Object newValue)
          Override for Long-specific behavior.
 void basicSetValue(java.lang.String newValue)
          Main setter for String values to ensure the resulting value set is of type Long.
 long getLongValue()
          Returns the long value of the attribute if the attribute has one.
 
Methods inherited from class org.jlf.dataMap.DataAttribute
getDoubleValue, getName, getOriginalValue, getStringValue, getValue, hasChanged, resetAndSetValue, resetHasChanged, setName, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LongAttribute

public LongAttribute()
Default constructor. Try to use a parameterized constructor with at least the attribute name to construct the attribute.


LongAttribute

public LongAttribute(java.lang.String name)
Normal attribute constructor.

Method Detail

basicSetValue

public void basicSetValue(java.lang.Object newValue)
Override for Long-specific behavior.

Overrides:
basicSetValue in class DataAttribute

basicSetValue

public void basicSetValue(java.lang.String newValue)
Main setter for String values to ensure the resulting value set is of type Long.


basicSetValue

public void basicSetValue(java.lang.Number newValue)
Main setter for Number values to ensure the resulting value set is of type Long.


getLongValue

public long getLongValue()
Returns the long value of the attribute if the attribute has one.

Overrides:
getLongValue in class DataAttribute
Throws:
DataMapError - if the attribute cannot be safely converted to a long or if the attribute is null.