edu.unh.sdb.common
Class AttributeDescriptor

java.lang.Object
  extended by edu.unh.sdb.common.AttributeDescriptor
All Implemented Interfaces:
java.lang.Cloneable

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

Represents information about a single attribute of a point.


Constructor Summary
AttributeDescriptor(int storageType)
          Create an unnamed AttributeDescriptor from the given type.
AttributeDescriptor(int storageType, java.lang.String name)
          Create an AttributeDescriptor from the given type and name.
AttributeDescriptor(java.lang.String storageType)
          Create an unnamed AttributeDescriptor from the given type string.
AttributeDescriptor(java.lang.String storageType, java.lang.String name)
          Create an AttributeDescriptor from the given typestring and name.
AttributeDescriptor(TypeTable table, java.lang.String type, java.lang.String name)
          Create an AttributeDescriptor from the given typestring and name and give TypeTable.
 
Method Summary
 int byteSize()
          Return the number of bytes occupied by an instance of the attribute described by this AttributeDescriptor.
 java.lang.Object clone()
          Return a copy of the AttributeDescriptor as an Object.
 AttributeDescriptor copy()
          Clones the object and returns a reference to a cloned AttributeDescriptor.
 boolean equals(java.lang.Object o)
          True if the argument is equal to this AttributeDescriptor, false otherwise.
 int getStorageType()
          Return the storage type of the attribute as an int constant.
static int getStorageType(int type)
          Extract and return the storage type encoded in the integer argument.
 java.lang.String getTypeName()
          Return the type name of this AttributeDescriptor as a String.
 int getUserTypeNumber()
          Extract and return the user type number for this AttributeDescriptor.
static int getUserTypeNumber(int type)
          Extract and return the user type encoded in the integer argument.
 boolean isUserType()
          Returns true if this AttributeDescriptor has a user defined type, false otherwise.
static void main(java.lang.String[] args)
          For debugging and testing.
 java.lang.String name()
          Return the name of the attribute as a string.
 java.lang.String toString()
          Returns a String representation of the AttributeDescriptor.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeDescriptor

public AttributeDescriptor(int storageType,
                           java.lang.String name)
Create an AttributeDescriptor from the given type and name.


AttributeDescriptor

public AttributeDescriptor(int storageType)
Create an unnamed AttributeDescriptor from the given type.


AttributeDescriptor

public AttributeDescriptor(java.lang.String storageType)
Create an unnamed AttributeDescriptor from the given type string.


AttributeDescriptor

public AttributeDescriptor(TypeTable table,
                           java.lang.String type,
                           java.lang.String name)
Create an AttributeDescriptor from the given typestring and name and give TypeTable.


AttributeDescriptor

public AttributeDescriptor(java.lang.String storageType,
                           java.lang.String name)
Create an AttributeDescriptor from the given typestring and name.

Method Detail

copy

public AttributeDescriptor copy()
Clones the object and returns a reference to a cloned AttributeDescriptor.


clone

public java.lang.Object clone()
Return a copy of the AttributeDescriptor as an Object.

Overrides:
clone in class java.lang.Object

name

public java.lang.String name()
Return the name of the attribute as a string.


equals

public boolean equals(java.lang.Object o)
True if the argument is equal to this AttributeDescriptor, false otherwise. Currently, two AttributeDescriptors are equal if their name and type fields are equal, and they are using the same TypeTable object.

Overrides:
equals in class java.lang.Object

isUserType

public boolean isUserType()
Returns true if this AttributeDescriptor has a user defined type, false otherwise.


getStorageType

public int getStorageType()
Return the storage type of the attribute as an int constant.


getStorageType

public static int getStorageType(int type)
Extract and return the storage type encoded in the integer argument.


getUserTypeNumber

public int getUserTypeNumber()
Extract and return the user type number for this AttributeDescriptor. The type number can be used with a TypeTable to retrieve the UserType definition.


getUserTypeNumber

public static int getUserTypeNumber(int type)
Extract and return the user type encoded in the integer argument. The type number can be used with a TypeTable to retrieve the UserType definition.


getTypeName

public java.lang.String getTypeName()
Return the type name of this AttributeDescriptor as a String.


byteSize

public final int byteSize()
Return the number of bytes occupied by an instance of the attribute described by this AttributeDescriptor.


toString

public java.lang.String toString()
Returns a String representation of the AttributeDescriptor.

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
For debugging and testing.