|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jjoost.collections.sets.base.AbstractSet<V>
org.jjoost.collections.sets.base.AbstractHashSet<V,N>
org.jjoost.collections.sets.base.InlineMultiHashSet<V,N>
public class InlineMultiHashSet<V,N extends HashNode<N> & Value<V>>
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jjoost.collections.sets.base.AbstractHashSet |
|---|
AbstractHashSet.LockFreeHashSetNode<V>, AbstractHashSet.LockFreeHashSetNodeFactory<V>, AbstractHashSet.LockFreeLinkedHashSetNode<V>, AbstractHashSet.LockFreeLinkedHashSetNodeFactory<V>, AbstractHashSet.SerialHashSetNode<V>, AbstractHashSet.SerialHashSetNodeFactory<V>, AbstractHashSet.SerialLinkedHashSetNode<V>, AbstractHashSet.SerialLinkedHashSetNodeFactory<V> |
| Constructor Summary | |
|---|---|
InlineMultiHashSet(Rehasher rehasher,
Equality<? super V> equality,
HashNodeFactory<V,N> nodeFactory,
HashStore<N> table)
|
|
| Method Summary | |
|---|---|
boolean |
add(V val)
Attempt to add the value to the set, returning false if the value could not be added, and true if it was. |
MultiSet<V> |
copy()
Returns a copy of the set. |
Equality<? super V> |
equality()
Returns an object that represents the definition of equality used by this set |
boolean |
permitsDuplicates()
Indicates if the set permits a value to occur more than once |
V |
put(V val)
Insert the value into the set. |
void |
put(V val,
int count)
Insert the value into the set the specified number of times. |
Set<V> |
unique()
Returns a Set representing only the unique values present in this set. |
int |
uniqueCount()
Returns the number of unique values in the set |
| Methods inherited from class org.jjoost.collections.sets.base.AbstractHashSet |
|---|
all, apply, capacity, clear, clearAndReturn, contains, count, first, isEmpty, iterator, list, lockFreeLinkedNodeFactory, lockFreeNodeFactory, putAll, putIfAbsent, remove, remove, removeAndReturn, removeAndReturn, removeAndReturnFirst, removeAndReturnFirst, resize, serialLinkedNodeFactory, serialNodeFactory, shrink, totalCount |
| Methods inherited from class org.jjoost.collections.sets.base.AbstractSet |
|---|
equals, equals |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jjoost.collections.AnySet |
|---|
clear, clearAndReturn, putAll, putIfAbsent, remove, remove, removeAndReturn, removeAndReturn, removeAndReturnFirst, removeAndReturnFirst, shrink |
| Methods inherited from interface org.jjoost.collections.AnyReadSet |
|---|
all, contains, count, first, isEmpty, list, totalCount |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Methods inherited from interface org.jjoost.util.Function |
|---|
apply |
| Constructor Detail |
|---|
public InlineMultiHashSet(Rehasher rehasher,
Equality<? super V> equality,
HashNodeFactory<V,N> nodeFactory,
HashStore<N> table)
| Method Detail |
|---|
public boolean add(V val)
AnySetfalse if the value could not be added, and true if it was.
In a MultiSet the return value will always be true, however in a Set it will be
false if a value equal to the one provided (as determined by the set's definition of equality) was already present. For
values inequal to null, this is equivalent to put(value) == null
add in interface AnySet<V>val - value to insert
true if the set was modified, false otherwisepublic V put(V val)
MultiSet
put in interface AnySet<V>put in interface MultiSet<V>val - the val
public void put(V val,
int count)
MultiSet
put in interface MultiSet<V>val - the valcount - the number of timespublic MultiSet<V> copy()
MultiSetMultiSet
copy in interface AnySet<V>copy in interface MultiSet<V>public boolean permitsDuplicates()
AnyReadSet
permitsDuplicates in interface AnyReadSet<V>public int uniqueCount()
AnyReadSet
uniqueCount in interface AnyReadSet<V>public Set<V> unique()
MultiSetSet representing only the unique values present in this set.
Changes to each set should be reflected in the other, however put() operations on the unique()
set are not supported.
unique in interface AnyReadSet<V>unique in interface AnySet<V>unique in interface MultiSet<V>public Equality<? super V> equality()
AnyReadSet
equality in interface AnyReadSet<V>equality in class AbstractHashSet<V,N extends HashNode<N> & Value<V>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||