|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.collection.util.LongHashtableCollection
public final class LongHashtableCollection
Hashtable collection using long integers as keys.
With this collection write operations occur as a map; read operations occur as a map or as a set.
Constructor Summary | ||
---|---|---|
LongHashtableCollection()
Constructs a new LongHashTableCollection instance. |
Method Summary | ||
---|---|---|
boolean |
contains(Object element)
Determines if this collection contains an element. |
|
boolean |
contains(long key)
Determines if this collection contains an element with provided long integer key. |
|
Object |
get(long key)
Retrieves element by long integer key. |
|
Enumeration |
getElements()
Retrieves an enumeration of this collection's elements. |
|
int |
getElements(Object[] elements)
Retrieves this collection's elements. |
|
long |
getKey(Object element)
Retrieves long integer key by element. |
|
LongEnumeration |
getKeys()
Retrieves an enumeration of this collection's keys. |
|
void |
put(long key,
Object element)
Assigns a key to an element, and places it in the collection. |
|
void |
remove(long key)
Removes element by key. |
|
void |
removeAll()
Removes all elements. |
|
int |
size()
Retrieves the number of elements in this collection. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LongHashtableCollection()
Method Detail |
---|
public void put(long key, Object element)
put
in interface WritableLongMap
key
- Long integer key for new element.element
- New element to add to collection.public void remove(long key)
remove
in interface WritableLongMap
key
- Key associated with element you want to retrieve.public void removeAll()
removeAll
in interface WritableLongMap
public int size()
size
in interface ReadableLongMap
size
in interface ReadableSet
public Object get(long key)
get
in interface ReadableLongMap
uid
- Key for desired element.
public long getKey(Object element)
getKey
in interface ReadableLongMap
obj
- Element for which you want the key.
public boolean contains(long key)
contains
in interface ReadableLongMap
key
- Key to locate in this collection.
public boolean contains(Object element)
contains
in interface ReadableSet
obj
- Element to look for.
public Enumeration getElements()
getElements
in interface ReadableSet
public LongEnumeration getKeys()
public int getElements(Object[] elements)
The array you provide to contain the collection's elements must be
large enough to contain them. Accordingly, you should synchronize on this
collection, invoke LongHashtableCollection.size()
, create an array of the required size,
and then invoke this method.. This ensures that the collection's size
won't change by the time you get to actually retrieving its elements.
This method also completely erases the current contents of your object array out-parameter.
getElements
in interface ReadableSet
elements
- Object array to contain returned elements; must be large
enough to retrieve this collection's elements.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.