Class COM.odi.util.OSTreeMapFloat

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

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

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

Additional information about OSTreeMapFloat 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 OSTreeMapFloat(Placement)
Creates an empty OSTreeMapFloat.
 o OSTreeMapFloat(Placement, boolean)
Creates an empty OSTreeMapFloat.

Method Index

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

Constructors

 o OSTreeMapFloat
  public OSTreeMapFloat(Placement placement)
Creates an empty OSTreeMapFloat. 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 OSTreeMapFloat
  public OSTreeMapFloat(Placement placement,
                        boolean export)
Creates an empty OSTreeMapFloat. 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(float 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(Float 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(float key)
Returns the value to which this Map maps the specified key. Returns null if the Map contains no mapping for this key.

Parameters:
key - key whose associated value is to be returned.
 o get
  public Object get(Float key)
Returns the value to which this Map maps the specified key. Returns null if the Map contains no mapping for this key.

Parameters:
key - key whose associated value is to be returned.
 o put
  public Object put(float 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.
 o put
  public Object put(Float 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.
 o remove
  public Object remove(float 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.
 o remove
  public Object remove(Float 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.
 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 Float key.

Overrides:
byteArrayToKey in class OSTreeMap

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