blackboard.data
Class BbAttribute

java.lang.Object
  extended by blackboard.data.BbAttribute

public class BbAttribute
extends java.lang.Object

The BbAttribute class is used to form the basis of the name/value pairs used for IBbObject based object properties. Beyond the basic name and value information, this object also provides additional information regarding the "state" of an attribute. This "state" information is internally controlled and should be useful in some special circumstances.

This object can not be directed instantiated or manipulated and therefore, the majority of interaction with it will be through its parent container BbAttributes.

Since:
Bb 6.0
Version:
$Revision: #1 $ $Date: 2005/06/27 $

Nested Class Summary
static class BbAttribute.Type
           
 
Constructor Summary
protected BbAttribute(BbAttribute.Type eType, java.lang.String strName, java.lang.Object val, BbAttributes parent)
          Initialization with generic object but of a specific type.
protected BbAttribute(java.lang.String strName, BbEnum val, BbAttributes parent)
          Initialization with BbEnum.
protected BbAttribute(java.lang.String strName, java.lang.Boolean val, BbAttributes parent)
          Initialization with Boolean.
protected BbAttribute(java.lang.String strName, java.util.Calendar val, BbAttributes parent)
          Initialization with Calendar.
protected BbAttribute(java.lang.String strName, java.lang.Double val, BbAttributes parent)
          Initialization with Double.
protected BbAttribute(java.lang.String strName, java.lang.Float val, BbAttributes parent)
          Initialization with Float.
protected BbAttribute(java.lang.String strName, FormattedText val, BbAttributes parent)
          Initialization with FormattedText.
protected BbAttribute(java.lang.String strName, IBbObject val, BbAttributes parent)
          Initialization with IBbObject.
protected BbAttribute(java.lang.String strName, Id val, BbAttributes parent)
          Initialization with Id.
protected BbAttribute(java.lang.String strName, java.lang.Integer val, BbAttributes parent)
          Initialization with Integer.
protected BbAttribute(java.lang.String strName, java.lang.Long val, BbAttributes parent)
          Initialization with Long.
protected BbAttribute(java.lang.String strName, java.lang.Object val, BbAttributes parent)
          Initialization with generic object.
protected BbAttribute(java.lang.String strName, java.lang.String val, BbAttributes parent)
          Initialization with String.
 
Method Summary
 boolean getIsDirty()
          Get the "dirty" status of this BbAttribute.
 boolean getIsReadOnly()
          Returns value of the isReadOnly flag.
 boolean getIsSet()
          Retrieve "set" status of this BbAtribute.
 java.lang.String getName()
          Retrieves name ("key") associated with this BbAttribute object.
 BbAttribute.Type getType()
          Retrieves BbAttribute object type.
 java.lang.Object getValue()
          Retrieves object value associated with BbAttribute object.
 void setIsDirty(boolean bIsDirty)
          Sets "dirty" (changed) status of BbAttribute
 void setIsReadOnly(boolean isReadOnly)
          Sets the value of the isReadOnly flag.
protected  void setIsSet(boolean bIsSet)
          Sets the "has been set" status of this BbAttribute.
protected  void setValue()
          Sets the value of this BbAttribute to "unset".
protected  void setValue(java.lang.Object val)
          Sets value object with type Object.
 java.lang.String toString()
          Converts this BbAttribute value to a string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BbAttribute

protected BbAttribute(java.lang.String strName,
                      java.lang.Integer val,
                      BbAttributes parent)
Initialization with Integer.

Parameters:
strName - The string describing the attributes key.
val - The Integer describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      java.lang.Long val,
                      BbAttributes parent)
Initialization with Long.

Parameters:
strName - The string describing the attributes key.
val - The Long describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      java.lang.Float val,
                      BbAttributes parent)
Initialization with Float.

Parameters:
strName - The string describing the attributes key.
val - The Float describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      java.lang.Double val,
                      BbAttributes parent)
Initialization with Double.

Parameters:
strName - The string describing the attributes key.
val - The Double describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      java.lang.Boolean val,
                      BbAttributes parent)
Initialization with Boolean.

Parameters:
strName - The string describing the attributes key.
val - The Boolean describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      java.lang.String val,
                      BbAttributes parent)
Initialization with String.

