edu.unh.sdb.datasource
Class FDLDescriptor

java.lang.Object
  extended by edu.unh.sdb.datasource.FDLDescriptor
All Implemented Interfaces:
java.lang.Cloneable

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

The FDLDescriptor class holds data read from a file descriptor .fdl file The data will be read, validated and properly instantiated for use by the DataSource classes.


Field Summary
protected  AxisOrdering axisOrdering
          Declares the axis axisOrdering
protected  ISBounds bounds
          Denotes extent of Index Space
protected  IndexSpaceID chunkDimensions
          Denotes the chunk (partition) dimensions
protected  java.lang.String dataFileType
          Declares the file type
protected  java.lang.String dataFileURL
          Declares the file name (URL) where the data is located
protected  java.nio.ByteOrder endianness
           
protected  java.lang.String fdlFileRoot
          directory of fdl file used to create this descriptor (if created by file)
protected  java.util.Vector fieldNames
          Declares a vector to hold the field name strings
protected  java.util.Vector fieldTypes
          Declares a vector to hold the field type strings
protected  long fileOffset
          Declares the file offset
protected  int recordSize
          Declares the record size
 
Constructor Summary
FDLDescriptor()
          Default Constructor sets the bounds and recordDesc members to default values.
FDLDescriptor(RecordDescriptor rd, ISBounds bnds, AxisOrdering axes)
          Create an FDLDescriptor from a RecordDescriptor, Bounds, and AxisOrdering.
 
Method Summary
 void addFieldName(java.lang.String n)
          Adds a field name to the current record descriptor
 void addFieldType(java.lang.String t)
          Adds a field type to the current record descriptor
 java.lang.Object clone()
          Create a clone of this object
static FDLDescriptor create(java.lang.String fdlFileName)
          Factory method pattern to create.
 AxisOrdering getAxisOrdering()
          Returns the axisOrdering
 ISBounds getBounds()
          Returns the bounds of the Index Space for this FDLDescriptor.
 java.nio.ByteOrder getByteOrder()
          Returns a ByteOrder indicating whether the file byte order is bigendian.
 IndexSpaceID getChunkDimensions()
           
 java.lang.String getDataFileString()
          Returns the file specification string for this FDLDescriptor as a String.
 java.lang.String getDataFileType()
          Returns the DataFile Type as a string
 java.lang.String getDataFileURL()
          Returns the file URL for this FDLDescriptor as a String.
 int getDim()
          Returns the the dimensionality for this FDLDescriptor as an int
 int getFieldLayout()
          Returns a boolean if Point Order has been selected
 long getFileOffset()
          Returns the file offset
 int getNumberOfFields()
          Returns the number of fields in a record descriptor as an integer
 RecordDescriptor getRecordDescriptor()
          generate a record descriptor using the fieldNames and fieldTypes vectors if there are no field names/types, then an empty RecordDescriptor will be returned
 int getRecordSize()
          Returns the Record Size as an integer(not used)
 java.lang.String getRootDirectory()
          Return the directory that is considered to the 'root' directory for searching for the data file.
 boolean isBigEndian()
           
 boolean isChunkedFileFormat()
           
 void setAxisOrdering(AxisOrdering axisOrdering)
          Sets the axisOrdering
 void setBounds(ISBounds bounds)
          Sets the Index Space bounds
 void setByteOrder(java.nio.ByteOrder endianness)
          Tell the FDLDescriptor the byte order for the file.
 void setChunkDimensions(IndexSpaceID id)
           
 void setDataFileType(java.lang.String dfType)
          Sets the DataFile Type as a String
 void setDataFileURL(java.lang.String dfURL)
          Sets the URL of the XML input file
 void setFieldLayout(int fieldLayout)
          Sets the attribute format.
 void setFileFormat(boolean chunkedFileFormat)
           
 void setFileOffset(long fileOffset)
          Sets the file offset
 void setRecordSize(int rs)
          Sets the Record Size (not used)
 void setRootDirectory(java.lang.String newRoot)
          Set the root directory for searching for the data file.
 java.lang.String toString()
          Returns a String representation of this class
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fdlFileRoot

protected java.lang.String fdlFileRoot
directory of fdl file used to create this descriptor (if created by file)


bounds

protected ISBounds bounds
Denotes extent of Index Space


chunkDimensions

protected IndexSpaceID chunkDimensions
Denotes the chunk (partition) dimensions


dataFileURL

protected java.lang.String dataFileURL
Declares the file name (URL) where the data is located


dataFileType

