org.jjoost.collections.base
Class SynchronizedHashStore<N extends HashNode<N>>

java.lang.Object
  extended by org.jjoost.collections.base.SynchronizedHashStore<N>
All Implemented Interfaces:
java.io.Serializable, HashStore<N>

public class SynchronizedHashStore<N extends HashNode<N>>
extends java.lang.Object
implements HashStore<N>

See Also:
Serialized Form

Constructor Summary
SynchronizedHashStore(HashStore<N> delegate)
           
 
Method Summary
<NCmp,V> java.util.Iterator<V>
all(Function<? super N,? extends NCmp> nodeEqualityProj, HashNodeEquality<? super NCmp,? super N> nodeEquality, Function<? super N,? extends V> ret)
           
 int capacity()
           
 int clear()
           
<V> java.util.Iterator<V>
clearAndReturn(Function<? super N,? extends V> f)
           
<NCmp> boolean
contains(int hash, NCmp find, HashNodeEquality<? super NCmp,? super N> eq)
           
<NCmp> HashStore<N>
copy(Function<? super N,? extends NCmp> nodeEqualityProj, HashNodeEquality<? super NCmp,? super N> nodeEquality)
           
<NCmp> int
count(int hash, NCmp find, HashNodeEquality<? super NCmp,? super N> eq)
           
<NCmp,V> V
ensureAndGet(int hash, NCmp put, HashNodeEquality<? super NCmp,? super N> eq, HashNodeFactory<? super NCmp,N> factory, Function<? super N,? extends V> ret)
           
<NCmp,NCmp2,V>
java.util.Iterator<V>
find(int hash, NCmp find, HashNodeEquality<? super NCmp,? super N> findEq, Function<? super N,? extends NCmp2> nodeEqualityProj, HashNodeEquality<? super NCmp2,? super N> nodeEq, Function<? super N,? extends V> ret)
           
<NCmp,V> java.util.List<V>
findNow(int hash, NCmp find, HashNodeEquality<? super NCmp,? super N> findEq, Function<? super N,? extends V> ret)
           
<NCmp,V> V
first(int hash, NCmp find, HashNodeEquality<? super NCmp,? super N> eq, Function<? super N,? extends V> ret)
           
 boolean isEmpty()
           
<NCmp,V> V
put(NCmp find, N put, HashNodeEquality<? super NCmp,? super N> eq, Function<? super N,? extends V> ret)
           
<NCmp,V> V
putIfAbsent(int hash, NCmp put, HashNodeEquality<? super NCmp,? super N> eq, HashNodeFactory<? super NCmp,N> factory, Function<? super N,? extends V> ret)
           
<NCmp,V> V
putIfAbsent(NCmp find, N put, HashNodeEquality<? super NCmp,? super N> eq, Function<? super N,? extends V> ret)
           
<NCmp> int
remove(int hash, int removeAtMost, NCmp find, HashNodeEquality<? super NCmp,? super N> eq)
           
<NCmp,V> java.lang.Iterable<V>
removeAndReturn(int hash, int removeAtMost, NCmp find, HashNodeEquality<? super NCmp,? super N> eq, Function<? super N,? extends V> ret)
           
<NCmp,V> V
removeAndReturnFirst(int hash, int removeAtMost, NCmp find, HashNodeEquality<? super NCmp,? super N> eq, Function<? super N,? extends V> ret)
           
<NCmp> boolean
removeNode(Function<? super N,? extends NCmp> nodePrefixEqFunc, HashNodeEquality<? super NCmp,? super N> nodePrefixEq, N n)
           
 void resize(int size)
           
 void shrink()
           
 int totalCount()
           
<NCmp,NCmp2,V>
java.util.Iterator<V>
unique(Function<? super N,? extends NCmp> uniquenessEqualityProj, Equality<? super NCmp> uniquenessEquality, Function<? super N,? extends NCmp2> nodeEqualityProj, HashNodeEquality<? super NCmp2,? super N> nodeEquality, Function<? super N,? extends V> ret)
           
 int uniquePrefixCount()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronizedHashStore

public SynchronizedHashStore(HashStore<N> delegate)
Method Detail

all

public <NCmp,V> java.util.Iterator<V> all(Function<? super N,? extends NCmp> nodeEqualityProj,
                                          HashNodeEquality<? super NCmp,? super N> nodeEquality,
                                          Function<? super N,? extends V> ret)
Specified by:
all in interface HashStore<N extends HashNode<N>>

clear

public int clear()
Specified by:
clear in interface HashStore<N extends HashNode<N>>

clearAndReturn

public <V> java.util.Iterator<V> clearAndReturn(Function<? super N,? extends V> f)
Specified by:
clearAndReturn in interface HashStore<N extends HashNode<N>>

contains

public <NCmp> boolean contains(int hash,
                               NCmp find,
                               HashNodeEquality<? super NCmp,? super N> eq)
Specified by:
contains in interface HashStore<N extends HashNode<N>>

copy

