blackboard.data
Class BbAttributes

java.lang.Object
  extended by blackboard.data.BbAttributes
All Implemented Interfaces:
java.lang.Cloneable

public class BbAttributes
extends java.lang.Object
implements java.lang.Cloneable

The BbAttributes class is used to store a set of BbAttribute objects.

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

Constructor Summary
BbAttributes()
          Default Constructor
 
Method Summary
 void addBbAttribute(BbAttribute theAttrib)
          Deprecated. use the setType methods instead
 java.lang.Object clone()
          This method clones the BbAttributes object, as well as creating new instances of the contained BbAttribute objects.
 BbAttribute getBbAttribute(java.lang.String strName)
          Returns the BbAttribute object associated with given name ("key").
 java.util.List getBbAttributeList()
          Returns a list of the contained BbAttribute values.
 BbEnum getBbEnum(java.lang.String strName)
          Get the BbEnum value associated with given attribute name.
 IBbObject getBbObject(java.lang.String strName)
          Get the IBbObject value associated with given attribute name.
 java.lang.Boolean getBoolean(java.lang.String strName)
          Get the Boolean value associated with given attribute name.
 java.util.Calendar getCalendar(java.lang.String strName)
          Get the Calendar value associated with given attribute name.
 java.lang.Double getDouble(java.lang.String strName)
          Get the Double value associated with given attribute name.
 java.lang.Float getFloat(java.lang.String strName)
          Get the Float value associated with given attribute name.
 FormattedText getFormattedText(java.lang.String strName)
          Get the FormattedText value associated with given attribute name.
 Id getId(java.lang.String strName)
          Get the Id value associated with given attribute name.
 java.lang.Integer getInteger(java.lang.String strName)
          Get the Integer value associated with given attribute name.
 boolean getIsDirty()
          Get the "dirty" status of this BbAttributes.
 java.lang.Long getLong(java.lang.String strName)
          Get the Long value associated with given attribute name.
 java.lang.Object getObject(java.lang.String strName)
          Get the Object value associated with given attribute name.
 java.lang.Boolean getSafeBoolean(java.lang.String strName)
          Get the Boolean value associated with given attribute name.
 java.lang.Double getSafeDouble(java.lang.String strName)
          Get the Double value associated with given attribute name.
 java.lang.Float getSafeFloat(java.lang.String strName)
          Get the Float value associated with given attribute name.
 FormattedText getSafeFormattedText(java.lang.String strName)
          Get the FormattedText value associated with given attribute name.
 Id getSafeId(java.lang.String strName)
          Get the Id value associated with given attribute name.
 java.lang.Integer getSafeInteger(java.lang.String strName)
          Get the Integer value associated with given attribute name.
 java.lang.Long getSafeLong(java.lang.String strName)
          Get the Long value associated with given attribute name.
 java.lang.String getSafeString(java.lang.String strName)
          Get the String value associated with given attribute name.
 java.lang.String getString(java.lang.String strName)
          Get the String value associated with given attribute name.
protected  java.lang.Object getValue(java.lang.String strName, BbAttribute.Type eType)
          Internal convenience method to make the type-specific "get" routines much simpler (i.e., shorter).
 void removeBbAttribute(java.lang.String strName)
          Removes the BbAttribute object associated with the given name ("key")
 void reset()
          Clears "isSet" and "isDirty" status of this BbAttributes
 void setBbEnum(java.lang.String strName, BbEnum val)
          Sets the value of the attribute with the given name ("key") to the provided BbEnum value.
 void setBbObject(java.lang.String strName)
          Sets the value of the attribute with the given name ("key") to the "unset" value.
 void setBbObject(java.lang.String strName, IBbObject val)
          Sets the value of the attribute with the given name ("key") to the provided IBbObject value.
 void setBoolean(java.lang.String strName, boolean val)
          Sets the value of the attribute with the given name ("key") to the provided boolean value.
 void setBoolean(java.lang.String strName, java.lang.Boolean val)
          Sets the value of the attribute with the given name ("key") to the provided Boolean value.
 void setCalendar(java.lang.String strName, java.util.Calendar val)
          Sets the value of the attribute with the given name ("key") to the provided Calendar value.
 void setDouble(java.lang.String strName, double val)
          Sets the value of the attribute with the given name ("key") to the provided double value.
 void setDouble(java.lang.String strName, java.lang.Double val)
          Sets the value of the attribute with the given name ("key") to the provided Double value.
 void setFloat(java.lang.String strName, float val)
          Sets the value of the attribute with the given name ("key") to the provided float value.
 void setFloat(java.lang.String strName, java.lang.Float val)
          Sets the value of the attribute with the given name ("key") to the provided Float value.
 void setFormattedText(java.lang.String strName, FormattedText val)
          Sets the value of the attribute with the given name ("key") to the provided FormattedText value.
 void setId(java.lang.String strName, Id val)
          Sets the value of the attribute with the given name ("key") to the provided Id value.
 void setInteger(java.lang.String strName, int val)
          Sets the value of the attribute with the given name ("key") to the provided int value.
 void setInteger(java.lang.String strName, java.lang.Integer val)
          Sets the value of the attribute with the given name ("key") to the provided Integer value.
 void setIsDirty(boolean bIsDirty)
          Sets "dirty" (changed) status of this BbAttributes
 void setIsDirtyCascading(boolean bIsDirty)
          Sets "dirty" (changed) status of this BbAttributes
 void setIsSetCascading(boolean bIsSet)
          Sets "isSet"status of this BbAttributes
 void setLong(java.lang.String strName, long val)
          Sets the value of the attribute with the given name ("key") to the provided long value.
 void setLong(java.lang.String strName, java.lang.Long val)
          Sets the value of the attribute with the given name ("key") to the provided Long value.
 void setObject(java.lang.String strName)
          Sets the value of the attribute with the given name ("key") to the "unset" value.
 void setObject(java.lang.String strName, java.lang.Object val)
          Sets the value of the attribute with the given name ("key") to the provided Object value.
 void setString(java.lang.String strName, java.lang.String val)
          Sets the value of the attribute with the given name ("key") to the provided String value.
