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
public class RasGMArray extends RasObject implements RasGlobalDefs
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
Fields Modifier and Type Field Description protected byte[]currentCellinternal object for accessing one cell of the arrayprotected intcurrentFormatstore current data formatprotected byte[]datainternal array representation in bytesprotected longdataSizesize of internal array representation in bytesprotected RasMIntervaldomainspatial domainprotected java.lang.ObjectobjectDatainternal array representation as Object for use in special marraysprotected RasStorageLayoutstorageLayoutstorage layout objectprotected longtypeLengthlength of the cell base type in bytes-
Fields inherited from class rasj.odmg.RasObject
objectName
-
Fields 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
Constructors Constructor Description RasGMArray()Default 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getArray()Gets the internal representation of this GMAarray (the byte array).longgetArraySize()Gets the size of the internal representation of this GMArray (in bytes).RasBaseTypegetBaseTypeSchema()Returns the base type schema of this GMArray.byte[]getCell(RasPoint point)Reads a cell of the MDD.intgetCurrentFormat()Gets the current data format (RAS_ARRAY).RasStorageLayoutgetStorageLayout()Returns the storage layout object of this MDD.longgetTypeLength()Gets the length of cell type (in bytes).RasGMArrayintersectionWith(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.voidsetSpatialDomain(RasMInterval dom)Sets the spatial domain.voidsetStorageLayout(RasStorageLayout stl)Sets the storage layout object and checks compatibility with the domain.RasGMArraysetTo(RasGMArray mArray)This method copies the values of mArray to itself.voidsetTypeLength(long newValue)Sets the length of the cell type (in bytes).RasMIntervalspatialDomain()Gets the spatial domain.java.lang.StringtoString()gets the String representationjava.lang.StringtoTestString()gets the String for testing-
Methods inherited from class rasj.odmg.RasObject
getLock, getObjectName, getObjectType, getObjectTypeName, getOID, getStatus, getTypeSchema, getTypeStructure, rasDeactivate, setLock, setObjectName, setObjectType, setObjectTypeName, setOID, setStatus, setTypeStructure
-
-
-
-
Field Detail
-
domain
protected RasMInterval domain
spatial domain
-
data
protected byte[] data
internal array representation in bytes
-
objectData
protected java.lang.Object objectData
internal array representation as Object for use in special marrays
-
currentCell
protected byte[] currentCell
internal object for accessing one cell of the array
-
dataSize
protected long dataSize
size of internal array representation in bytes
-
typeLength
protected long typeLength
length of the cell base type in bytes
-
currentFormat
protected int currentFormat
store current data format
-
storageLayout
protected RasStorageLayout storageLayout
storage layout object
-
-
Constructor Detail
-
RasGMArray
public RasGMArray()
Default constructor.
-
RasGMArray
public RasGMArray(RasMInterval initDomain, long cellTypeLength)
Constructor for uninitialized MDD objects- Parameters:
initDomain- The initial Domain of the GMArraycellTypeLength- The length of the cell type used
-
RasGMArray
public RasGMArray(RasMInterval initDomain, long cellTypeLength, boolean allocateData)
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
public RasGMArray(RasMInterval initDomain, long cellTypeLength, RasStorageLayout stl)
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 usedRasStorageLayout- The storage layout to be usedallocateData- control whether to allocate the data or not
-
RasGMArray
public RasGMArray(RasGMArray obj)
Copy constructor.- Parameters:
obj- a copy of this object will be created
-
-
Method Detail
-
setTo
public RasGMArray setTo(RasGMArray mArray)
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
public final RasStorageLayout getStorageLayout()
Returns the storage layout object of this MDD.- Returns:
- the storage layout object
-
setStorageLayout
public void setStorageLayout(RasStorageLayout stl) throws RasDimensionMismatchException
Sets the storage layout object and checks compatibility with the domain.- Parameters:
stl- the new storage layout- Throws:
RasDimensionMismatchException
-
intersectionWith
public RasGMArray intersectionWith(RasMInterval where)
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
public final RasMInterval 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
public void setSpatialDomain(RasMInterval dom)
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
public java.lang.String toString()
gets the String representation- Overrides:
toStringin classjava.lang.Object
-
toTestString
public java.lang.String toTestString()
gets the String for testing
-
getBaseTypeSchema
public RasBaseType getBaseTypeSchema()
Returns the base type schema of this GMArray.- Returns:
- the base type schema
-
-