story.dbcore.attributes
Class AttributeValue

java.lang.Object
  extended by story.dbcore.attributes.AttributeValue
All Implemented Interfaces:
java.io.Serializable

public class AttributeValue
extends java.lang.Object
implements java.io.Serializable

The value of an attribute. Contains an object which is the actual value, plus some metadata: if the attribute is "live," i.e., reflecting real data attached to a node attribute, it also offers information about the node, the attribute ID and the type of attribute. This is NOT a reusable object; it is a write-once snapshot.

See Also:
Serialized Form

Field Summary
static AttributeValue DEFAULT_VALUE
           
 
Constructor Summary
AttributeValue(AttributeValue attvalue, NodeAddress node, AttributeID attributeID, java.lang.Class attributeClass)
          Constructor for a "live" AttributeValue, i.e., reflecting real data in the db-core, attached to a node.
AttributeValue(java.lang.Object value)
          Constructor for a "detached" AttributeValue, i.e., not reflecting real data in the db-core, not attached to a node.
 
Method Summary
 boolean equals(AttributeValue other)
          Test the equality of this value with another one.
 java.lang.Class getAttributeClass()
          Get the attribute class if this is "live," null otherwise.
 AttributeID getAttributeID()
          Returns the AttributeID of the attribute for which this is the value in some node, or null if it is not so attached
 NodeAddress getNode()
          Returns the NodeAddress of the node for which this is the value of some attribute, or null if it is not so attached
 AttributeValue intern()
           
 boolean isDefaultValue()
           
 boolean isLive()
          Returns true if and only if this is a "live" Attribute Value, i.e., reflecting real data in the db-core, attachd to a node
 boolean nullValue()
          Returns whether the value herein is null.
 java.lang.StringBuffer render()
          Render as a StringBuffer with correct punctuation.
 java.lang.String toRawString()
          Render as a StringBuffer in a way that is not interpretable by the command interpreter, but is nicer for humans to read (without the $$).
 AttributeValue unintern()
           
 java.lang.Object value()
          Get the value itself.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_VALUE

public static final AttributeValue DEFAULT_VALUE
Constructor Detail

AttributeValue

public AttributeValue(java.lang.Object value)
Constructor for a "detached" AttributeValue, i.e., not reflecting real data in the db-core, not attached to a node.


AttributeValue

public AttributeValue(AttributeValue attvalue,
                      NodeAddress node,
                      AttributeID attributeID,
                      java.lang.Class attributeClass)
Constructor for a "live" AttributeValue, i.e., reflecting real data in the db-core, attached to a node.

Method Detail

value

public java.lang.Object value()
                       throws Scheherexception
Get the value itself.

Throws:
Scheherexception

nullValue

public boolean nullValue()
Returns whether the value herein is null.


getAttributeClass

public java.lang.Class getAttributeClass()
Get the attribute class if this is "live," null otherwise.


toRawString

public java.lang.String toRawString()
                             throws Scheherexception
Render as a StringBuffer in a way that is not interpretable by the command interpreter, but is nicer for humans to read (without the $$).

Throws:
Scheherexception

render

public java.lang.StringBuffer render()
                              throws Scheherexception
Render as a StringBuffer with correct punctuation.

Throws:
Scheherexception

equals

public boolean equals(AttributeValue other)
               throws Scheherexception
Test the equality of this value with another one.

Throws:
Scheherexception

isLive

public boolean isLive()
Returns true if and only if this is a "live" Attribute Value, i.e., reflecting real data in the db-core, attachd to a node


getNode

public NodeAddress getNode()
Returns the NodeAddress of the node for which this is the value of some attribute, or null if it is not so attached


getAttributeID

public AttributeID getAttributeID()
Returns the AttributeID of the attribute for which this is the value in some node, or null if it is not so attached


intern

public AttributeValue intern()
                      throws Scheherexception
Throws:
Scheherexception

isDefaultValue

public boolean isDefaultValue()

unintern

public AttributeValue unintern()
                        throws Scheherexception
Throws:
Scheherexception


Copyright © 2011 David K. Elson. All Rights Reserved.