org.quattor.pan.dml.data
Class LongProperty

java.lang.Object
  extended by org.quattor.pan.dml.data.Element
      extended by org.quattor.pan.dml.data.PersistentElement
          extended by org.quattor.pan.dml.data.Property
              extended by org.quattor.pan.dml.data.NumberProperty
                  extended by org.quattor.pan.dml.data.LongProperty
All Implemented Interfaces:
java.lang.Comparable<Term>, Operation, Term

@Immutable
public final class LongProperty
extends NumberProperty
implements Term

Represents a long value. This implements the Term interface and may be used to reference a resource.

Author:
loomis

Method Summary
 void checkRange(Range range)
          Determine if the element satisfies the given range constraint.
 int compareTo(Term o)
           
 double doubleValue()
          All number classes must implement this method which is used to facilitate type conversion in mixed-type, arithmetic expressions.
 java.lang.Integer getIndex()
          Method to extract the Integer index for this Term.
static LongProperty getInstance(long value)
           
static LongProperty getInstance(java.lang.Long value)
           
static LongProperty getInstance(java.lang.String value)
           
 java.lang.String getKey()
          Method to extract the String key for this Term.
 java.lang.String getTypeAsString()
          All Elements must return a string describing its type.
 java.lang.Long getValue()
          Return the value of this property as an Object.
 boolean isKey()
          A utility function to determine if this Term is a key (String value).
 
Methods inherited from class org.quattor.pan.dml.data.Property
equals, hashCode, toString
 
Methods inherited from class org.quattor.pan.dml.data.Element
checkInvalidSelfContext, checkRestrictedContext, checkValidReplacement, defined, duplicate, execute, exists, isBoolean, isDouble, isList, isLong, isNlist, isPersistent, isProperty, isProtected, isResource, isString, isTransient, locateUndefinedElement, protect, rget, rgetList, rput, writableCopy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.quattor.pan.utils.Term
equals, hashCode, toString
 

Method Detail

getInstance

public static LongProperty getInstance(long value)

getInstance

public static LongProperty getInstance(java.lang.Long value)

getInstance

public static LongProperty getInstance(java.lang.String value)

checkRange

public void checkRange(Range range)
                throws ValidationException
Description copied from class: Element
Determine if the element satisfies the given range constraint. This is used in the validation of the element. By default, this method with throw a ValidationException indicating that range checking of this element is not appropriate.

Overrides:
checkRange in class Element
Parameters:
range - Range to check Element against
Throws:
ValidationException - if the element cannot be compared to a range or if the element doesn't meet the range requirement

doubleValue

public double doubleValue()
Description copied from class: NumberProperty
All number classes must implement this method which is used to facilitate type conversion in mixed-type, arithmetic expressions.

Specified by:
doubleValue in class NumberProperty
Returns:
value of this number as a double

getValue

public java.lang.Long getValue()
Description copied from class: Property
Return the value of this property as an Object. Subclasses may override this method to provide a more specific return type. Subclasses will have to call this method to obtain the value because the value itself is private.

Overrides:
getValue in class Property
Returns:
value of this property as an Object

getTypeAsString

public java.lang.String getTypeAsString()
Description copied from class: Element
All Elements must return a string describing its type. This value used in the serialization to machine profiles.

Specified by:
getTypeAsString in class Element
Returns:
String representation of Element's type

isKey

public boolean isKey()
Description copied from interface: Term
A utility function to determine if this Term is a key (String value).

Specified by:
isKey in interface Term
Returns:
boolean indicating if this Term is a key

getIndex

public java.lang.Integer getIndex()
                           throws InvalidTermException
Description copied from interface: Term
Method to extract the Integer index for this Term. This will throw an exception if the Term is not an index.

Specified by:
getIndex in interface Term
Returns:
Integer index of the Term
Throws:
InvalidTermException - thrown if the term is not an index; message should contain the string value of the term that was used

getKey

public java.lang.String getKey()
                        throws InvalidTermException
Description copied from interface: Term
Method to extract the String key for this Term. This will throw an exception if the Term is not a key.

Specified by:
getKey in interface Term
Returns:
String key of the Term
Throws:
InvalidTermException - thrown if the term is not a key; message should contain the string value of the term that was used

compareTo

public int compareTo(Term o)
Specified by:
compareTo in interface java.lang.Comparable<Term>


Copyright © 2011 Quattor. All Rights Reserved.