com.infoengine.object.factory
Class Att

java.lang.Object
  extended bycom.infoengine.object.factory.Att
All Implemented Interfaces:
Cloneable, Serializable

public class Att
extends Object
implements Cloneable, Serializable

See Also:
Serialized Form

Field Summary
private  IeAtt myAtt
           
 
Constructor Summary
Att(IeAtt att)
          Constructs an attribute wrapper around an existing IeAtt object.
Att(String name)
          Constructs an attribute with a specific name and no initial value.
Att(String name, AttributeIdentifier attrId, Object value)
          Constructs an attribute with a specific name, attribute identifier, and initial generic value.
Att(String name, AttributeIdentifier attrId, Object value, State state)
          Constructs an attribute with a specific name, attribute identifier, initial generic value, and initial state.
Att(String name, boolean value)
          Constructs an attribute with a specific name and initial boolean value.
Att(String name, byte[] value)
          Constructs an attribute with a specific name and initial byte array value.
Att(String name, Date value)
          Constructs an attribute with a specific name and initial date value.
Att(String name, Number value)
          Constructs an attribute with a specific name and initial number value.
Att(String name, Object value)
          Constructs an attribute with a specific name and initial generic value.
Att(String name, Object value, State state)
          Constructs an attribute with a specific name, initial generic value, and initial state.
Att(String name, String value)
          Constructs an attribute with a specific name and initial string value.
 
Method Summary
 void addDatum(IeDatum value)
          Adds an object of type IeDatum as a value of the attribute.
 void addMeta(String name, byte[] value)
          Adds a meta item with a byte array value to the attribute.
 void addMeta(String name, Date value)
          Adds a meta item with a Date value to the attribute.
 void addMeta(String name, Number value)
          Adds a meta item with a Number value to the attribute.
 void addMeta(String name, String value)
          Adds a meta item with a String value to the attribute.
 void addRawValue(Object value)
          Adds a raw value of a generic type to this attribute.
 void addUniqueValue(AttributeIdentifier attrId, Object value)
          Adds a value with a specific attribute identifier to this attribute, but only if this attribute does not contain this value already.
 void addUniqueValue(AttributeIdentifier attrId, Object value, State state)
          Adds a value with a specific attribute identifier and state to this attribute, but only if this attribute does not contain this value already.
 void addUniqueValue(Object value)
          Adds a value to this attribute, but only if this attribute does not contain this value already.
 void addValue(boolean value)
          Adds a value of a string type to this attribute.
 void addValue(byte[] value)
          Adds a value of a byte array type to this attribute.
 void addValue(Date value)
          Adds a value of a date type to this attribute.
 void addValue(Number value)
          Adds a value of a number type to this attribute.
 void addValue(Object value)
          Adds a value of a generic type to this attribute.
 void addValue(Object value, State state)
          Adds a value with a specific state to this attribute.
 void addValue(String value)
          Adds a value of a string type to this attribute.
 Object clone()
          Returns a shallow copy of this attribute.
 boolean containsMetaValue(String name, Object value)
          Determines whether the attribute contains a meta item with a specific name and value.
 Att deepClone()
          Returns a deep copy of this attribute.
 IeAtt getAtt()
          Returns the attribute's internal IeAtt object.
 AttributeTypeIdentifier getAttributeTypeIdentifier()
          Returns the attribute type identifier currently assigned to this attribute.
 AttributeTypeIdentifier getAttributeTypeIdentifier(String fti)
          Returns the attribute type identifier associated with this attribute.
private  Enumeration getDatums()
          Returns all of the IeDatums of this attribute.
 Enumeration getMetaNames()
          Returns the names of all meta items associated with the attribute.
 Enumeration getMetaValues(String name)
          Returns all of the values of a meta item associated with the attribute.
 String getName()
          Returns the name currently assigned to this attribute.
 Object getRawValue()
          Returns the raw value of the first datum of this attribute.
 Object getRawValueAt(int index)
          Returns the raw value of the datum at a specific index position of this attribute.
 State getState()
          Returns the state of the first datum of this attribute.
 State getState(int index)
          Returns the state of the datum at a specific index position of this attribute.
 Object getValue()
          Returns the first datum (IeDatum object) of this attribute.
 int getValueCount()
          Returns the number of values contained in the attribute.
 Enumeration getValues()
          Returns all of the raw values of this attribute.