protected  void setValue(java.lang.String strName, java.lang.Object val, BbAttribute.Type eType)
          Internal convenience method to make the type-specific "set" routines much simpler (i.e., shorter).
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BbAttributes

public BbAttributes()
Default Constructor

Method Detail

getValue

protected java.lang.Object getValue(java.lang.String strName,
                                    BbAttribute.Type eType)
                             throws BbAttributeException
Internal convenience method to make the type-specific "get" routines much simpler (i.e., shorter). By accepting the additional type parameter we can perform all of the get functions in a generic fashion.

Get the Object value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
eType - a type value from BbAttribute.Type giving the expected type of the attribute whose value we are getting
Returns:
the attribute's value as an Object.
Throws:
BbAttributeException - if an attribute with the given name can not be found, or the retrieved attribute is not the same type as provided in the parameter eType.

setValue

protected void setValue(java.lang.String strName,
                        java.lang.Object val,
                        BbAttribute.Type eType)
                 throws BbAttributeException
Internal convenience method to make the type-specific "set" routines much simpler (i.e., shorter). By accepting the additional type parameter we can perform all of the set functions in a generic fashion.

Sets the value of the attribute with the given name ("key") to the provided Object value. This function will not create an attribute if it does not exist, it will only set the value on already existing attributes.

All "set" methods within BbAttributes should call this method when setting a value because it performs all of the necessary type checking and enforcement, however, since it does not create attributes itself (if they do not exist) the return type needs to be checked to determine whether an an attribute should be created. Attribute creation should be handled by the individual "set" methods themselves (and it is therefore important to check the return value of this method) in order to ensure the correct type of attribute is created. Because this method treats all values as Object s, it can only create Object attributes. I originally got tripped up by this when I first wrote the method and had it create the attributes when they didn't exist. That didn't work though and so attribute creation has now been pushed to the individual "set" methods.

Parameters:
strName - the string describing the attribute's name ("key").
val - the Integer to use as the attribute's new value.
eType - a type value from BbAttribute.Type giving the expected type of the attribute whose value we are setting
Throws:
BbAttributeException - if the attribute with the given name is not of the the same type as provided in the parameter eType.

getInteger

public java.lang.Integer getInteger(java.lang.String strName)
                             throws BbAttributeException
Get the Integer value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as an Integer.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.INTEGER).

getSafeInteger

public java.lang.Integer getSafeInteger(java.lang.String strName)
                                 throws BbAttributeException
Get the Integer value associated with given attribute name. Unlike getInteger(String) the value returned is "safe" such that null will never be returned from the method. If the given attribute has a null value, an appropriate default value will be returned.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as an Integer or a default value if the attribute value is null
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.INTEGER).

setInteger

public void setInteger(java.lang.String strName,
                       int val)
                throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided int value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the int to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.INTEGER).

setInteger

public void setInteger(java.lang.String strName,
                       java.lang.Integer val)
                throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided Integer value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the Integer to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.INTEGER).

getLong

public java.lang.Long getLong(java.lang.String strName)
                       throws BbAttributeException
Get the Long value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a Long.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.LONG).

getSafeLong

public java.lang.Long getSafeLong(java.lang.String strName)
                           throws BbAttributeException
