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