net.rim.device.api.collection
Interface ReadableIntMap

All Superinterfaces:
Collection
All Known Implementing Classes:
SparseList

public interface ReadableIntMap
extends Collection

Provides read access to a collection using integer values as element keys.


Method Summary
 boolean contains(int key)
          Determines if this collection contains an element with provided integer key.
 Object get(int key)
          Retrieves element by integer key.
 int getKey(Object element)
          Retrieves integer key by element.
 int size()
          Retrieves the number of elements in this collection.
 

Method Detail

size

public int size()
Retrieves the number of elements in this collection.

Returns:
Number of elements in this collection.

get

public Object get(int key)
Retrieves element by integer key.

Parameters:
key - Key for desired element.
Returns:
Element associated with the key, or null if no element associated with this key.
Since:
JDE 4.0.2

getKey

public int getKey(Object element)
Retrieves integer key by element.

Note: This operation can be linear with respect to the number of entries in the table.

Parameters:
element - Element for which you want the key.
Returns:
Key associated with your element, or -1 if no such element exists in the collection (and thus has no key).
Since:
JDE 4.0.2

contains

public boolean contains(int key)
Determines if this collection contains an element with provided integer key.

Parameters:
key - Key to locate in this collection.
Returns:
True if this key exists in this collection (has an associated element); otherwise, false.
Since:
JDE 4.0.2


Copyright 1999-2004 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.