com.odi.util
Interface IndexMap


public interface IndexMap

An IndexMap provides a mapping from keys to values. Indexes are used by the Query class to perform query optimization, and can also be accessed directly to lookup values or iterate in index-order. A collection must implement the IndexedCollection interface to have indexes (IndexedCollection provides methods for adding, removing, and accessing the collection's indexes). Each such index implements the IndexMap interface. Note that a collection holds all of its indexes, but the indexes do not have backpointers to the collection. This class is included in PSE Pro, but not in PSE.


Method Summary
 boolean containsKey(Object key)
          Returns true if this IndexMap contains a mapping for the specified key.
 boolean duplicates()
          Returns true is this index allows duplicate keys.
 Object get(Object key)
          Returns the value to which this IndexMap maps the specified key.
 boolean isEmpty()
          Returns true if this IndexMap contains no key-value mappings.
 IndexIterator iterator()
          Returns an iterator over the IndexMap.
 IndexIterator iterator(Object startKey)
          Returns an iterator on the IndexMap, starting at the given key.
 boolean ordered()
          Returns true if this index is ordered.
 int size()
          Returns the number of key-value mappings in this IndexMap.
 

Method Detail

ordered

public boolean ordered()
Returns true if this index is ordered.


duplicates

public boolean duplicates()
Returns true is this index allows duplicate keys.


size

public int size()
Returns the number of key-value mappings in this IndexMap.


isEmpty

public boolean isEmpty()
Returns true if this IndexMap contains no key-value mappings.


containsKey

public boolean containsKey(Object key)
Returns true if this IndexMap contains a mapping for the specified key.

Parameters:
key - key whose presence in this IndexMap is to be tested.

get

public Object get(Object key)
Returns the value to which this IndexMap maps the specified key. Returns null if the IndexMap contains no mapping for this key. If there is more than one valued mapped to by this key, then one such value is returned; this method is nonetheless useful for indexes that do not have duplicate keys, and for existential queries. See iterator().

Parameters:
key - key whose associated value is to be returned.

iterator

public IndexIterator iterator()
Returns an iterator over the IndexMap.


iterator

public IndexIterator iterator(Object startKey)
Returns an iterator on the IndexMap, starting at the given key. If the IndexMap is ordered, this will return all entries starting with the given key, in their key-order. If the IndexMap is not ordered, it will return all of the entries with this key, possibly followed by some number of additional entries with other keys.



Copyright 2005 Progress Software Corporation. All rights reserved.