Get the Long value associated with given attribute name. Unlike getLong(String) the value returned is "safe" such that null will never be returned from the method. If the given attribute has a null value, an appropriate default value will be returned.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a Long or a default value if the attribute value is null
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.LONG).

setLong

public void setLong(java.lang.String strName,
                    long val)
             throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided long value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the long to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.LONG).

setLong

public void setLong(java.lang.String strName,
                    java.lang.Long val)
             throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided Long value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the Long to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.LONG).

getFloat

public java.lang.Float getFloat(java.lang.String strName)
                         throws BbAttributeException
Get the Float value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a Float.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.FLOAT).

getSafeFloat

public java.lang.Float getSafeFloat(java.lang.String strName)
                             throws BbAttributeException
Get the Float value associated with given attribute name. Unlike getFloat(String) the value returned is "safe" such that null will never be returned from the method. If the given attribute has a null value, an appropriate default value will be returned.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a Float or a default value if the attribute value is null
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.FLOAT).

setFloat

public void setFloat(java.lang.String strName,
                     float val)
              throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided float value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the float to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.FLOAT).

setFloat

public void setFloat(java.lang.String strName,
                     java.lang.Float val)
              throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided Float value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the Float to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.FLOAT).

getDouble

public java.lang.Double getDouble(java.lang.String strName)
                           throws BbAttributeException
Get the Double value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a Double.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.DOUBLE).

getSafeDouble

public java.lang.Double getSafeDouble(java.lang.String strName)
                               throws BbAttributeException
Get the Double value associated with given attribute name. Unlike getDouble(String) the value returned is "safe" such that null will never be returned from the method. If the given attribute has a null value, an appropriate default value will be returned.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a Double or a default value if the attribute value is null
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.DOUBLE).

setDouble

public void setDouble(java.lang.String strName,
                      double val)
               throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided double value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the double to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.DOUBLE).

setDouble

public void setDouble(java.lang.String strName,
                      java.lang.Double val)
               throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided Double value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the Double to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.DOUBLE).

getBoolean

public java.lang.Boolean getBoolean(java.lang.String strName)
                             throws BbAttributeException
Get the Boolean value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as an Boolean.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.BOOLEAN).

getSafeBoolean

public java.lang.Boolean getSafeBoolean(java.lang.String strName)
                                 throws BbAttributeException
Get the Boolean value associated with given attribute name. Unlike getBoolean(String) the value returned is "safe" such that null will never be returned from the method. If the given attribute has a null value, an appropriate default value will be returned.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as an Boolean or a default value if the attribute value is null
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.BOOLEAN).

setBoolean

public void setBoolean(java.lang.String strName,
                       boolean val)
                throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided boolean value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the boolean to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.BOOLEAN).

setBoolean

public void setBoolean(java.lang.String strName,
                       java.lang.Boolean val)
                throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided Boolean value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the Boolean to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.BOOLEAN).

getString

public java.lang.String getString(java.lang.String strName)
                           throws BbAttributeException
Get the String value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a String.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.STRING).

getSafeString

public java.lang.String getSafeString(java.lang.String strName)
                               throws BbAttributeException
Get the String value associated with given attribute name. Unlike getString(String) the value returned is "safe" such that null will never be returned from the method. If the given attribute has a null value, an appropriate default value will be returned.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a String or a default value if the attribute value is null
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.STRING).

setString

public void setString(java.lang.String strName,
                      java.lang.String val)
               throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided String value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the String to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.STRING).

getCalendar

public java.util.Calendar getCalendar(java.lang.String strName)
                               throws BbAttributeException
Get the Calendar value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a Calendar.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.CALENDAR).

setCalendar

public void setCalendar(java.lang.String strName,
                        java.util.Calendar val)
                 throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided Calendar value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the Calendar to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.CALENDAR).

getObject

public java.lang.Object getObject(java.lang.String strName)
                           throws BbAttributeException
Get the Object value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a Object.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.OBJECT).

setObject

public void setObject(java.lang.String strName,
                      java.lang.Object val)
               throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided Object value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the Object to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.OBJECT).

setObject

public void setObject(java.lang.String strName)
               throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the "unset" value. If an attribute with the given name can not be found an attribute with the given name and value will be created. The "unset" value denotes an attribute who exists in the list of attributes, but has not yet been given a value.

Parameters:
strName - the string describing the attribute's name ("key").
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.OBJECT).

getId

public Id getId(java.lang.String strName)
         throws BbAttributeException
Get the Id value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a Id.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.ID).

getSafeId

public Id getSafeId(java.lang.String strName)
             throws BbAttributeException
Get the Id value associated with given attribute name. Unlike getId(String) the value returned is "safe" such that null will never be returned from the method. If the given attribute has a null value, an appropriate default value will be returned.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a Id or a default value if the attribute value is null
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.ID).

