com.arsdigita.bebop.util
Class SequentialMap

java.lang.Object
  extended byjava.util.AbstractMap
      extended bycom.arsdigita.util.SequentialMap
          extended bycom.arsdigita.bebop.util.SequentialMap
All Implemented Interfaces:
Map

public class SequentialMap
extends SequentialMap

A map that keeps its entries in a fixed sequence. All iterators returned by this class, for example by entrySet().iterator(), are guaranteed to return the entries in the order in which they were put in the map. This implementation allows null for both the key or the associated value for a map entry.

Almost all of the map operations, for example get or containsKey require time linear in the size of the map, making this map only suitable for small map sizes.

Version:
$Id: //core-platform/dev/src/com/arsdigita/bebop/util/SequentialMap.java#7 $
Author:
David Lutterkort

Nested Class Summary
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Field Summary
static String versionId
           
 
Constructor Summary
SequentialMap()
          Creates an empty SequentialMap.
 
Method Summary
 int findKey(Object key)
          Find an entry with the given key.
 
Methods inherited from class com.arsdigita.util.SequentialMap
clear, containsKey, containsValue, entrySet, get, get, getKey, indexOf, put, remove, size, update
 
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, keySet, putAll, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode, isEmpty, keySet, putAll, values
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

SequentialMap

public SequentialMap()
Creates an empty SequentialMap.

Method Detail

findKey

public int findKey(Object key)
Find an entry with the given key. key may be null.

Requires time linear in the size of the map

Parameters:
key - the key to find
Returns:
the index with key key or -1 if no such entry exists.


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC