org.hypergraphdb.util
Interface HGSortedSet<E>

Type Parameters:
E -
All Superinterfaces:
java.util.Collection<E>, java.lang.Iterable<E>, java.util.Set<E>, java.util.SortedSet<E>
All Known Implementing Classes:
ArrayBasedSet, DBKeyedSortedSet, HGAtomSet, IncidenceSet, LLRBTree

public interface HGSortedSet<E>
extends java.util.SortedSet<E>

A variation of the standard SortedSet interface that offers a HGRandomAccessResult of its elements in addition to an Iterator. Also, implementations of this interface are guarantueed to be thread-safe. This guarantee has a little twist: if you call iterator, the Iterator returned is not going to be thread-safe and concurrency issues may arise if the set if being modified while the iterator is still in use. However, if you call getSearchResult (note that HGRandomAccessResult extends the Iterator interface), the resulting object will hold a read lock on the set until its close is invoked. This means that any thread trying to modify the set while there's an active search result on it will block, and this includes the thread that opened the search result.

Author:
Borislav Iordanov

Method Summary
 HGRandomAccessResult<E> getSearchResult()
           
 
Methods inherited from interface java.util.SortedSet
comparator, first, headSet, last, subSet, tailSet
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

getSearchResult

HGRandomAccessResult<E> getSearchResult()