public <NCmp> HashStore<N> copy(Function<? super N,? extends NCmp> nodeEqualityProj,
                                HashNodeEquality<? super NCmp,? super N> nodeEquality)
Specified by:
copy in interface HashStore<N extends HashNode<N>>

count

public <NCmp> int count(int hash,
                        NCmp find,
                        HashNodeEquality<? super NCmp,? super N> eq)
Specified by:
count in interface HashStore<N extends HashNode<N>>

ensureAndGet

public <NCmp,V> V ensureAndGet(int hash,
                               NCmp put,
                               HashNodeEquality<? super NCmp,? super N> eq,
                               HashNodeFactory<? super NCmp,N> factory,
                               Function<? super N,? extends V> ret)
Specified by:
ensureAndGet in interface HashStore<N extends HashNode<N>>

find

public <NCmp,NCmp2,V> java.util.Iterator<V> find(int hash,
                                                 NCmp find,
                                                 HashNodeEquality<? super NCmp,? super N> findEq,
                                                 Function<? super N,? extends NCmp2> nodeEqualityProj,
                                                 HashNodeEquality<? super NCmp2,? super N> nodeEq,
                                                 Function<? super N,? extends V> ret)
Specified by:
find in interface HashStore<N extends HashNode<N>>

findNow

public <NCmp,V> java.util.List<V> findNow(int hash,
                                          NCmp find,
                                          HashNodeEquality<? super NCmp,? super N> findEq,
                                          Function<? super N,? extends V> ret)
Specified by:
findNow in interface HashStore<N extends HashNode<N>>

first

public <NCmp,V> V first(int hash,
                        NCmp find,
                        HashNodeEquality<? super NCmp,? super N> eq,
                        Function<? super N,? extends V> ret)
Specified by:
first in interface HashStore<N extends HashNode<N>>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface HashStore<N extends HashNode<N>>

put

public <NCmp,V> V put(NCmp find,
                      N put,
                      HashNodeEquality<? super NCmp,? super N> eq,
                      Function<? super N,? extends V> ret)
Specified by:
put in interface HashStore<N extends HashNode<N>>

putIfAbsent

public <NCmp,V> V putIfAbsent(int hash,
                              NCmp put,
                              HashNodeEquality<? super NCmp,? super N> eq,
                              HashNodeFactory<? super NCmp,N> factory,
                              Function<? super N,? extends V> ret)
Specified by:
putIfAbsent in interface HashStore<N extends HashNode<N>>

putIfAbsent

public <NCmp,V> V putIfAbsent(NCmp find,
                              N put,
                              HashNodeEquality<? super NCmp,? super N> eq,
                              Function<? super N,? extends V> ret)
Specified by:
putIfAbsent in interface HashStore<N extends HashNode<N>>

remove

public <NCmp> int remove(int hash,
                         int removeAtMost,
                         NCmp find,
                         HashNodeEquality<? super NCmp,? super N> eq)
Specified by:
remove in interface HashStore<N extends HashNode<N>>

removeAndReturn

public <NCmp,V> java.lang.Iterable<V> removeAndReturn(int hash,
                                                      int removeAtMost,
                                                      NCmp find,
                                                      HashNodeEquality<? super NCmp,? super N> eq,
                                                      Function<? super N,? extends V> ret)
Specified by:
removeAndReturn in interface HashStore<N extends HashNode<N>>

removeAndReturnFirst

public <NCmp,V> V removeAndReturnFirst(int hash,
                                       int removeAtMost,
                                       NCmp find,
                                       HashNodeEquality<? super NCmp,? super N> eq,
                                       Function<? super N,? extends V> ret)
Specified by:
removeAndReturnFirst in interface HashStore<N extends HashNode<N>>

removeNode

public <NCmp> boolean removeNode(Function<? super N,? extends NCmp> nodePrefixEqFunc,
                                 HashNodeEquality<? super NCmp,? super N> nodePrefixEq,
                                 N n)
Specified by:
removeNode in interface HashStore<N extends HashNode<N>>

resize

public void resize(int size)
Specified by:
resize in interface HashStore<N extends HashNode<N>>

shrink

public void shrink()
Specified by:
shrink in interface HashStore<N extends HashNode<N>>

totalCount

public int totalCount()
Specified by:
totalCount in interface HashStore<N extends HashNode<N>>

capacity

public int capacity()
Specified by:
capacity in interface HashStore<N extends HashNode<N>>

unique

public <NCmp,NCmp2,V> java.util.Iterator<V> unique(Function<? super N,? extends NCmp> uniquenessEqualityProj,
                                                   Equality<? super NCmp> uniquenessEquality,
                                                   Function<? super N,? extends NCmp2> nodeEqualityProj,
                                                   HashNodeEquality<? super NCmp2,? super N> nodeEquality,
                                                   Function<? super N,? extends V> ret)
Specified by:
unique in interface HashStore<N extends HashNode<N>>

uniquePrefixCount

public int uniquePrefixCount()
Specified by:
uniquePrefixCount in interface HashStore<N extends HashNode<N>>