setId

public void setId(java.lang.String strName,
                  Id val)
           throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided Id value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the Id to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.ID).

getBbEnum

public BbEnum getBbEnum(java.lang.String strName)
                 throws BbAttributeException
Get the BbEnum value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a BbEnum.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.BBENUM).

setBbEnum

public void setBbEnum(java.lang.String strName,
                      BbEnum val)
               throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided BbEnum value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the BbEnum to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.BBENUM).

getFormattedText

public FormattedText getFormattedText(java.lang.String strName)
                               throws BbAttributeException
Get the FormattedText value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a FormattedText.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.FORMATTEDTEXT).

getSafeFormattedText

public FormattedText getSafeFormattedText(java.lang.String strName)
                                   throws BbAttributeException
Get the FormattedText value associated with given attribute name. Unlike getFormattedText(String) the value returned is "safe" such that null will never be returned from the method. If the given attribute has a null value, an appropriate default value will be returned.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a FormattedText or a default value if the attribute value is null
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.FORMATTEDTEXT).

setFormattedText

public void setFormattedText(java.lang.String strName,
                             FormattedText val)
                      throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided FormattedText value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the FormattedText to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.FORMATTEDTEXT).

getBbObject

public IBbObject getBbObject(java.lang.String strName)
                      throws BbAttributeException
Get the IBbObject value associated with given attribute name.

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the attribute's value as a IBbObject.
Throws:
BbAttributeException - if an attribute with the given name can not be found, is unset, or the retrieved attribute is not of the appropriate type (BbAttribute.Type.BBOBJECT).

setBbObject

public void setBbObject(java.lang.String strName,
                        IBbObject val)
                 throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the provided IBbObject value. If an attribute with the given name can not be found an attribute with the given name and value will be created.

Parameters:
strName - the string describing the attribute's name ("key").
val - the IBbObject to use as the attribute's new value.
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.BBOBJECT).

setBbObject

public void setBbObject(java.lang.String strName)
                 throws BbAttributeException
Sets the value of the attribute with the given name ("key") to the "unset" value. If an attribute with the given name can not be found an attribute with the given name and value will be created. The "unset" value denotes an attribute who exists in the list of attributes, but has not yet been given a value.

Parameters:
strName - the string describing the attribute's name ("key").
Throws:
BbAttributeException - if the attribute with the given name is not of the appropriate type (BbAttribute.Type.BBOBJECT).

addBbAttribute

public void addBbAttribute(BbAttribute theAttrib)
Deprecated. use the setType methods instead

Adds the provided attribute object to attributes list. If the given BbAttribute already exists, nothing is done.

Parameters:
theAttrib - the BbAttribute to be added.

removeBbAttribute

public void removeBbAttribute(java.lang.String strName)
Removes the BbAttribute object associated with the given name ("key")

Parameters:
strName - the string describing the attribute's name ("key").

getBbAttribute

public BbAttribute getBbAttribute(java.lang.String strName)
Returns the BbAttribute object associated with given name ("key").

Parameters:
strName - the string describing the attribute's name ("key").
Returns:
the BbAttribute associated with the given name, null if the attribute can not be located

getIsDirty

public boolean getIsDirty()
Get the "dirty" status of this BbAttributes. This attribute collection is "dirty" if its value has been changed sinced a saved state (a change occurs when an attribute is added to the collection, or a contained attribute is modified). BbAttributes starts out "dirty" since it has yet to be saved to any location.

Returns:
boolean returns "dirty" status of this BbAttributes. true if this attribute container is "dirty", false otherwise.

setIsDirty

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

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

setIsDirtyCascading

public void setIsDirtyCascading(boolean bIsDirty)
Sets "dirty" (changed) status of this BbAttributes

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

setIsSetCascading

public void setIsSetCascading(boolean bIsSet)
Sets "isSet"status of this BbAttributes

Parameters:
bIsDirty - boolean flag denoting whether the attribute has been set to this group of attributes.

reset

public void reset()
Clears "isSet" and "isDirty" status of this BbAttributes

Parameters:
bIsDirty - boolean flag denoting whether the attribute has been set to this group of attributes.

getBbAttributeList

public java.util.List getBbAttributeList()
Returns a list of the contained BbAttribute values. Values in the list must be cast before being used as BbAttribute values.

Returns:
the list of BbAttribute values contained by this container

clone

public java.lang.Object clone()
This method clones the BbAttributes object, as well as creating new instances of the contained BbAttribute objects. The objects refrenced by each BbAttribute are not currently cloned.

Overrides:
clone in class java.lang.Object


Copyright © 2003 Blackboard, Inc. All Rights Reserved.