ikrs.typesystem
Class BasicTypeAdapter

java.lang.Object
  extended by ikrs.typesystem.BasicTypeAdapter
All Implemented Interfaces:
BasicType
Direct Known Subclasses:
BasicArrayType, BasicBooleanType, BasicCharType, BasicNumberType, BasicStringType, BasicUUIDType

public abstract class BasicTypeAdapter
extends java.lang.Object
implements BasicType


Field Summary
 
Fields inherited from interface ikrs.typesystem.BasicType
TYPE_ARRAY, TYPE_BOOLEAN, TYPE_BYTE, TYPE_CHAR, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT, TYPE_LONG, TYPE_SHORT, TYPE_STRING, TYPE_UUID
 
Constructor Summary
BasicTypeAdapter(int type)
           
 
Method Summary
 boolean equals(BasicArrayType a)
           
 boolean equals(BasicType t)
           
 boolean equals(boolean b)
           
 boolean equals(byte b)
           
 boolean equals(char c)
           
 boolean equals(double d)
           
 boolean equals(float f)
           
 boolean equals(int i)
           
 boolean equals(long l)
           
 boolean equals(short s)
           
 boolean equals(java.lang.String s)
           
 boolean equals(java.util.UUID id)
           
 BasicArrayType getArray()
          The method is more or less for implicit type casting.
 BasicArrayType getArray(BasicArrayType defaultValue)
          The method is more or less for implicit type casting.
 BasicType getArrayElementAt(int index)
           
 int getArraySize()
           
 boolean getBoolean()
           
 boolean getBoolean(boolean defaultValue)
           
 byte getByte()
           
 byte getByte(byte defaultValue)
           
 char getChar()
           
 char getChar(char defaultValue)
           
 double getDouble()
           
 double getDouble(double defaultValue)
           
 float getFloat()
           
 float getFloat(float defaultValue)
           
 int getInt()
           
 int getInt(int defaultValue)
           
 long getLong()
           
 long getLong(long defaultValue)
           
 short getShort()
           
 short getShort(short defaultValue)
           
 java.lang.String getString()
           
 java.lang.String getString(java.lang.String defaultValue)
           
 int getType()
           
 java.util.UUID getUUID()
           
 java.util.UUID getUUID(java.util.UUID defaultValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicTypeAdapter

public BasicTypeAdapter(int type)
Method Detail

getType

public int getType()
Specified by:
getType in interface BasicType

getBoolean

public boolean getBoolean()
                   throws BasicTypeException
Specified by:
getBoolean in interface BasicType
Throws:
BasicTypeException

getBoolean

public boolean getBoolean(boolean defaultValue)
Specified by:
getBoolean in interface BasicType

getByte

public byte getByte()
             throws BasicTypeException
Specified by:
getByte in interface BasicType
Throws:
BasicTypeException

getByte

public byte getByte(byte defaultValue)
Specified by:
getByte in interface BasicType

getShort

public short getShort()
               throws BasicTypeException
Specified by:
getShort in interface BasicType
Throws:
BasicTypeException

getShort

public short getShort(short defaultValue)
Specified by:
getShort in interface BasicType

getInt

public int getInt()
           throws BasicTypeException
Specified by:
getInt in interface BasicType
Throws:
BasicTypeException

getInt

public int getInt(int defaultValue)
Specified by:
getInt in interface BasicType

getLong

public long getLong()
             throws BasicTypeException
Specified by:
getLong in interface BasicType
Throws:
BasicTypeException

getLong

public long getLong(long defaultValue)
Specified by:
getLong in interface BasicType

getFloat

public float getFloat()
               throws BasicTypeException
Specified by:
getFloat in interface BasicType
Throws:
BasicTypeException

getFloat

public float getFloat(float defaultValue)
Specified by:
getFloat in interface BasicType

getDouble

public double getDouble()
                 throws BasicTypeException
Specified by:
getDouble in interface BasicType
Throws:
BasicTypeException

getDouble

public double getDouble(double defaultValue)
Specified by:
getDouble in interface BasicType

getChar

public char getChar()
             throws BasicTypeException
Specified by:
getChar in interface BasicType
Throws:
BasicTypeException

getChar

public char getChar(char defaultValue)
Specified by:
getChar in interface BasicType

getString

public java.lang.String getString()
                           throws BasicTypeException
Specified by:
getString in interface BasicType
Throws:
BasicTypeException

getString

public java.lang.String getString(java.lang.String defaultValue)
Specified by:
getString in interface BasicType

getUUID

public java.util.UUID getUUID()
                       throws BasicTypeException
Specified by:
getUUID in interface BasicType
Throws:
BasicTypeException

getUUID

public java.util.UUID getUUID(java.util.UUID defaultValue)
Specified by:
getUUID in interface BasicType

getArray

public BasicArrayType getArray()
                        throws BasicTypeException
The method is more or less for implicit type casting. It must return this object itself with the dynamic type 'BasicArrayType'. If this object is NOT a BasicArrayType, it MUST throw a BasicTypeException.

Specified by:
getArray in interface BasicType
Throws:
BasicTypeException

getArray

public BasicArrayType getArray(BasicArrayType defaultValue)
The method is more or less for implicit type casting. It must return this object itself with the dynamic type 'BasicArrayType'. If this object is NOT a BasicArrayType, it MUST return the passed defaultValue.

Specified by:
getArray in interface BasicType

getArraySize

public int getArraySize()
                 throws BasicTypeException
Specified by:
getArraySize in interface BasicType
Throws:
BasicTypeException

getArrayElementAt

public BasicType getArrayElementAt(int index)
                            throws BasicTypeException,
                                   java.lang.ArrayIndexOutOfBoundsException
Specified by:
getArrayElementAt in interface BasicType
Throws:
BasicTypeException
java.lang.ArrayIndexOutOfBoundsException

equals

public boolean equals(BasicType t)
Specified by:
equals in interface BasicType

equals

public boolean equals(boolean b)
Specified by:
equals in interface BasicType

equals

public boolean equals(byte b)
Specified by:
equals in interface BasicType

equals

public boolean equals(short s)
Specified by:
equals in interface BasicType

equals

public boolean equals(int i)
Specified by:
equals in interface BasicType

equals

public boolean equals(long l)
Specified by:
equals in interface BasicType

equals

public boolean equals(float f)
Specified by:
equals in interface BasicType

equals

public boolean equals(double d)
Specified by:
equals in interface BasicType

equals

public boolean equals(char c)
Specified by:
equals in interface BasicType

equals

public boolean equals(java.lang.String s)
Specified by:
equals in interface BasicType

equals

public boolean equals(java.util.UUID id)
Specified by:
equals in interface BasicType

equals

public boolean equals(BasicArrayType a)
Specified by:
equals in interface BasicType