edu.washington.biostr.sig.vault.core
Class BasicHashVault

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<DataNode>
          extended by edu.washington.biostr.sig.vault.core.DataVault
              extended by edu.washington.biostr.sig.vault.core.BasicHashVault
All Implemented Interfaces:
IdObject, Serializable, Iterable<DataNode>, Collection<DataNode>, Set<DataNode>

public class BasicHashVault
extends DataVault

A simple vault.

Author:
eider
See Also:
Serialized Form

Constructor Summary
BasicHashVault()
           
BasicHashVault(Collection<DataNode> c)
           
 
Method Summary
 boolean add(DataNode n)
           
 void clear()
           
 boolean contains(Object arg0)
           
 Set<DataNode> get(Set<DataNode> nodes, SimpleQuerySet tags)
          Get the set of nodes that contain all of the Tag's in the given set and that are contained in nodes.
The results of this will be the same as vault.get(tags).retainAll(nodes) except that this method will likely (but not necessarily be fast than the above method.
 DataNode getNode(Object key)
          Get a node from the specified key.
 boolean isEmpty()
           
 Iterator<DataNode> iterator()
          The iterator of a vault is fairly freeform.
 void lockRead()
          Lock this for reading.
 void lockWrite()
          Lock this for writing.
 boolean remove(Object arg0)
           
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] arg0)
           
 void unlockRead()
          Release this for reading.
 void unlockWrite()
          Unlock this for writing.
 
Methods inherited from class edu.washington.biostr.sig.vault.core.DataVault
addObserver, addStrongObserver, dispose, find, fireNodeAdded, fireNodeRemoved, get, getId, getParameterMap, getValues, getValues, removeObserver, replace, retag, retag, setParameter, setWriteObserver
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, retainAll
 

Constructor Detail

BasicHashVault

public BasicHashVault()

BasicHashVault

public BasicHashVault(Collection<DataNode> c)
Method Detail

unlockRead

public void unlockRead()
Description copied from class: DataVault
Release this for reading. What actually happens is implementation dependent and may be nothing. Please use like a Lock.

Specified by:
unlockRead in class DataVault

unlockWrite

public void unlockWrite()
Description copied from class: DataVault
Unlock this for writing. What actually happens is implementation dependent and may be nothing. Please use like a Lock.

Specified by:
unlockWrite in class DataVault

lockRead

public void lockRead()
Description copied from class: DataVault
Lock this for reading. What actually happens is implementation dependent and may be nothing. Please use like a Lock.

Specified by:
lockRead in class DataVault

lockWrite

public void lockWrite()
Description copied from class: DataVault
Lock this for writing. What actually happens is implementation dependent and may be nothing. Please use like a Lock.

Specified by:
lockWrite in class DataVault

iterator

public Iterator<DataNode> iterator()
Description copied from class: DataVault
The iterator of a vault is fairly freeform. It will contain the elements at the time of the method call, but any updates may or may not be reflected. Also, you should lock it with the readLock or writeLock (whichever is appropriate) before use. This however does not guarantee that the iterator will remain unchanged. And updates may trickle in (this is a by product of not requiring the lockRead and lockWrite to actually do anything).
The only real guarantee is that if you call lockRead or lockWrite before iterating, a ConcurrentModificationException will not be thrown.

Specified by:
iterator in interface Iterable<DataNode>
Specified by:
iterator in interface Collection<DataNode>
Specified by:
iterator in interface Set<DataNode>
Specified by:
iterator in class DataVault

size

public int size()
Specified by:
size in interface Collection<DataNode>
Specified by:
size in interface Set<DataNode>
Specified by:
size in class AbstractCollection<DataNode>

add

public boolean add(DataNode n)
Specified by:
add in interface Collection<DataNode>
Specified by:
add in interface Set<DataNode>
Overrides:
add in class AbstractCollection<DataNode>

get

public Set<DataNode> get(Set<DataNode> nodes,
                         SimpleQuerySet tags)
Description copied from class: DataVault
Get the set of nodes that contain all of the Tag's in the given set and that are contained in nodes.
The results of this will be the same as vault.get(tags).retainAll(nodes) except that this method will likely (but not necessarily be fast than the above method.

Specified by:
get in class DataVault
Returns:

remove

public boolean remove(Object arg0)
Specified by:
remove in interface Collection<DataNode>
Specified by:
remove in interface Set<DataNode>
Overrides:
remove in class AbstractCollection<DataNode>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<DataNode>
Specified by:
isEmpty in interface Set<DataNode>
Overrides:
isEmpty in class AbstractCollection<DataNode>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<DataNode>
Specified by:
toArray in interface Set<DataNode>
Overrides:
toArray in class AbstractCollection<DataNode>

toArray

public <T> T[] toArray(T[] arg0)
Specified by:
toArray in interface Collection<DataNode>
Specified by:
toArray in interface Set<DataNode>
Overrides:
toArray in class AbstractCollection<DataNode>

contains

public boolean contains(Object arg0)
Specified by:
contains in interface Collection<DataNode>
Specified by:
contains in interface Set<DataNode>
Overrides:
contains in class AbstractCollection<DataNode>

clear

public void clear()
Specified by:
clear in interface Collection<DataNode>
Specified by:
clear in interface Set<DataNode>
Overrides:
clear in class AbstractCollection<DataNode>

getNode

public DataNode getNode(Object key)
Description copied from class: DataVault
Get a node from the specified key.

Specified by:
getNode in class DataVault
Returns:


Copyright © 2006 University of Washington. All Rights Reserved.