org.quattor.pan.dml.data
Class Property

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
All Implemented Interfaces:
Operation
Direct Known Subclasses:
BooleanProperty, NumberProperty, StringProperty

public abstract class Property
extends PersistentElement

Property represents a simple primitive type (boolean, long, or string) in the pan language. All properties descend from PersistentElement which marks them as being valid elements for a final machine configuration. All Property instances must be immutable. This allows properties to be shared between threads and between machine configurations consequently reducing duplication and memory consumption. The constructors of all Property classes should be protected or private. All subclasses must implement a getInstance() method which returns an instance (possibly cached) of the Property.

Author:
loomis

Constructor Summary
protected Property(java.lang.Object value)
          This constructor should be used by subclasses to set the value of the property.
 
Method Summary
 boolean equals(java.lang.Object o)
          Require that all Elements implement an equals method.
 java.lang.Object getValue()
          Return the value of this property as an Object.
 int hashCode()
          Require that all Elements implement the hashCode method.
 java.lang.String toString()
          Require that all Elements implement a reasonable toString method.
 
Methods inherited from class org.quattor.pan.dml.data.Element
checkInvalidSelfContext, checkRange, checkRestrictedContext, checkValidReplacement, defined, duplicate, execute, exists, getTypeAsString, 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, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Property

protected Property(java.lang.Object value)
This constructor should be used by subclasses to set the value of the property. The value should be a basic, immutable java type like Boolean, Long, or Double.

Parameters:
value -
Method Detail

getValue

public java.lang.Object getValue()
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.

Returns:
value of this property as an Object

hashCode

public int hashCode()
Description copied from class: Element
Require that all Elements implement the hashCode method.

Specified by:
hashCode in class Element

equals

public boolean equals(java.lang.Object o)
Description copied from class: Element
Require that all Elements implement an equals method.

Specified by:
equals in class Element

toString

public java.lang.String toString()
Description copied from class: Element
Require that all Elements implement a reasonable toString method.

Specified by:
toString in class Element


Copyright © 2011 Quattor. All Rights Reserved.