blackboard.persist
Class UnsetId

java.lang.Object
  extended by blackboard.persist.Id
      extended by blackboard.persist.UnsetId
All Implemented Interfaces:
java.lang.Comparable

public class UnsetId
extends Id

The UnsetId class represents an unset data object Id.

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

Field Summary
static java.lang.String TO_STR
           
 
Fields inherited from class blackboard.persist.Id
UNSET_ID
 
Constructor Summary
UnsetId()
          Default constructor
 
Method Summary
 int compareTo(java.lang.Object obj)
          The sole method of the Comparable interface.
 boolean equals(java.lang.Object obj)
          Overrides the equals() method in Object to provide a simple way to compare two UnsetId s.
 int hashCode()
          Returns a hash code value for the object.
 boolean isSet()
          Determines if this UnsetId has been set.
 void setContainer(Container container)
          Override Id.setContainer(Container) to prevent the setting of the container value within an UnsetId.
 void setDataType(DataType dataType)
          Override Id.setDataType(DataType) to prevent the setting of the data type value within an UnsetId.
 java.lang.String toExternalString()
          Converts this UnsetId into its String representation.
 java.lang.String toString()
          Converts this UnsetId into its String representation.
 
Methods inherited from class blackboard.persist.Id
assertIsSet, assertMatchesContainer, assertMatchesDataType, generateId, generateId, generateId, getContainer, getDataType, hasSameContainer, hasSameDataType, load, matchesContainer, matchesDataType, newId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TO_STR

public static final java.lang.String TO_STR
See Also:
Constant Field Values
Constructor Detail

UnsetId

public UnsetId()
Default constructor

Method Detail

isSet

public boolean isSet()
Determines if this UnsetId has been set.

Specified by:
isSet in class Id
Returns:
false -- an unset id instance is always not set (thus the "unset" in UnsetId)

equals

public boolean equals(java.lang.Object obj)
Overrides the equals() method in Object to provide a simple way to compare two UnsetId s.

Specified by:
equals in class Id
Parameters:
obj - the object to be compared.
Returns:
true if the provided input is an UnsetId -- two UnsetIds are always equal.

compareTo

public int compareTo(java.lang.Object obj)
              throws java.lang.ClassCastException
The sole method of the Comparable interface. Used for sorting and natural-ordering algorithms.

Specified by:
compareTo in interface java.lang.Comparable
Specified by:
compareTo in class Id
Parameters:
obj - the object to be compared to.
Returns:
zero if the provided input is an UnsetId -- two UnsetIds are always equal.
Throws:
java.lang.ClassCastException - thrown if the specified object's type prevents it from being compared to this Object

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable

Specified by:
hashCode in class Id
Returns:
a hash code value for this object as an int. All UnsetId instances are equal and therefore always return the same hash value.

toExternalString

public java.lang.String toExternalString()
Converts this UnsetId into its String representation.

Specified by:
toExternalString in class Id
Returns:
A String representation of this UnsetId.
See Also:
Id.toString(), BbPersistenceManager.generateId(DataType,String), Container.generateId(DataType,String)

toString

public java.lang.String toString()
Converts this UnsetId into its String representation.

Specified by:
toString in class Id
Returns:
A String representation of this UnsetId.
See Also:
Id.toExternalString()

setContainer

public void setContainer(Container container)
Override Id.setContainer(Container) to prevent the setting of the container value within an UnsetId. An UnsetId is never associated with a container and therefore the container value of an UnsetId is always null.

Overrides:
setContainer in class Id
Parameters:
container - the Container to associate with this id. Can not be null.
Throws:
RunTimeException - always thrown if called

setDataType

public void setDataType(DataType dataType)
Override Id.setDataType(DataType) to prevent the setting of the data type value within an UnsetId. An UnsetId is has a hard-coded "null" data type that can not be changed.

Overrides:
setDataType in class Id
Parameters:
dataType - the DataType to associate with this Id. Can not be null. If no data type is presently desired pass in DataType.NULL_DATA_TYPE.
Throws:
RunTimeException - always thrown if called
See Also:
DataType.NULL_DATA_TYPE


Copyright © 2003 Blackboard, Inc. All Rights Reserved.