net.walend.lyophil.memory
Interface SingleValueIndex

All Known Implementing Classes:
TransientSingleValueIndex

public interface SingleValueIndex

This interface is defines methods for a SingleValueIndex, a Map from a unique index value to a single Freezable's Identifier.

Use it to create in-memory indicies to help create quicker Diggers.

Since:
20010108
Author:
David Walend

Method Summary
 void clear()
           
 boolean containsIdentifier(java.io.Serializable id)
           
 boolean containsKey(java.lang.Object key)
           
 java.io.Serializable get(java.lang.Object key)
           
 Set getKeys()
           
 boolean isEmpty()
          Returns true if this collection contains no elements.
 java.util.Iterator keyIterator()
           
 void put(java.lang.Object key, java.io.Serializable id)
          Puts the key id pair into the index.
 void remove(java.io.Serializable id)
           
 int size()
          Returns the number of elements in this collection.
 

Method Detail

size

public int size()
Returns the number of elements in this collection. If this collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.


isEmpty

public boolean isEmpty()
Returns true if this collection contains no elements.


containsKey

public boolean containsKey(java.lang.Object key)

containsIdentifier

public boolean containsIdentifier(java.io.Serializable id)

get

public java.io.Serializable get(java.lang.Object key)

put

public void put(java.lang.Object key,
                java.io.Serializable id)
         throws KeyDuplicatedException
Puts the key id pair into the index. if the id is already in the index (if the key is not in use (remove the old key and put the pair in the index) else (if the key and id are already in the index (do nothing) else (throw a KeyDuplicatedException))) else (if the key is not in use (put the pair in the index) else throw a KeyDuplicatedException)


remove

public void remove(java.io.Serializable id)

clear

public void clear()

getKeys

public Set getKeys()

keyIterator

public java.util.Iterator keyIterator()


Copyright (c) 2000, 2001, David Walend