net.walend.lyophil.memory
Interface MultiValueIndex

All Known Implementing Classes:
TransientMultiValueIndex

public interface MultiValueIndex

This interface is defines methods for a MultiValueIndex, a Map from a unique index value to a set of Freezables Identifier.

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

Since:
20010110
Author:
David Walend

Method Summary
 void clear()
           
 boolean containsIdentifier(java.io.Serializable id)
           
 boolean containsKey(java.lang.Object key)
           
 int countIdentifiersForKey(java.lang.Object key)
           
 SetOfFreezables get(java.lang.Object key)
          Returns an immutable Set.
 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)
          Removes the id from the index.
 int size()
          Returns the number keys in this index
 

Method Detail

size

public int size()
Returns the number keys in this index


isEmpty

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


containsKey

public boolean containsKey(java.lang.Object key)

countIdentifiersForKey

public int countIdentifiersForKey(java.lang.Object key)

containsIdentifier

public boolean containsIdentifier(java.io.Serializable id)

get

public SetOfFreezables get(java.lang.Object key)
Returns an immutable Set.


put

public void put(java.lang.Object key,
                java.io.Serializable id)
Puts the key id pair into the index. If the key is already in the index, this method adds the id to the Set for that key. If the key is not in the index, then this method creates a Set for that key, then adds the id to it.


remove

public void remove(java.io.Serializable id)
Removes the id from the index. If this id is the last id in a Set pointed at by a key, then this method also removes the key.


clear

public void clear()

getKeys

public Set getKeys()

keyIterator

public java.util.Iterator keyIterator()


Copyright (c) 2000, 2001, David Walend