|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.unh.sdb.common.Type
edu.unh.sdb.common.UserType
edu.unh.sdb.common.RecordDescriptor
public class RecordDescriptor
A RecordDescriptor is an ordered collection of AttributeDescriptors. Used to represent the name and type of all the attributes of a point in the geometric space (i.e. a Datum).
Field Summary | |
---|---|
protected int[] |
byteOffsets
|
protected int |
byteSize
|
protected AttributeDescriptor[] |
defs
|
protected java.util.ArrayList |
typeCounters
|
protected TypeTable |
types
|
Fields inherited from class edu.unh.sdb.common.UserType |
---|
storageType |
Fields inherited from class edu.unh.sdb.common.Type |
---|
name |
Constructor Summary | |
---|---|
protected |
RecordDescriptor()
Constructs an empty RecordDescriptor. |
|
RecordDescriptor(AttributeDescriptor[] attrs)
Constructs an unnamed RecordDescriptor from an array of AttributeDescriptors. |
|
RecordDescriptor(char typeSpec,
int numAttr)
Constructs an unnamed uni-type RecordDescriptor of a specified length The type is determined by the first argument, the number of fields by the second. |
|
RecordDescriptor(java.lang.String typeSpec)
Constructs an unnamed RecordDescriptor from a String in which each character identifies a field and its type. |
|
RecordDescriptor(java.lang.String name,
AttributeDescriptor[] attrs)
Constructs a named RecordDescriptor from an array of AttributeDescriptors. |
|
RecordDescriptor(java.lang.String name,
char typeSpec,
int numAttr)
Constructs a named uni-type RecordDescriptor of a specified length The type is determined by the first argument, the number of fields by the second. |
|
RecordDescriptor(java.lang.String name,
java.lang.String typeSpec)
Constructs a named RecordDescriptor from a String in which each character identifies a field and its type. |
|
RecordDescriptor(java.lang.String name,
TypeTable types,
AttributeDescriptor[] attrs)
Constructs a named RecordDescriptor from an array of AttributeDescriptors, referring to the given TypeTable. |
|
RecordDescriptor(TypeTable types,
AttributeDescriptor[] attrs)
Constructs an unnamed RecordDescriptor from an array of AttributeDescriptors, referring to the given TypeTable. |
Method Summary | |
---|---|
int[] |
attributeByteSizes()
Returns an array of integers indicating the size in bytes of the correspoding attributes in this RecordDescriptor. |
int |
byteOffset(int attributeNumber)
Return the offset of the indicated attribute from the beginning of the record. |
int[] |
byteOffsets()
Returns an array of integers indicated the byte offsets of each of the correspoding attributes in this RecordDescriptor. |
int |
byteSize()
Return the number of bytes occupied by records decribed by this descriptor. |
java.lang.Object |
clone()
Make a copy of this RecordDescriptor. |
RecordDescriptor |
copy()
Make a copy of this RecordDescriptor. |
RecordDescriptor |
create(FieldIDMapper FIDMapper)
Makes a new RecordDescriptor object from "this" RecordDescriptor and the FieldIDMapper. |
RecordDescriptor |
create(RecordSpec rs)
Makes a new RecordDescriptor object from "this" RecordDescriptor and the RecordSpec. |
protected static AttributeDescriptor[] |
createAttrDescriptorArray(char typeSpec,
int numAttr)
Create an array of AttributeDescriptors whose types are identified by a single char argument indicating type and an attr count. |
protected static AttributeDescriptor[] |
createAttrDescriptorArray(java.lang.String typeSpec)
Create an array of AttributeDescriptors whose types are identified by the individual characters in the argument String. |
DataBlock |
createDataBlock(ISBounds bnds)
Creates a DataBlock that would be efficient to use for this RecordDescriptor. |
DataBlock |
createDataBlock(ISBounds bnds,
FieldIDMapper fm)
Creates a DataBlock that would be efficient to use for a subset of this RecordDescriptor, based on the FieldIDMapper. |
DataBlock |
createDataBlock(ISBounds bnds,
RecordSpec rs)
Creates a DataBlock that would be efficient to use for a subset of this RecordDescriptor, based on the RecordSpec. |
Datum |
createDatum()
Returns a Datum of an appropriate type. |
Datum |
createDatum(Datum d)
Returns a Datum of an appropriate type, initialized to the values of the passed in argument Datum. |
Datum |
createDatum(Datum d,
FieldIDMapper fim)
Returns a Datum of an appropriate type, initialized to the values of the passed in argument Datum. |
Datum |
createDatum(Datum d,
RecordSpec spec)
Returns a Datum of an appropriate type, initialized to the values of the passed in argument Datum. |
Datum |
createDatum(FieldIDMapper fm)
Returns a Datum of an appropriate type. |
Datum |
createDatum(RecordSpec rs)
Returns a Datum of an appropriate type as constrained by RecordSpec. |
Values |
createValues(int numEntries)
Create a Values object of the appropriate type and size for this RecordDescriptor numEntries is the number of data points, so if there are multiple attributes there needs to be space for all of them |
boolean |
equals(java.lang.Object o)
True if the argument is equal to this AttributeDescriptor, false otherwise. |
AttributeDescriptor |
getAttribute(int i)
Return the AttributeDescriptor at the specified position. |
java.lang.String[] |
getFieldNames()
Return an array of the field names. |
java.lang.String[] |
getFieldTypes()
Return an array of the field types in string form. |
int |
getMaxAttributeByteSize()
Returns the size in bytes of the largest attribute. |
int |
getNumAttributes()
Return the number of Attributes in this collection. |
int |
getNumUsedTypes()
Return the number of distinct storage types defined by this RecordDescriptor. |
int |
getStorageType()
Return the underlying storage type for the entire record. |
int |
getStorageType(int index)
Return the storage type of an attribute at the specified position. |
int[] |
getStorageTypes()
Return an array of storage types; there is one entry per attribute. |
int |
getUsedType(int index)
Get the StorageType of the i-th distinct storage type in this RecordDescriptor. |
int |
getUsedTypeCount(int index)
Get the count of attributes of the i-th distinct storage type in this RecordDescriptor. |
int[] |
getUsedTypes()
Get the an array of all StorageTypes used in this RecordDescriptor. |
boolean |
isUserType(int index)
Return true if the attribute at the specified position is a User defined type. |
static void |
main(java.lang.String[] args)
|
protected void |
makeOffsets()
Allocate and fill in the array of byte offsets. |
protected void |
makeStorageTypeInfo()
Initialize arrays used for quick access to type information. |
java.lang.String |
name(int index)
Return the name of a attribute at the specified position. |
RecordDescriptor |
project(FieldIDMapper fm)
Returns a new RecordDescriptor with fields copied from this RecordDescriptor. |
RecordDescriptor |
project(RecordSpec rs)
Returns a new RecordDescriptor with fields copied from this RecordDescriptor. |
int |
size()
Return the number of Attributes in this collection. |
java.lang.String |
toString()
Return a String representing the object. |
java.lang.String |
toString(java.lang.String indent)
Return a String representing the object indented by the argument string. |
Methods inherited from class edu.unh.sdb.common.Type |
---|
getName |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected AttributeDescriptor[] defs
protected TypeTable types
protected int[] byteOffsets
protected int byteSize
protected java.util.ArrayList typeCounters
Constructor Detail |
---|
public RecordDescriptor(AttributeDescriptor[] attrs)
public RecordDescriptor(java.lang.String name, AttributeDescriptor[] attrs)
public RecordDescriptor(TypeTable types, AttributeDescriptor[] attrs)
public RecordDescriptor(java.lang.String name, TypeTable types, AttributeDescriptor[] attrs)
public RecordDescriptor(java.lang.String typeSpec)
public RecordDescriptor(java.lang.String name, java.lang.String typeSpec)
public RecordDescriptor(char typeSpec, int numAttr)
public RecordDescriptor(java.lang.String name, char typeSpec, int numAttr)
protected RecordDescriptor()
Method Detail |
---|
public RecordDescriptor project(FieldIDMapper fm)
public RecordDescriptor create(FieldIDMapper FIDMapper)
public RecordDescriptor create(RecordSpec rs)
public RecordDescriptor project(RecordSpec rs)
protected static AttributeDescriptor[] createAttrDescriptorArray(java.lang.String typeSpec)
protected static AttributeDescriptor[] createAttrDescriptorArray(char typeSpec, int numAttr)
protected void makeOffsets()
public RecordDescriptor copy()
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class UserType
public final int getStorageType(int index)
public final int[] getStorageTypes()
public final int getStorageType()
getStorageType
in class UserType
public final boolean isUserType(int index)
public java.lang.String[] getFieldNames()
public java.lang.String[] getFieldTypes()
public java.lang.String name(int index)
public final AttributeDescriptor getAttribute(int i)
public final int size()
public final int getNumAttributes()
public final int byteSize()
public final int byteOffset(int attributeNumber)
protected void makeStorageTypeInfo()
public int getNumUsedTypes()
public int[] getUsedTypes()
public int getUsedType(int index)
public int getUsedTypeCount(int index)
public final int getMaxAttributeByteSize()
public java.lang.String toString()
toString
in class UserType
public java.lang.String toString(java.lang.String indent)
public int[] attributeByteSizes()
public int[] byteOffsets()
public Datum createDatum()
public Datum createDatum(RecordSpec rs)
public Datum createDatum(FieldIDMapper fm)
public Datum createDatum(Datum d)
public Datum createDatum(Datum d, RecordSpec spec)
public Datum createDatum(Datum d, FieldIDMapper fim)
public Values createValues(int numEntries)
public DataBlock createDataBlock(ISBounds bnds)
public DataBlock createDataBlock(ISBounds bnds, RecordSpec rs)
public DataBlock createDataBlock(ISBounds bnds, FieldIDMapper fm)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |