Class COM.odi.util.OSTreeMapInteger
java.lang.Object
|
+----COM.odi.util.OSTreeMap
|
+----COM.odi.util.OSTreeMapInteger
- public class OSTreeMapInteger
- extends OSTreeMap
OSTreeMapInteger implements the java.util.Map interface with a persistent
B-tree. The keys are Integers, and the values are objects.
This class is included in PSE Pro, but not in PSE.
Additional information about OSTreeMapInteger
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.
-
OSTreeMapInteger(Placement)
- Creates an empty OSTreeMapInteger.
-
OSTreeMapInteger(Placement, boolean)
- Creates an empty OSTreeMapInteger.
-
byteArrayToKey(byte[])
-
Decodes a byte array encoding of a key, and returns the corresponding
Integer key.
-
containsKey(int)
- Returns true if this Map contains a mapping for the specified key.
-
containsKey(Integer)
- Returns true if this Map contains a mapping for the specified key.
-
get(int)
- Returns the value to which this Map maps the specified key.
-
get(Integer)
- Returns the value to which this Map maps the specified key.
-
keyToByteArray(Object, byte[])
-
Encodes a key into a byte array.
-
put(int, Object)
- Associates the specified value with the specified key in this Map
(optional operation).
-
put(Integer, Object)
- Associates the specified value with the specified key in this Map
(optional operation).
-
remove(int)
- Removes the mapping for this key from this Map if present (optional
operation).
-
remove(Integer)
- Removes the mapping for this key from this Map if present (optional
operation).
OSTreeMapInteger
public OSTreeMapInteger(Placement placement)
- Creates an empty OSTreeMapInteger. 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.
OSTreeMapInteger
public OSTreeMapInteger(Placement placement,
boolean export)
- Creates an empty OSTreeMapInteger. 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.
containsKey
public boolean containsKey(int 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.
containsKey
public boolean containsKey(Integer 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.
get
public Object get(int 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.
get
public Object get(Integer 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.
put
public Object put(int 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.)
put
public Object put(Integer 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.)
remove
public Object remove(int 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.)
remove
public Object remove(Integer 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.)
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
byteArrayToKey
public Object byteArrayToKey(byte key[])
- Decodes a byte array encoding of a key, and returns the corresponding
Integer key.
- Overrides:
- byteArrayToKey in class OSTreeMap
Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.