Java API v6.0

rasj
Class RasGMArray

java.lang.Object
  |
  +--rasj.odmg.RasObject
        |
        +--rasj.RasGMArray
All Implemented Interfaces:
rasj.global.RasGlobalDefs
Direct Known Subclasses:
RasMArrayByte, RasMArrayDouble, RasMArrayFloat, RasMArrayInteger, RasMArrayLong, RasMArrayShort

public class RasGMArray
extends rasj.odmg.RasObject
implements rasj.global.RasGlobalDefs

 Copyright (C) 2003 Dr. Peter Baumann

 SOURCE:  RasGMArray.java

 PACKAGE: rasj
 CLASS:   RasGMArray

 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.

Version:
$Revision: 1.26 $ CHANGE HISTORY (append further entries): when who what ---------------------------------------------------------- 31-01-2000 Beinhofer created COMMENTS:

Field Summary
 
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, rcsid, 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
RasGMArray()
          Default constructor.
RasGMArray(RasGMArray obj)
          Copy constructor.
RasGMArray(RasMInterval initDomain, long cellTypeLength)
          Constructor for uninitialized MDD objects
RasGMArray(RasMInterval initDomain, long cellTypeLength, RasStorageLayout stl)
          Constructor for uninitialized MDD objects with Storage Layout
 
Method Summary
 byte[] getArray()
          Gets the internal representation of this GMAarray (the byte array).
 long getArraySize()
          Gets the size of the internal representation of this GMArray (in bytes).
 RasBaseType getBaseTypeSchema()
          Returns the base type schema of this GMArray.
 byte[] getCell(RasPoint point)
          Reads a cell of the MDD.
 int getCurrentFormat()
          Gets the current data format (RAS_ARRAY).
 RasStorageLayout getStorageLayout()
          Returns the storage layout object of this MDD.
 long getTypeLength()
          Gets the length of cell type (in bytes).
 RasGMArray intersectionWith(RasMInterval where)
          Returns a RasGMArray that is the intersection of the current domain with the specified interval.
 void setArray(byte[] newData)
          Sets the internal representation of the GMArray.
 void setArraySize(long newValue)
          Sets the size of the internal representation (in bytes).
 void setCurrentFormat(int newFormat)
          Sets the current data format.
 void setSpatialDomain(RasMInterval dom)
          Sets the spatial domain.
 void setStorageLayout(RasStorageLayout stl)
          Sets the storage layout object and checks compatibility with the domain.
 RasGMArray setTo(RasGMArray mArray)
          This method copies the values of mArray to itself.
 void setTypeLength(long newValue)
          Sets the length of the cell type (in bytes).
 RasMInterval spatialDomain()
          Gets the spatial domain.
 java.lang.String toString()
          gets the String representation
 java.lang.String toTestString()
          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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 GMArray
cellTypeLength - The length of the cell type used

RasGMArray

public RasGMArray(RasMInterval initDomain,
                  long cellTypeLength,
                  RasStorageLayout stl)
Constructor for uninitialized MDD objects with Storage Layout

Parameters:
initDomain - The initial Domain of the GMArray
cellTypeLength - The length of the cell type used

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.
RasDimensionMismatchException
RasIndexOutOfBoundsException

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
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:
toString in class java.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

rasdaman Java API Reference

Copyright © 2003- rasdaman GmbH