java.io.Externalizable
, java.io.Serializable
, MutableShortCollection
, PrimitiveIterable
, MutableShortSet
, ShortSet
, ShortIterable
public class ShortHashSet extends AbstractShortSet implements MutableShortSet, java.io.Externalizable
Constructor | Description |
---|---|
ShortHashSet() |
|
ShortHashSet(int initialCapacity) |
|
ShortHashSet(short... elements) |
|
ShortHashSet(ShortHashSet set) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(short element) |
|
boolean |
addAll(short... source) |
|
boolean |
addAll(ShortIterable source) |
|
boolean |
allSatisfy(ShortPredicate predicate) |
Returns true if all of the elements in the ShortIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(ShortPredicate predicate) |
Returns true if any of the elements in the ShortIterable return true for the
specified predicate, otherwise returns false.
|
void |
appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end) |
Prints a string representation of this collection onto the given
Appendable . |
MutableShortSet |
asSynchronized() |
|
MutableShortSet |
asUnmodifiable() |
|
RichIterable<ShortIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
|
<V> MutableSet<V> |
collect(ShortToObjectFunction<? extends V> function) |
Returns a new collection with the results of applying the specified function on each element of the source
collection.
|
<V,R extends java.util.Collection<V>> |
collect(ShortToObjectFunction<? extends V> function,
R target) |
Same as
ShortIterable.collect(ShortToObjectFunction) , only the results are added to the target Collection. |
void |
compact() |
Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.
|
boolean |
contains(short value) |
Returns true if the value is contained in the ShortIterable, and false if it is not.
|
int |
count(ShortPredicate predicate) |
Returns a count of the number of elements in the ShortIterable that return true for the
specified predicate.
|
short |
detectIfNone(ShortPredicate predicate,
short ifNone) |
|
void |
each(ShortProcedure procedure) |
A synonym for forEach.
|
void |
forEach(ShortProcedure procedure) |
Applies the ShortProcedure to each element in the ShortIterable.
|
ShortSet |
freeze() |
Returns a frozen copy of this set.
|
int |
hashCode() |
Follows the same general contract as
Set.hashCode() . |
<T> T |
injectInto(T injectedValue,
ObjectShortToObjectFunction<? super T,? extends T> function) |
|
short |
max() |
|
short |
min() |
|
ShortHashSet |
newEmpty() |
Creates a new empty ShortHashSet.
|
static ShortHashSet |
newSet(ShortIterable source) |
|
static ShortHashSet |
newSetWith(short... source) |
|
boolean |
noneSatisfy(ShortPredicate predicate) |
Returns true if none of the elements in the ShortIterable return true for the
specified predicate, otherwise returns false.
|
void |
readExternal(java.io.ObjectInput in) |
|
ShortHashSet |
reject(ShortPredicate predicate) |
Returns a new ShortIterable with all of the elements in the ShortIterable that
return false for the specified predicate.
|
<R extends MutableShortCollection> |
reject(ShortPredicate predicate,
R target) |
Same as
ShortIterable.reject(ShortPredicate) , only the results are added to the target MutableShortCollection. |
boolean |
remove(short value) |
|
boolean |
removeAll(short... source) |
|
boolean |
removeAll(ShortIterable source) |
|
boolean |
retainAll(short... source) |
|
boolean |
retainAll(ShortIterable source) |
|
ShortHashSet |
select(ShortPredicate predicate) |
Returns a new ShortIterable with all of the elements in the ShortIterable that
return true for the specified predicate.
|
<R extends MutableShortCollection> |
select(ShortPredicate predicate,
R target) |
Same as
ShortIterable.select(ShortPredicate) , only the results are added to the target MutableShortCollection. |
MutableShortIterator |
shortIterator() |
Returns a primitive iterator that can be used to iterate over the ShortIterable in an
imperative style.
|
int |
size() |
Returns the number of items in this iterable.
|
long |
sum() |
|
short[] |
toArray() |
Converts the ShortIterable to a primitive short array.
|
ImmutableShortSet |
toImmutable() |
Returns an immutable copy of this set.
|
ShortHashSet |
with(short element) |
|
ShortHashSet |
withAll(ShortIterable elements) |
|
ShortHashSet |
without(short element) |
|
ShortHashSet |
withoutAll(ShortIterable elements) |
|
void |
writeExternal(java.io.ObjectOutput out) |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
equals
removeIf
tap
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList
public ShortHashSet()
public ShortHashSet(int initialCapacity)
public ShortHashSet(short... elements)
public ShortHashSet(ShortHashSet set)
public static ShortHashSet newSet(ShortIterable source)
public static ShortHashSet newSetWith(short... source)
public int hashCode()
ShortSet
Set.hashCode()
.hashCode
in interface ShortSet
hashCode
in class AbstractShortSet
public int size()
PrimitiveIterable
size
in interface PrimitiveIterable
public void appendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
public boolean add(short element)
add
in interface MutableShortCollection
public boolean addAll(short... source)
addAll
in interface MutableShortCollection
public boolean addAll(ShortIterable source)
addAll
in interface MutableShortCollection
public boolean remove(short value)
remove
in interface MutableShortCollection
public boolean removeAll(ShortIterable source)
removeAll
in interface MutableShortCollection
public boolean removeAll(short... source)
removeAll
in interface MutableShortCollection
public boolean retainAll(ShortIterable source)
retainAll
in interface MutableShortCollection
Collection.retainAll(Collection)
public boolean retainAll(short... source)
retainAll
in interface MutableShortCollection
Collection.retainAll(Collection)
public void clear()
clear
in interface MutableShortCollection
public ShortHashSet with(short element)
with
in interface MutableShortCollection
with
in interface MutableShortSet
public ShortHashSet without(short element)
without
in interface MutableShortCollection
without
in interface MutableShortSet
public ShortHashSet withAll(ShortIterable elements)
withAll
in interface MutableShortCollection
withAll
in interface MutableShortSet
public ShortHashSet withoutAll(ShortIterable elements)
withoutAll
in interface MutableShortCollection
withoutAll
in interface MutableShortSet
public MutableShortSet asUnmodifiable()
asUnmodifiable
in interface MutableShortCollection
asUnmodifiable
in interface MutableShortSet
public MutableShortSet asSynchronized()
asSynchronized
in interface MutableShortCollection
asSynchronized
in interface MutableShortSet
public ImmutableShortSet toImmutable()
MutableShortSet
toImmutable
in interface MutableShortCollection
toImmutable
in interface MutableShortSet
toImmutable
in interface ShortSet
public MutableShortIterator shortIterator()
ShortIterable
shortIterator
in interface MutableShortCollection
shortIterator
in interface ShortIterable
public short[] toArray()
ShortIterable
toArray
in interface ShortIterable
public boolean contains(short value)
ShortIterable
contains
in interface ShortIterable
public void forEach(ShortProcedure procedure)
ShortIterable
forEach
in interface ShortIterable
public void each(ShortProcedure procedure)
ShortIterable
each
in interface ShortIterable
public ShortHashSet select(ShortPredicate predicate)
ShortIterable
select
in interface MutableShortCollection
select
in interface MutableShortSet
select
in interface ShortIterable
select
in interface ShortSet
public <R extends MutableShortCollection> R select(ShortPredicate predicate, R target)
ShortIterable
ShortIterable.select(ShortPredicate)
, only the results are added to the target MutableShortCollection.select
in interface ShortIterable
public ShortHashSet reject(ShortPredicate predicate)
ShortIterable
reject
in interface MutableShortCollection
reject
in interface MutableShortSet
reject
in interface ShortIterable
reject
in interface ShortSet
public <R extends MutableShortCollection> R reject(ShortPredicate predicate, R target)
ShortIterable
ShortIterable.reject(ShortPredicate)
, only the results are added to the target MutableShortCollection.reject
in interface ShortIterable
public <V> MutableSet<V> collect(ShortToObjectFunction<? extends V> function)
ShortIterable
collect
in interface MutableShortCollection
collect
in interface MutableShortSet
collect
in interface ShortIterable
collect
in interface ShortSet
public <V,R extends java.util.Collection<V>> R collect(ShortToObjectFunction<? extends V> function, R target)
ShortIterable
ShortIterable.collect(ShortToObjectFunction)
, only the results are added to the target Collection.collect
in interface ShortIterable
public short detectIfNone(ShortPredicate predicate, short ifNone)
detectIfNone
in interface ShortIterable
public int count(ShortPredicate predicate)
ShortIterable
count
in interface ShortIterable
public boolean anySatisfy(ShortPredicate predicate)
ShortIterable
anySatisfy
in interface ShortIterable
public boolean allSatisfy(ShortPredicate predicate)
ShortIterable
allSatisfy
in interface ShortIterable
public boolean noneSatisfy(ShortPredicate predicate)
ShortIterable
noneSatisfy
in interface ShortIterable
public long sum()
sum
in interface ShortIterable
public short max()
max
in interface ShortIterable
public short min()
min
in interface ShortIterable
public ShortSet freeze()
MutableShortSet
freeze
in interface MutableShortSet
freeze
in interface ShortSet
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
readExternal
in interface java.io.Externalizable
java.io.IOException
public <T> T injectInto(T injectedValue, ObjectShortToObjectFunction<? super T,? extends T> function)
injectInto
in interface ShortIterable
public RichIterable<ShortIterable> chunk(int size)
ShortIterable
chunk
in interface ShortIterable
size
- the number of elements per chunkRichIterable
containing ShortIterable
s of size size
, except the last will be
truncated if the elements don't divide evenly.public ShortHashSet newEmpty()
newEmpty
in interface MutableShortCollection
newEmpty
in interface MutableShortSet
public void compact()
Copyright © 2004–2018. All rights reserved.