protected static IeAtt newStructure(String name)
          Builds a new attribute structure with a specific name and no initial value.
protected static IeAtt newStructure(String name, Object value)
          Builds a new attribute structure with a specific name and generic value.
 void removeAllValues()
          Removes all values from this attribute.
 void removeValue(IeDatum value)
          Removes a specific value from this attribute.
protected  void setAtt(IeAtt att)
          Sets the attribute's internal IeAtt object.
 void setAttributeTypeIdentifier(AttributeTypeIdentifier attrTypeId)
          Sets this attribute's attribute type identifier.
 void setName(String name)
          Sets this attribute's name.
 void setRawValue(Object value)
          Sets the raw value of this attribute to a generic type.
 void setRawValueAt(Object value, int index)
          Sets the raw value of the datum at a specific index position of this attribute to a generic type.
 void setState(State state)
          Sets the state of the first datum of this attribute.
 void setStateAt(State state, int index)
          Sets the state of the datum at a specific index position of this attribute.
 void setValue(boolean value)
          Sets the value of this attribute to a string type.
 void setValue(byte[] value)
          Sets the value of this attribute to a byte array type.
 void setValue(Date value)
          Sets the value of this attribute to a date type.
 void setValue(Number value)
          Sets the value of this attribute to a number type.
 void setValue(Object value)
          Sets the raw value of the datum at a specific index position of this attribute to a generic type.
 void setValue(String value)
          Sets the value of this attribute to a string type.
 void toXML(PrintWriter output)
          Writes the XML representation of the attribute to a specified PrintWriter.
 void toXML(PrintWriter output, boolean includeMeta)
          Writes the XML representation of the attribute to a specified PrintWriter.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myAtt

private IeAtt myAtt
Constructor Detail

Att

public Att(String name,
           Object value)
Constructs an attribute with a specific name and initial generic value.

Parameters:
name - The name of the attribute.
value - The initial value of the attribute.

Att

public Att(String name,
           boolean value)
Constructs an attribute with a specific name and initial boolean value.

Parameters:
name - The name of the attribute.
value - The initial value of the attribute.

Att

public Att(String name,
           String value)
Constructs an attribute with a specific name and initial string value.

Parameters:
name - The name of the attribute.
value - The initial value of the attribute.

Att

public Att(String name,
           Number value)
Constructs an attribute with a specific name and initial number value.

Parameters:
name - The name of the attribute.
value - The initial value of the attribute.

Att

public Att(String name,
           Date value)
Constructs an attribute with a specific name and initial date value.

Parameters:
name - The name of the attribute.
value - The initial value of the attribute.

Att

public Att(String name,
           byte[] value)
Constructs an attribute with a specific name and initial byte array value.

Parameters:
name - The name of the attribute.
value - The initial value of the attribute.

Att

public Att(String name,
           Object value,
           State state)
Constructs an attribute with a specific name, initial generic value, and initial state.

Parameters:
name - The name of the attribute.
value - The initial value of the attribute.
state - The initial state of the attribute value.

Att

public Att(String name,
           AttributeIdentifier attrId,
           Object value)
Constructs an attribute with a specific name, attribute identifier, and initial generic value.

Parameters:
name - The name of the attribute.
attrId - The attribute identifier.
value - The initial value of the attribute.

Att

public Att(String name,
           AttributeIdentifier attrId,
           Object value,
           State state)
Constructs an attribute with a specific name, attribute identifier, initial generic value, and initial state.

Parameters:
name - The name of the attribute.
attrId - The attribute identifier.
value - The initial value of the attribute.
state - The initial state of the attribute value.

Att

public Att(String name)
Constructs an attribute with a specific name and no initial value.

Parameters:
name - The name of the attribute.

Att

public Att(IeAtt att)
Constructs an attribute wrapper around an existing IeAtt object.

Parameters:
att - The IeAtt object to be wrapped.
Method Detail

toXML

public void toXML(PrintWriter output)
Writes the XML representation of the attribute to a specified PrintWriter.

