2.17.2: 2011-06-17

net.sf.basedb.util
Class Enumeration<K,V>

java.lang.Object
  extended by net.sf.basedb.util.Enumeration<K,V>
All Implemented Interfaces:
Serializable

public class Enumeration<K,V>
extends Object
implements Serializable

Version:
2.0
Author:
Nicklas
See Also:
Serialized Form
Last modified
$Date: 2010-08-13 10:50:27 +0200 (Fri, 13 Aug 2010) $

Nested Class Summary
static class Enumeration.Entry<K,V>
           
 
Field Summary
private  List<Enumeration.Entry<K,V>> entries
           
private  boolean locked
           
private static long serialVersionUID
           
 
Constructor Summary
Enumeration()
           
 
Method Summary
 int add(K key, V value)
           
 Enumeration.Entry<K,V> getEntry(int index)
           
 K getKey(int index)
           
 V getValue(int index)
           
 boolean isLocked()
           
 void lock()
           
 void remove(int index)
           
 int size()
           
 void sortKeys()
          This method will sort the enumration on the keys using Collections.sort(List, Comparator).
 void sortValues()
          This method will sort the enumration on the values using Collections.sort(List, Comparator).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

entries

private final List<Enumeration.Entry<K,V>> entries

locked

private boolean locked
Constructor Detail

Enumeration

public Enumeration()
Method Detail

isLocked

public boolean isLocked()

lock

public void lock()

size

public int size()

add

public int add(K key,
               V value)

getKey

public K getKey(int index)

getValue

public V getValue(int index)

getEntry

public Enumeration.Entry<K,V> getEntry(int index)

remove

public void remove(int index)

sortKeys

public void sortKeys()
This method will sort the enumration on the keys using Collections.sort(List, Comparator). The comparator will try to use the keys 'compareTo' method if it implements the Comparable interface otherwilse it will treat the key as a String.


sortValues

public void sortValues()
This method will sort the enumration on the values using Collections.sort(List, Comparator). The comparator will try to use the values 'compareTo' method if it implements the Comparable interface otherwilse it will treat the value as a String.


2.17.2: 2011-06-17