Parameters:
strName - The string describing the attributes key.
val - The string describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      java.util.Calendar val,
                      BbAttributes parent)
Initialization with Calendar.

Parameters:
strName - The string describing the attributes key.
val - The Calendar describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      java.lang.Object val,
                      BbAttributes parent)
Initialization with generic object.

Parameters:
strName - The string describing the attributes key.
val - The Object describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      Id val,
                      BbAttributes parent)
Initialization with Id.

Parameters:
strName - The string describing the attributes key.
val - The Id describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      BbEnum val,
                      BbAttributes parent)
Initialization with BbEnum.

Parameters:
strName - The string describing the attributes key.
val - The BbEnum describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      FormattedText val,
                      BbAttributes parent)
Initialization with FormattedText.

Parameters:
strName - The string describing the attributes key.
val - The FormattedText describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(java.lang.String strName,
                      IBbObject val,
                      BbAttributes parent)
Initialization with IBbObject.

Parameters:
strName - The string describing the attributes key.
val - The IBbObject describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.

BbAttribute

protected BbAttribute(BbAttribute.Type eType,
                      java.lang.String strName,
                      java.lang.Object val,
                      BbAttributes parent)
Initialization with generic object but of a specific type.

Parameters:
eType - The BbAttribute.Type describing the attribute object type.
strName - The string describing the attributes key.
val - The Object describing the attributes value.
parent - the parent BbAttributes object that will "contain" this attribute.
Method Detail

getName

public java.lang.String getName()
Retrieves name ("key") associated with this BbAttribute object.

Returns:
String BbAttribute name ("key") value.

getType

public BbAttribute.Type getType()
Retrieves BbAttribute object type.

Returns:
a type value as defined in BbAttribute.Type

getIsReadOnly

public boolean getIsReadOnly()
Returns value of the isReadOnly flag. If an attribute is read-only, attempting to set it would result in an ImmutableException being thrown

Returns:
Returns whether this value can be set.

setIsReadOnly

public void setIsReadOnly(boolean isReadOnly)
Sets the value of the isReadOnly flag.

Parameters:
isReadOnly - The isReadOnly to set.

getValue

public java.lang.Object getValue()
Retrieves object value associated with BbAttribute object.

Returns:
Object Reference to attribute value object.

setValue

protected void setValue()
Sets the value of this BbAttribute to "unset". The "unset" case results in an ambiguous attribute value but will result in a sensible default being used should the attribute value be retrieved. The "unset" case will typically signify the state where an attribute value has not been loaded as in the case of a "light-weight" load being performed. In this case, the objects contained by the heavy object will have not been loaded and therefore be in an "unset" state.


setValue

protected void setValue(java.lang.Object val)
Sets value object with type Object.

NOTE: this method does no checking of the provided value to make sure it makes sense given the type of the attribute. Since this method is protected it is assumed that any caller has already validated this and it is therefore not necessary here.

Parameters:
val - The new attribute value.

getIsSet

public boolean getIsSet()
Retrieve "set" status of this BbAtribute. Unless an attribute value is "set", any value retrieved through getValue() will be ambiguous. The value provided by an attribute in an "unset" state could be any default value the attribute deems appropriate based upon its type, although the typical return value will be null.

Returns:
boolean the "set" status of this BbAttribute. true if the object value has been "set", false otherwise.

setIsSet

protected void setIsSet(boolean bIsSet)
Sets the "has been set" status of this BbAttribute.

Parameters:
bIsSet - boolean flag denoting whether this attribute is "set".

getIsDirty

public boolean getIsDirty()
Get the "dirty" status of this BbAttribute. An attribute is "dirty" if it value has been changed sinced a saved state. A BbAttribute starts out "dirty" since it has yet to be saved to any location.

Returns:
boolean Returns "dirty" status of this BbAttribute. true if the attribute is "dirty", false otherwise.

setIsDirty

public void setIsDirty(boolean bIsDirty)
Sets "dirty" (changed) status of BbAttribute

Parameters:
bIsDirty - boolean flag denoting whether a change has been made to this attribute.

toString

public java.lang.String toString()
Converts this BbAttribute value to a string representation. Can be used for debug purposes.

Overrides:
toString in class java.lang.Object
Returns:
a String describing the name and value of this BbAttribute


Copyright © 2003 Blackboard, Inc. All Rights Reserved.