Class COM.odi.util.OSTreeMapDouble

java.lang.Object
   |
   +----COM.odi.util.OSTreeMap
           |
           +----COM.odi.util.OSTreeMapDouble

public class OSTreeMapDouble
extends OSTreeMap
OSTreeMapDouble implements the java.util.Map interface with a persistent B-tree. The keys are Doubles, and the values are objects.

This class is included in PSE Pro, but not in PSE.

Additional information about OSTreeMapDouble is in the user guide.

Here are exceptions that might be thrown by many of the methods in this class:

DatabaseNotOpenException If the database containing the object is not open.

NoTransactionInProgressException If there is no transaction in progress.

ObjectNotFoundException If the object was not found, either because the object itself, its segment, or its database was destroyed.

ObjectException Ifthe object was local and was fetched in a previous transaction.

ObjectStoreException If the session implied by an argument to the call or the object the method is called on is not the same as the session associated with the current thread.

UpdateReadOnlyException If there is a readonly transaction in progress or if the database is open for readonly.


Constructor Index

 o OSTreeMapDouble(Placement)
Creates an empty OSTreeMapDouble.
 o OSTreeMapDouble(Placement, boolean)
Creates an empty OSTreeMapDouble.

Method Index

 o byteArrayToKey(byte[])
Decodes a byte array encoding of a key, and returns the corresponding Double key.
 o containsKey(Double)
Returns true if this Map contains a mapping for the specified key.
 o containsKey(double)
Returns true if this Map contains a mapping for the specified key.
 o get(double)
Returns the value to which this Map maps the specified key.
 o get(Double)
Returns the value to which this Map maps the specified key.
 o keyToByteArray(Object, byte[])
Encodes a key into a byte array.
 o put(double, Object)
Associates the specified value with the specified key in this Map (optional operation).
 o put(Double, Object)
Associates the specified value with the specified key in this Map (optional operation).
 o remove(double)
Removes the mapping for this key from this Map if present (optional operation).
 o remove(Double)
Removes the mapping for this key from this Map if present (optional operation).

Constructors

 o OSTreeMapDouble
  public OSTreeMapDouble(Placement placement)
Creates an empty OSTreeMapDouble. Note that the database containing the placement needs to be open for update and an update transaction needs to be in progress.

Parameters:
placement - The database or segment in which to create the OSTreeMap.
Returns:
The new OSTreeMap.
Throws: NoTransactionInProgressException
If no transaction is in progress.
Throws: ObjectStoreException
If the current thread is not associated with a session and there is no global session.
Throws: UpdateReadOnlyException
If there is a read-only transaction in progress or if the database is open read-only.
 o OSTreeMapDouble
  public OSTreeMapDouble(Placement placement,
                         boolean export)
Creates an empty OSTreeMapDouble. Note that the database containing the placement needs to be open for update and an update transaction needs to be in progress.

Parameters:
placement - The database or segment in which to create the OSTreeMap.
export - If true, create an exported object.
Returns:
The new OSTreeMap.
Throws: NoTransactionInProgressException
If no transaction is in progress.
Throws: ObjectStoreException
If the current thread is not associated with a session and there is no global session.
Throws: UpdateReadOnlyException
If there is a read-only transaction in progress or if the database is open read-only.

Methods

 o containsKey
  public boolean containsKey(double key)
Returns true if this Map contains a mapping for the specified key.

Parameters:
key - key whose presence in this Map is to be tested.
 o containsKey
  public boolean containsKey(Double key)
Returns true if this Map contains a mapping for the specified key.

Parameters:
key - key whose presence in this Map is to be tested.
 o get
  public Object get(double key)
Returns the value to which this Map maps the specified key. Returns null if the Map contains no mapping for this key. A return value of null does not necessarily indicate that the Map contains no mapping for the key; it's also possible that the Map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Parameters:
key - key whose associated value is to be returned.
 o get
  public Object get(Double key)
Returns the value to which this Map maps the specified key. Returns null if the Map contains no mapping for this key. A return value of null does not necessarily indicate that the Map contains no mapping for the key; it's also possible that the Map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Parameters:
key - key whose associated value is to be returned.
 o put
  public Object put(double key,
                    Object value)
Associates the specified value with the specified key in this Map (optional operation). If the Map previously contained a mapping for this key, the old value is replaced.

Parameters:
key - key with which the specified value is to be associated.
value - value to be associated with the specified key.
Returns:
previous value associated with specified key, or null if there was no mapping for key. (A null return can also indicate that the Map previously associated null with the specified key, if the implementation supports null values.)
 o put
  public Object put(Double key,
                    Object value)
Associates the specified value with the specified key in this Map (optional operation). If the Map previously contained a mapping for this key, the old value is replaced.

Parameters:
key - key with which the specified value is to be associated.
value - value to be associated with the specified key.
Returns:
previous value associated with specified key, or null if there was no mapping for key. (A null return can also indicate that the Map previously associated null with the specified key, if the implementation supports null values.)
 o remove
  public Object remove(double key)
Removes the mapping for this key from this Map if present (optional operation).

Parameters:
key - key whose mapping is to be removed from the Map.
Returns:
previous value associated with specified key, or null if there was no mapping for key. (A null return can also indicate that the Map previously associated null with the specified key, if the implementation supports null values.)
 o remove
  public Object remove(Double key)
Removes the mapping for this key from this Map if present (optional operation).

Parameters:
key - key whose mapping is to be removed from the Map.
Returns:
previous value associated with specified key, or null if there was no mapping for key. (A null return can also indicate that the Map previously associated null with the specified key, if the implementation supports null values.)
 o keyToByteArray
  public byte[] keyToByteArray(Object key,
                               byte keyEncodingBuffer[])
Encodes a key into a byte array.

Parameters:
key - key to be encoded.
keyEncodingBuffer - a byte[] to use as a buffer for the returned encoding. If this is null, or is not large enough, a new byte[] is allocated.
Overrides:
keyToByteArray in class OSTreeMap
 o byteArrayToKey
  public Object byteArrayToKey(byte key[])
Decodes a byte array encoding of a key, and returns the corresponding Double key.

Overrides:
byteArrayToKey in class OSTreeMap

Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.