| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| EmptySet | back to summary |
|---|---|
| pack-priv EmptySet() | |
| clone | back to summary |
|---|---|
| public EmptySet Overrides org. Implements org. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| contains | back to summary |
|---|---|
| public boolean contains(Object obj) Overrides org. Implements org. Doc from org. Returns true if the iterable has an element which responds true to element.equals(object).
| |
| each | back to summary |
|---|---|
| public void each(Procedure<? super T> procedure) Implements org. Doc from org. The procedure is executed for each element in the iterable. Example using a Java 8 lambda expression: people.each(person -> LOGGER.info(person.getName()));This method is a variant of InternalIterable#forEach(Procedure)
that has a signature conflict with Iterable#forEach(java..
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Implements org. Doc from org. Follows the same general contract as
| |
| forEachWith | back to summary |
|---|---|
| public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter) Overrides org. Implements org. Doc from org. The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument. Example using a Java 8 lambda:
people.forEachWith((Person person, Person other) ->
{
if (person.isRelatedTo(other))
{
LOGGER.info(person.getName());
}
}, fred);
Example using an anonymous inner class:
people.forEachWith(new Procedure2<Person, Person>()
{
public void value(Person person, Person other)
{
if (person.isRelatedTo(other))
{
LOGGER.info(person.getName());
}
}
}, fred);
| |
| forEachWithIndex | back to summary |
|---|---|
| public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure) Overrides org. Implements org. Doc from org. Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure. Example using a Java 8 lambda:
people.forEachWithIndex((Person person, int index) -> LOGGER.info("Index: " + index + " person: " + person.getName()));
Example using an anonymous inner class:
people.forEachWithIndex(new ObjectIntProcedure<Person>()
{
public void value(Person person, int index)
{
LOGGER.info("Index: " + index + " person: " + person.getName());
}
});
| |
| getFirst | back to summary |
|---|---|
| public T getFirst() Implements org. Doc from org. Returns the first element of an iterable. In the case of a List it is the element at the first index. In the case of any other Collection, it is the first element that would be returned during an iteration. If the iterable is empty, null is returned. If null is a valid element of the container, then a developer would need to check to see if the iterable is empty to validate that a null result was not due to the container being empty. The order of Sets are not guaranteed (except for TreeSets and other Ordered Set implementations), so if you use this method, the first element could be any element from the Set.
| |
| getLast | back to summary |
|---|---|
| public T getLast() Implements org. Doc from org. Returns the last element of an iterable. In the case of a List it is the element at the last index. In the case of any other Collection, it is the last element that would be returned during an iteration. If the iterable is empty, null is returned. If null is a valid element of the container, then a developer would need to check to see if the iterable is empty to validate that a null result was not due to the container being empty. The order of Sets are not guaranteed (except for TreeSets and other Ordered Set implementations), so if you use this method, the last element could be any element from the Set.
| |
| getOnly | back to summary |
|---|---|
| public T getOnly() Overrides default org. Doc from org. Returns the element if the iterable has exactly one element. Otherwise, throw
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements org. Doc from org. Follows the same general contract as
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over elements of type
| |
| max | back to summary |
|---|---|
| public T max(Comparator<? super T> comparator) Overrides org. Implements org. Doc from org. Returns the maximum element out of this container based on the comparator.
| |
| max | back to summary |
|---|---|
| public T max() Overrides org. Implements org. Doc from org. Returns the maximum element out of this container based on the natural order.
| |
| maxBy | back to summary |
|---|---|
| public <V extends Comparable Overrides org. Implements org. Doc from org. Returns the maximum elements out of this container based on the natural order of the attribute returned by Function.
| |
| min | back to summary |
|---|---|
| public T min(Comparator<? super T> comparator) Overrides org. Implements org. Doc from org. Returns the minimum element out of this container based on the comparator.
| |
| min | back to summary |
|---|---|
| public T min() Overrides org. Implements org. Doc from org. Returns the minimum element out of this container based on the natural order.
| |
| minBy | back to summary |
|---|---|
| public <V extends Comparable Overrides org. Implements org. Doc from org. Returns the minimum elements out of this container based on the natural order of the attribute returned by Function.
| |
| readResolve | back to summary |
|---|---|
| private Object readResolve() | |
| size | back to summary |
|---|---|
| public int size() Implements org. Doc from org. Returns the number of items in this iterable.
| |
| with | back to summary |
|---|---|
| public MutableSet Overrides default org. Implements org. Doc from org. This method allows fixed size collections the ability to add elements to their existing elements. A new instance
of
MutableCollection<String> list;
list = list.with("1");
list = list.with("2");
return list;
| |
| without | back to summary |
|---|---|
| public MutableSet Overrides default org. Implements org. Doc from org. This method allows fixed size collections the ability to remove elements from their existing elements. A new
instance of
MutableCollection<String> list;
list = list.without("1");
list = list.without("2");
return list;
| |
| zip | back to summary |
|---|---|
| public <S> MutableSet Overrides org. Implements org. Doc from org. Deprecated in 6.0. Use Returns a
| |
| zip | back to summary |
|---|---|
| public <S, R extends Collection Overrides org. Implements org. Doc from org. Same as
| |
| zipWithIndex | back to summary |
|---|---|
| public MutableSet Overrides org. Implements org. Doc from org. Deprecated in 6.0. Use Zips this
| |
| zipWithIndex | back to summary |
|---|---|
| public <R extends Collection Overrides org. Implements org. Doc from org. Same as
| |