|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AnyReadSet<V>
This interface is the common ancestor of all Jjoost sets.
The methods declared here make no assumptions about the number of occurences of a given value and declare no actions that may modify the set, so is the most general form of set. No concrete class should implement this interface directly.
WARNING: Note that in a MultiSet the iterator() method will
return an Iterator that enumerates every occurence of every value. If you want
to get unique occurences of values, call the unique() method.
Also note that an Iterator returned by concurrent implementors of this class is permitted
to return values more times than they actually ever occurred if a valid sequence of deletes and inserts happens
to cause the Iterator to see the values multiple times. See the javadoc of the implementing classes
to determine their behaviour in this case.
| Method Summary | |
|---|---|
java.lang.Iterable<V> |
all(V find)
Returns an Iterable of all values contained in the set which are equal to the parameter, as determined by the set's
definition of equality. |
boolean |
contains(V find)
Returns a boolean indicating if the parameter occurs in the set at least once. |
int |
count(V find)
Returns an integer representing the number of occurrences of the value in the set |
Equality<? super V> |
equality()
Returns an object that represents the definition of equality used by this set |
V |
first(V find)
The first value stored in the set that is equal to the provided value, as determined by any provided Equality or
Comparator. |
boolean |
isEmpty()
Indicates if the set is empty |
java.util.List<V> |
list(V find)
Returns a List of all values contained in the set which are equal to the parameter, as determined by the set's
definition of equality. |
boolean |
permitsDuplicates()
Indicates if the set permits a value to occur more than once |
int |
totalCount()
Returns the total number of values (including duplicates) in the set |
java.lang.Iterable<V> |
unique()
Returns an Iterable of only unique values in the set, as determined by
the set's definition of equality. |
int |
uniqueCount()
Returns the number of unique values in the set |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Methods inherited from interface org.jjoost.util.Function |
|---|
apply |
| Method Detail |
|---|
V first(V find)
Equality or
Comparator. Returns null if no matching item is stored in the set.
find - value to look for
java.lang.Iterable<V> all(V find)
Iterable of all values contained in the set which are equal to the parameter, as determined by the set's
definition of equality.
Changes to the set that happen prior to retrieving an Iterator from the Iterable should be reflected in the
resulting Iterator. Changes to the set once an Iterator has been obtained may or may not be reflected in
the Iterator at the discretion of the implementing class.
In a concurrent set it is acceptable for values to occur extra times if they are deleted and re-inserted in between method calls on
the Iterator.
find - value to look for
java.util.List<V> list(V find)
List of all values contained in the set which are equal to the parameter, as determined by the set's
definition of equality. This list should be constructed "eagerly" and should be a consistent snapshot of the values valid at some
point between the method being called and it returning.
find - value to look for
boolean contains(V find)
boolean indicating if the parameter occurs in the set at least once.
find - value to look for
true, if presentint count(V find)
find - value to look for
java.lang.Iterable<V> unique()
Iterable of only unique values in the set, as determined by
the set's definition of equality. This method is guaranteed not to return duplicates,
even under concurrent reads/writes of the same value in the middle of iteration.
int totalCount()
int uniqueCount()
boolean isEmpty()
boolean permitsDuplicates()
Equality<? super V> equality()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||