Package rasj
Class RasGMArray
java.lang.Object
rasj.odmg.RasObject
rasj.RasGMArray
- All Implemented Interfaces:
RasGlobalDefs
- Direct Known Subclasses:
RasMArrayByte,RasMArrayDouble,RasMArrayFloat,RasMArrayInteger,RasMArrayLong,RasMArrayShort
PURPOSE: This class represents a generic MDD in the sense that it is independent of the cell base type. The only information available is the length in bytes of the base type.More specific MDDs including base type information for more type safety are represented by a set of typed subclasses.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]internal object for accessing one cell of the arrayprotected intstore current data formatprotected byte[]internal array representation in bytesprotected longsize of internal array representation in bytesprotected RasMIntervalspatial domainprotected Objectinternal array representation as Object for use in special marraysprotected RasStorageLayoutstorage layout objectprotected longlength of the cell base type in bytesFields inherited from class rasj.odmg.RasObject
objectNameFields inherited from interface rasj.global.RasGlobalDefs
ACC_DEN_CAPABILITY_WRONG, ACC_DEN_INC_LOGIN, ACC_DEN_NO_PERMISSION, BASE_DBS_ERROR, CREATED, DATABASE_NOT_DEFINED, DB_CONN_FAILED, DB_NOT_OPEN, DELETED, DIMENSION_MISMATCH, FAST_PRE_SCALE_FACTORS, FAST_PRE_SCALE_SUFFIXES, GETFREESERVER_WAIT_INCREMENT, GETFREESERVER_WAIT_INITIAL, GUESTIDENT_DEFAULT, ILLEGAL_ULONG_VALUE, ILLEGAL_USHORT_VALUE, INDEX_OUT_OF_BOUNDS, INTERNAL_CLIENT_ERROR, INTERNAL_DL_PARSE_EXCEPTION, INVALID_OBJECT_NAME_ERROR, KEYWORD_ATYPE, KEYWORD_BTYPE, KEYWORD_CLASS, KEYWORD_CODE, KEYWORD_COLNO, KEYWORD_DIM1, KEYWORD_DIM2, KEYWORD_ERRNO, KEYWORD_HIGH, KEYWORD_INDEX, KEYWORD_INVNAME, KEYWORD_LINENO, KEYWORD_LOW, KEYWORD_METHOD, KEYWORD_TAB, KEYWORD_TOKEN, KEYWORD_TYPE, KEYWORD_URL, KEYWORD_VAL, MANAGER_BUSY, MANAGER_CONN_FAILED, MAX_GETFREESERVER_ATTEMPTS, MODIFIED, NO_ACTIVE_SERVERS, NO_STATUS, NUM_FAST_PRE_SCALE, RAS_ARRAY, RAS_AUTO_COMPRESSION, RAS_BOOLEAN, RAS_BYTE, RAS_CHAR, RAS_COLLECTION, RAS_COMPLEX1, RAS_DOUBLE, RAS_FLOAT, RAS_HDF, RAS_INT, RAS_JPEG, RAS_LONG, RAS_MARRAY, RAS_MINTERVAL, RAS_OID, RAS_PNG, RAS_POINT, RAS_RGB, RAS_SHORT, RAS_SINTERVAL, RAS_STRING, RAS_STRUCTURE, RAS_TIFF, RAS_ULONG, RAS_UNKNOWN, RAS_USHORT, RAS_ZLIB, RASJ_VERSION, RASMGRPORT_DEFAULT, READ, REQUEST_FORMAT_ERROR, RESULT_IS_NO_CELL, RESULT_IS_NO_INTERVAL, SIZE_OF_BOOLEAN, SIZE_OF_BYTE, SIZE_OF_CHAR, SIZE_OF_DOUBLE, SIZE_OF_FLOAT, SIZE_OF_INTEGER, SIZE_OF_LONG, SIZE_OF_RAS_BOOLEAN, SIZE_OF_RAS_BYTE, SIZE_OF_RAS_CHAR, SIZE_OF_RAS_DOUBLE, SIZE_OF_RAS_FLOAT, SIZE_OF_RAS_LONG, SIZE_OF_RAS_SHORT, SIZE_OF_RAS_ULONG, SIZE_OF_RAS_USHORT, SIZE_OF_SHORT, STREAM_INPUT_OVERFLOW, TRANSIENT, TYPE_INVALID, TYPE_NOT_SUPPORTED, TYPE_UNKNOWN, URL_FORMAT_ERROR, WRITE_TRANS_IN_PROGRESS -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.RasGMArray(RasGMArray obj) Copy constructor.RasGMArray(RasMInterval initDomain, long cellTypeLength) Constructor for uninitialized MDD objectsRasGMArray(RasMInterval initDomain, long cellTypeLength, boolean allocateData) Constructor for uninitialized MDD objectsRasGMArray(RasMInterval initDomain, long cellTypeLength, RasStorageLayout stl) Constructor for uninitialized MDD objects with Storage LayoutRasGMArray(RasMInterval initDomain, long cellTypeLength, RasStorageLayout stl, boolean allocateData) Constructor for uninitialized MDD objects with Storage Layout -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getArray()Gets the internal representation of this GMAarray (the byte array).final longGets the size of the internal representation of this GMArray (in bytes).Returns the base type schema of this GMArray.byte[]Reads a cell of the MDD.final intGets the current data format (RAS_ARRAY).final RasStorageLayoutReturns the storage layout object of this MDD.final longGets the length of cell type (in bytes).intersectionWith(RasMInterval where) Returns a RasGMArray that is the intersection of the current domain with the specified interval.voidsetArray(byte[] newData) Sets the internal representation of the GMArray.voidsetArraySize(long newValue) Sets the size of the internal representation (in bytes).voidsetCurrentFormat(int newFormat) Sets the current data format.voidSets the spatial domain.voidSets the storage layout object and checks compatibility with the domain.setTo(RasGMArray mArray) This method copies the values of mArray to itself.voidsetTypeLength(long newValue) Sets the length of the cell type (in bytes).final RasMIntervalGets the spatial domain.toString()gets the String representationgets the String for testingMethods inherited from class rasj.odmg.RasObject
getLock, getObjectName, getObjectType, getObjectTypeName, getOID, getStatus, getTypeSchema, getTypeStructure, rasDeactivate, setLock, setObjectName, setObjectType, setObjectTypeName, setOID, setStatus, setTypeStructure
-
Field Details
-
domain
spatial domain -
data
protected byte[] datainternal array representation in bytes -
objectData
internal array representation as Object for use in special marrays -
currentCell
protected byte[] currentCellinternal object for accessing one cell of the array -
dataSize
protected long dataSizesize of internal array representation in bytes -
typeLength
protected long typeLengthlength of the cell base type in bytes -
currentFormat
protected int currentFormatstore current data format -
storageLayout
storage layout object
-
-
Constructor Details
-
RasGMArray
public RasGMArray()Default constructor. -
RasGMArray
Constructor for uninitialized MDD objects- Parameters:
initDomain- The initial Domain of the GMArraycellTypeLength- The length of the cell type used
-
RasGMArray
Constructor for uninitialized MDD objects- Parameters:
initDomain- The initial Domain of the GMArraycellTypeLength- The length of the cell type usedallocateData- control whether to allocate the data or not
-
RasGMArray
Constructor for uninitialized MDD objects with Storage Layout- Parameters:
initDomain- The initial Domain of the GMArraycellTypeLength- The length of the cell type usedRasStorageLayout- The storage layout to be used
-
RasGMArray
public RasGMArray(RasMInterval initDomain, long cellTypeLength, RasStorageLayout stl, boolean allocateData) Constructor for uninitialized MDD objects with Storage Layout- Parameters:
initDomain- The initial Domain of the GMArraycellTypeLength- The length of the cell type usedallocateData- control whether to allocate the data or notRasStorageLayout- The storage layout to be used
-
RasGMArray
Copy constructor.- Parameters:
obj- a copy of this object will be created
-
-
Method Details
-
setTo
This method copies the values of mArray to itself.- Parameters:
mArray- the values of this MArray will be copied- Returns:
- itself (after having copied the values from mArray)
-
getCell
public byte[] getCell(RasPoint point) throws RasDimensionMismatchException, RasIndexOutOfBoundsException Reads a cell of the MDD. The cell's value is returned as a byte array, the length of which depends on the size of the base type. If you want to get the cell value as a primitive type (like integer or byte), you either have to do a cast or use the type-specific MArrays that are derived from this class.- Parameters:
point- the coordinates of the requested cell- Returns:
- a byte array representing the value of the requested cell.
- Throws:
RasDimensionMismatchExceptionRasIndexOutOfBoundsException
-
getStorageLayout
Returns the storage layout object of this MDD.- Returns:
- the storage layout object
-
setStorageLayout
Sets the storage layout object and checks compatibility with the domain.- Parameters:
stl- the new storage layout- Throws:
RasDimensionMismatchException
-
intersectionWith
Returns a RasGMArray that is the intersection of the current domain with the specified interval.- Parameters:
where- the interval that is used for the intersection- Returns:
- the result of the intersection of this GMArray with the parameter interval
-
spatialDomain
Gets the spatial domain.- Returns:
- the spatial domain of this GMArray
-
getArray
public byte[] getArray()Gets the internal representation of this GMAarray (the byte array).- Returns:
- the byte array representing this GMArray
-
getArraySize
public final long getArraySize()Gets the size of the internal representation of this GMArray (in bytes).- Returns:
- the size of this GMArray
-
getTypeLength
public final long getTypeLength()Gets the length of cell type (in bytes).- Returns:
- the cell type length
-
getCurrentFormat
public final int getCurrentFormat()Gets the current data format (RAS_ARRAY).- Returns:
- the current data format
-
setSpatialDomain
Sets the spatial domain.- Parameters:
dom- the new spatial domain of this GMArray
-
setArray
public void setArray(byte[] newData) Sets the internal representation of the GMArray.- Parameters:
newData- the new byte array representing the contents of this GMArray
-
setArraySize
public void setArraySize(long newValue) Sets the size of the internal representation (in bytes).- Parameters:
newValue- the size of the internal representation (the byte array)
-
setTypeLength
public void setTypeLength(long newValue) Sets the length of the cell type (in bytes).- Parameters:
newValue- the cell type length
-
setCurrentFormat
public void setCurrentFormat(int newFormat) Sets the current data format.- Parameters:
newFormat- the new data format
-
toString
gets the String representation -
toTestString
gets the String for testing -
getBaseTypeSchema
Returns the base type schema of this GMArray.- Returns:
- the base type schema
-