protected java.lang.String dataFileType
Declares the file type


recordSize

protected int recordSize
Declares the record size


fieldNames

protected java.util.Vector fieldNames
Declares a vector to hold the field name strings


fieldTypes

protected java.util.Vector fieldTypes
Declares a vector to hold the field type strings


axisOrdering

protected AxisOrdering axisOrdering
Declares the axis axisOrdering


fileOffset

protected long fileOffset
Declares the file offset


endianness

protected java.nio.ByteOrder endianness
Constructor Detail

FDLDescriptor

public FDLDescriptor()
Default Constructor sets the bounds and recordDesc members to default values.


FDLDescriptor

public FDLDescriptor(RecordDescriptor rd,
                     ISBounds bnds,
                     AxisOrdering axes)
Create an FDLDescriptor from a RecordDescriptor, Bounds, and AxisOrdering. Intended for Composite datasource creation.

Method Detail

create

public static FDLDescriptor create(java.lang.String fdlFileName)
Factory method pattern to create.


clone

public java.lang.Object clone()
Create a clone of this object

Overrides:
clone in class java.lang.Object

getRootDirectory

public java.lang.String getRootDirectory()
Return the directory that is considered to the 'root' directory for searching for the data file. This is normally the directory that contains the fdl file used to create this FDLDescriptor

Returns:
fdlFile location

setRootDirectory

public void setRootDirectory(java.lang.String newRoot)
Set the root directory for searching for the data file.


getRecordDescriptor

public RecordDescriptor getRecordDescriptor()
generate a record descriptor using the fieldNames and fieldTypes vectors if there are no field names/types, then an empty RecordDescriptor will be returned


setBounds

public void setBounds(ISBounds bounds)
Sets the Index Space bounds


getBounds

public ISBounds getBounds()
Returns the bounds of the Index Space for this FDLDescriptor.


setDataFileURL

public void setDataFileURL(java.lang.String dfURL)
Sets the URL of the XML input file


getDataFileURL

public java.lang.String getDataFileURL()
Returns the file URL for this FDLDescriptor as a String. If the URL refers to a file and it is not fully qualified, we try to find it from the current working directory. if that fails we look for it beginning at the location of the fdl file; if we find it there, we return the full path name, otherwise we return the original url. Currently, this does not truly support real URLs.


getDataFileString

public java.lang.String getDataFileString()
Returns the file specification string for this FDLDescriptor as a String. No checks are made.


setDataFileType

public void setDataFileType(java.lang.String dfType)
Sets the DataFile Type as a String


getDataFileType

public java.lang.String getDataFileType()
Returns the DataFile Type as a string


setRecordSize

public void setRecordSize(int rs)
Sets the Record Size (not used)


getRecordSize

public int getRecordSize()
Returns the Record Size as an integer(not used)


getDim

public int getDim()
Returns the the dimensionality for this FDLDescriptor as an int


addFieldName

public void addFieldName(java.lang.String n)
Adds a field name to the current record descriptor


addFieldType

public void addFieldType(java.lang.String t)
Adds a field type to the current record descriptor


setFieldLayout

public void setFieldLayout(int fieldLayout)
Sets the attribute format. An argument value of 'true' indicates the file is in point order, while 'false' indicates attribute order.


setFileFormat

public void setFileFormat(boolean chunkedFileFormat)

setChunkDimensions

public void setChunkDimensions(IndexSpaceID id)

getFieldLayout

public int getFieldLayout()
Returns a boolean if Point Order has been selected


isChunkedFileFormat

public boolean isChunkedFileFormat()

getChunkDimensions

public IndexSpaceID getChunkDimensions()

getNumberOfFields

public int getNumberOfFields()
Returns the number of fields in a record descriptor as an integer


setAxisOrdering

public void setAxisOrdering(AxisOrdering axisOrdering)
Sets the axisOrdering


getAxisOrdering

public AxisOrdering getAxisOrdering()
Returns the axisOrdering


setFileOffset

public void setFileOffset(long fileOffset)
Sets the file offset


getFileOffset

public long getFileOffset()
Returns the file offset


getByteOrder

public java.nio.ByteOrder getByteOrder()
Returns a ByteOrder indicating whether the file byte order is bigendian.


setByteOrder

public void setByteOrder(java.nio.ByteOrder endianness)
Tell the FDLDescriptor the byte order for the file.


isBigEndian

public boolean isBigEndian()

toString

public java.lang.String toString()
Returns a String representation of this class

Overrides:
toString in class java.lang.Object