Parameters:
output - The PrintWriter on which to write the XML representation.

toXML

public void toXML(PrintWriter output,
                  boolean includeMeta)
Writes the XML representation of the attribute to a specified PrintWriter.

Parameters:
output - The PrintWriter on which to write the XML representation.
includeMeta - Specify true to include meta-information in the XML representation.

getName

public String getName()
Returns the name currently assigned to this attribute.

Returns:
The attributes's current name.

setName

public void setName(String name)
Sets this attribute's name.

Parameters:
name - The attribute's new name.

getAttributeTypeIdentifier

public AttributeTypeIdentifier getAttributeTypeIdentifier()
Returns the attribute type identifier currently assigned to this attribute.

Returns:
The attributes's current identifier.

getAttributeTypeIdentifier

public AttributeTypeIdentifier getAttributeTypeIdentifier(String fti)
Returns the attribute type identifier associated with this attribute. If the attribute doesn't have an attribute type identifier already, an attribute type identifier is created from the federated type identifier specified, and this new identifier is associated with the attribute.

Parameters:
fti - The federated type identifier of the element that contains this attribute.
Returns:
The existing or newly created attribute type identifier.

setAttributeTypeIdentifier

public void setAttributeTypeIdentifier(AttributeTypeIdentifier attrTypeId)
Sets this attribute's attribute type identifier.

Parameters:
attrTypeId - The attribute's new attribute type identifier.

getValues

public Enumeration getValues()
Returns all of the raw values of this attribute.

Returns:
The values of this attribute.

getValue

public Object getValue()
Returns the first datum (IeDatum object) of this attribute.

Returns:
The first datum of this attribute.

getValueCount

public int getValueCount()
Returns the number of values contained in the attribute.

Returns:
The number of values held by this attribute.

getRawValue

public Object getRawValue()
Returns the raw value of the first datum of this attribute.

Returns:
The raw value of the first datum of this attribute.

getRawValueAt

public Object getRawValueAt(int index)
Returns the raw value of the datum at a specific index position of this attribute.

Parameters:
index - The index of the datum whose raw value will be returned.
Returns:
The raw value of the datum at the specified index.

setRawValue

public void setRawValue(Object value)
Sets the raw value of this attribute to a generic type.

Parameters:
value - The value to set.

setRawValueAt

public void setRawValueAt(Object value,
                          int index)
Sets the raw value of the datum at a specific index position of this attribute to a generic type.

Parameters:
index - The index of the datum whose value will be set.
value - The value to set.

setValue

public void setValue(Object value)
Sets the raw value of the datum at a specific index position of this attribute to a generic type.

Parameters:
value - The value to set.

setValue

public void setValue(String value)
Sets the value of this attribute to a string type.

Parameters:
value - The value to set.

setValue

public void setValue(boolean value)
Sets the value of this attribute to a string type.

Parameters:
value - The value to set.

setValue

public void setValue(Number value)
Sets the value of this attribute to a number type.

Parameters:
value - The value to set.

setValue

public void setValue(Date value)
Sets the value of this attribute to a date type.

Parameters:
value - The value to set.

setValue

public void setValue(byte[] value)
Sets the value of this attribute to a byte array type.

Parameters:
value - The value to set.

addRawValue

public void addRawValue(Object value)
Adds a raw value of a generic type to this attribute.

Parameters:
value - The value to add.

addValue

public void addValue(Object value)
Adds a value of a generic type to this attribute.

Parameters:
value - The value to add.

addValue

public void addValue(String value)
Adds a value of a string type to this attribute.

Parameters:
value - The value to add.

addValue

public void addValue(boolean value)
Adds a value of a string type to this attribute.

Parameters:
value - The value to add.

addValue

public void addValue(Number value)
Adds a value of a number type to this attribute.

Parameters:
value - The value to add.

addValue

public void addValue(Date value)
Adds a value of a date type to this attribute.

Parameters:
value - The value to add.

addValue

public void addValue(byte[] value)
Adds a value of a byte array type to this attribute.

Parameters:
value - The value to add.

addValue

public void addValue(Object value,
                     State state)
Adds a value with a specific state to this attribute.

Parameters:
value - The value to add uniquely.
state - The state to associate with the value.

addUniqueValue

public void addUniqueValue(Object value)
Adds a value to this attribute, but only if this attribute does not contain this value already.

Parameters:
value - The value to add uniquely.

addUniqueValue

public void addUniqueValue(AttributeIdentifier attrId,
                           Object value)
Adds a value with a specific attribute identifier to this attribute, but only if this attribute does not contain this value already.

Parameters:
attrId - The attribute identifier.
value - The value to add uniquely.

addUniqueValue

public void addUniqueValue(AttributeIdentifier attrId,
                           Object value,
                           State state)
Adds a value with a specific attribute identifier and state to this attribute, but only if this attribute does not contain this value already.

Parameters:
attrId - The attribute identifier.
value - The value to add uniquely.
state - The state to associate with the value.

removeValue

public void removeValue(IeDatum value)
Removes a specific value from this attribute.

Parameters:
value - The value to be removed.

removeAllValues

public void removeAllValues()
Removes all values from this attribute.


getState

public State getState()
Returns the state of the first datum of this attribute.

Returns:
The state of the first datum of this attribute.

getState

public State getState(int index)
Returns the state of the datum at a specific index position of this attribute.

Parameters:
index - The index position of the datum for which to return state.
Returns:
The state of the datum at the specified index.

setState

public void setState(State state)
Sets the state of the first datum of this attribute.


setStateAt

public void setStateAt(State state,
                       int index)
Sets the state of the datum at a specific index position of this attribute.

Parameters:
index - The index position of the datum for which to set state.

containsMetaValue

public boolean containsMetaValue(String name,
                                 Object value)
Determines whether the attribute contains a meta item with a specific name and value.

Parameters:
name - The name of the meta.
value - The value of the meta.
Returns:
true if the attribute contains the specified meta item.

getMetaNames

public Enumeration getMetaNames()
Returns the names of all meta items associated with the attribute.

Returns:
The names of the meta items, or an empty enumeration if the attribute has no meta information associated with it.

getMetaValues

public Enumeration getMetaValues(String name)
Returns all of the values of a meta item associated with the attribute.

Parameters:
name - The name of the meta item.
Returns:
The values of the meta item, or an empty enumeration if the meta item has no values, or the meta item is not found in the attribute.

addMeta

public void addMeta(String name,
                    String value)
Adds a meta item with a String value to the attribute.

Parameters:
name - the name of the meta item.
value - the value of the meta item.

addMeta

public void addMeta(String name,
                    Date value)
Adds a meta item with a Date value to the attribute.

Parameters:
name - the name of the meta item.
value - the value of the meta item.

addMeta

public void addMeta(String name,
                    Number value)
Adds a meta item with a Number value to the attribute.

Parameters:
name - the name of the meta item.
value - the value of the meta item.

addMeta

public void addMeta(String name,
                    byte[] value)
Adds a meta item with a byte array value to the attribute.

Parameters:
name - the name of the meta item.
value - the value of the meta item.

addDatum

public void addDatum(IeDatum value)
Adds an object of type IeDatum as a value of the attribute.

Parameters:
value - The object to be added.

getDatums

private Enumeration getDatums()
Returns all of the IeDatums of this attribute.

Returns:
The IeDatums

newStructure

protected static IeAtt newStructure(String name,
                                    Object value)
Builds a new attribute structure with a specific name and generic value.

Parameters:
name - The name of the new attribute.
value - The value of the new attribute.
Returns:
The new attribute.

newStructure

protected static IeAtt newStructure(String name)
Builds a new attribute structure with a specific name and no initial value.

Parameters:
name - The name of the new attribute.
Returns:
The new attribute.

getAtt

public IeAtt getAtt()
Returns the attribute's internal IeAtt object.

Returns:
The internal IeAtt object.

setAtt

protected void setAtt(IeAtt att)
Sets the attribute's internal IeAtt object.

Parameters:
att - The new internal IeAtt object.

clone

public Object clone()
Returns a shallow copy of this attribute.

Returns:
The shallow copy.

deepClone

public Att deepClone()
Returns a deep copy of this attribute.

Returns:
The deep copy.