com.infoengine.object
Class IeDatum

java.lang.Object
  extended by com.infoengine.object.IeDatum
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

public class IeDatum
extends java.lang.Object
implements java.io.Externalizable, java.lang.Cloneable

See Also:
Serialized Form

Constructor Summary
IeDatum()
          default no arg constructor to be used for de-serialization
IeDatum(byte[] array)
          Constructs a new datum with a byte array as its value.
IeDatum(java.util.Date date)
          Constructs a new datum with a Date as its value.
IeDatum(java.lang.Number number)
          Constructs a new datum with a Number as its value.
IeDatum(java.lang.Object object)
          Constructs a new datum with an Object as its value.
IeDatum(java.lang.String string)
          Constructs a new datum with a String as its value.
 
Method Summary
 com.ptc.core.meta.common.AttributeIdentifier getIdentifier()
          Returns the attribute identifier associated with this datum.
 com.ptc.core.meta.common.AttributeIdentifier getIdentifier(com.ptc.core.meta.common.TypeInstanceIdentifier typeInstanceId, com.ptc.core.meta.common.AttributeTypeIdentifier attrTypeId, int ordinal)
          Returns the attribute identifier associated with this datum.
 java.lang.String getNodeName()
          Returns the node name of this datum.
 java.lang.String getNodeValue()
          Returns the node value of this datum.
 com.ptc.core.meta.container.common.State getState()
          Returns the state of this datum.
 boolean hasChildNodes()
          Determines whether this datum has any child nodes.
static IeDatum newIeDatum(com.ptc.core.meta.common.AttributeIdentifier identifier, java.lang.Object object)
          Factory method that accepts an object and constructs an instance with an appropriate type and a specific attribute identifier value.
static IeDatum newIeDatum(java.lang.Object object)
          Factory method that accepts an object and constructs an instance with an appropriate type.
 java.lang.Object rawValueOf()
          Returns the raw value of this datum.
 java.lang.String rawValueType()
          Returns the type of the raw value of this datum.
 void readExternal(java.io.ObjectInput in)
           
 void setIdentifier(com.ptc.core.meta.common.AttributeIdentifier identifier)
          Sets the attribute identifier associated with this datum.
 void setNodeValue(java.lang.String nodeValue)
          Sets the node value of this datum.
 void setState(com.ptc.core.meta.container.common.State state)
          Sets the state of this datum.
 void setValue(java.lang.Object value)
          Sets the raw value of this datum.
 java.lang.String toString()
          Returns the String representation of the value associated with this datum.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IeDatum

public IeDatum()
default no arg constructor to be used for de-serialization


IeDatum

public IeDatum(byte[] array)
Constructs a new datum with a byte array as its value. Use a factory method instead of calling this constructor directly.

Parameters:
array - The byte array.

IeDatum

public IeDatum(java.util.Date date)
Constructs a new datum with a Date as its value. Use a factory method instead of calling this constructor directly.

Parameters:
array - The Date value.

IeDatum

public IeDatum(java.lang.Number number)
Constructs a new datum with a Number as its value. This accommodates BigDecimal, BigInteger, Byte, Double, Integer, Short, Long, and Float. Use a factory method instead of calling this constructor directly.

Parameters:
array - The Number value.

IeDatum

public IeDatum(java.lang.String string)
Constructs a new datum with a String as its value. Use a factory method instead of calling this constructor directly.

Parameters:
array - The String value.

IeDatum

public IeDatum(java.lang.Object object)
Constructs a new datum with an Object as its value. Use a factory method instead of calling this constructor directly.

Parameters:
object - The Object value.
Method Detail

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

newIeDatum

public static IeDatum newIeDatum(java.lang.Object object)
Factory method that accepts an object and constructs an instance with an appropriate type.

Parameters:
object - The Object value.

newIeDatum

public static IeDatum newIeDatum(com.ptc.core.meta.common.AttributeIdentifier identifier,
                                 java.lang.Object object)
Factory method that accepts an object and constructs an instance with an appropriate type and a specific attribute identifier value.

Parameters:
identifier - The identifier to associate with the value.
object - The Object value.

toString

public java.lang.String toString()
Returns the String representation of the value associated with this datum.

Overrides:
toString in class java.lang.Object
Returns:
The String representation of this datum.

rawValueOf

public java.lang.Object rawValueOf()
Returns the raw value of this datum.

Returns:
The raw value of this datum.

setValue

public void setValue(java.lang.Object value)
Sets the raw value of this datum.

Parameters:
value - The new value.

rawValueType

public java.lang.String rawValueType()
Returns the type of the raw value of this datum.

Returns:
The type of the raw value of this datum.

getIdentifier

public com.ptc.core.meta.common.AttributeIdentifier getIdentifier()
Returns the attribute identifier associated with this datum.

Returns:
The attribute identifier, or null if no identifier is currently associated.

getIdentifier

public com.ptc.core.meta.common.AttributeIdentifier getIdentifier(com.ptc.core.meta.common.TypeInstanceIdentifier typeInstanceId,
                                                                  com.ptc.core.meta.common.AttributeTypeIdentifier attrTypeId,
                                                                  int ordinal)
Returns the attribute identifier associated with this datum. If the datum does not have an attribute identifier, one is created for it and returned.

Parameters:
typeInstanceId - The type identifier identifier of the type instance that contains this datum.
attrTypeId - The attribute type identifier the attribute that contains this datum.
ordinal - The ordinal of this datum within the attribute that contains it.
Returns:
The attribute identifier.

setIdentifier

public void setIdentifier(com.ptc.core.meta.common.AttributeIdentifier identifier)
Sets the attribute identifier associated with this datum.

Parameters:
identifier - The new identifier.

getState

public com.ptc.core.meta.container.common.State getState()
Returns the state of this datum.

Returns:
The current state.

setState

public void setState(com.ptc.core.meta.container.common.State state)
Sets the state of this datum.

Parameters:
state - The new state.

getNodeName

public java.lang.String getNodeName()
Returns the node name of this datum.

Returns:
The node name of this datum.

getNodeValue

public java.lang.String getNodeValue()
Returns the node value of this datum.

Returns:
The node value of this datum.

setNodeValue

public void setNodeValue(java.lang.String nodeValue)
Sets the node value of this datum.

Parameters:
nodeValue - The value to be set.

hasChildNodes

public boolean hasChildNodes()
Determines whether this datum has any child nodes.

Returns:
true if this datum has any child nodes.