|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.davisor.data.VoidData
VoidData is an abstract base class for concrete Data classes. Data objects know it's type, managed by the methods of this class.
Type,
VoidType| Field Summary | |
protected Type |
M_type
The type of this data. |
| Constructor Summary | |
protected |
VoidData()
Default constructor. |
protected |
VoidData(Type type)
Create a new data object. |
protected |
VoidData(VoidData data,
boolean deep)
Deep or shallow copy constructor. |
| Method Summary | |
boolean |
equals(java.lang.Object o)
Tests if this object is equal with another object. |
protected DataValue |
getDataValue(java.lang.Object object)
Makes a DataValue out of an object if it is not already
one. |
Type |
getType()
Gets data type. |
int |
hashCode()
Returns a hash code value for the object. |
void |
setType(Type type)
Sets the data type. |
java.lang.String |
toString()
Gets the string representation of this data object. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Type M_type
| Constructor Detail |
protected VoidData()
protected VoidData(VoidData data,
boolean deep)
data - source data (may be null)deep - determines if the copying is deep or shallowgetType(),
Type.dup()protected VoidData(Type type)
type - The type of data.getType()| Method Detail |
public Type getType()
throws InvalidDataException
getType in interface DataInvalidDataException - if type retrieval failspublic boolean equals(java.lang.Object o)
Void data objects are by default equal to non-null instances of
VoidData if the type are equal, or if the types are both
null.
Subclasses are expected to extend this equality test. In
particular, subclass implementations are encouraged to first
test object instance equality with the == operator,
then their super-class unequality with
super.equals(Object) method, and finally perform
their own class -spesific equality tests if neccessary. A typical
test sequence should therefore look something like this:
public boolean equals(Object o)
{
if(this == o) return true;
if(!super.equals(o) || !(o instanceof SubClass)) return false;
:
}
Compare.equals(Object,Object),
Type.equals(Object)public int hashCode()
public java.lang.String toString()
null string.
protected DataValue getDataValue(java.lang.Object object)
throws InvalidDataException
DataValue out of an object if it is not already
one. The conversion, if any, is done using the current type
Type.toData(Object) method. null objects are
converted, too, and weather they remain null or not
depends on the behaviour of the current type.
If conversion is needed but the current type is
null, null values remain
null, but any other object value raises an exception.
InvalidDataException - if the object could not be convertedType.toData(Object)public void setType(Type type)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||