Top Description Inners Fields Constructors Methods
com.sun.javafx.css

public abstract sealed Class FixedCapacitySet<T>

extends AbstractSet<T>
permits FixedCapacitySet.Single<T>, FixedCapacitySet.Duo<T>, FixedCapacitySet.Hashless<T>, FixedCapacitySet.OpenAddressed<T>
Class Inheritance
Known Direct Subclasses
com.sun.javafx.css.FixedCapacitySet.Single, com.sun.javafx.css.FixedCapacitySet.Duo, com.sun.javafx.css.FixedCapacitySet.Hashless, com.sun.javafx.css.FixedCapacitySet.OpenAddressed
Type Parameters
<T>
the element type
Imports
java.util.AbstractSet, .Collection, .Iterator, .NoSuchElementException, .Objects

Provides set implementations which have a fixed capacity. These are highly optimized and only suitable for very specific use cases where the maximum size is known in advance and when items are expected to never be removed from the sets. Fixed capacity sets will throw IllegalStateException if adding an element would exceed the maximum capacity.

These sets do not allow null elements, and unless otherwise specified, passing null for any argument will result in a NullPointerException.

Specifically, these sets are optimized for holding sets of style class names, which have the following characteristics:

The provided implementations are optimized for memory use, fast containsAll and fast iteration. Generally, these sets will use half the memory of an equivalent HashSet (and comparable to the immutable sets provided by Set.of()) as they do not require a wrapper to hold each element.

These sets can only be appended, reject nulls, have a fixed maximum size (which will throw an exception if exceeded), and can be frozen (made read-only without using a wrapper).

The fall back set implementation for large sets uses open addressing. It is only lightly optimized as the expectation is that it will see little to no use. It is still preferred over HashSet due to its low memory foot print, and faster iteration.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
FixedCapacitySet.Duo<
the element type
T
>

A set that can hold 0, 1 or 2 elements.

private static class
FixedCapacitySet.Hashless<
the element type
T
>

A set which can hold a fixed maximum number of elements.

private static class
FixedCapacitySet.OpenAddressed<
the element type
T
>

A set which can hold a fixed maximum number of elements.

private static class
FixedCapacitySet.Single<
the element type
T
>

A set that can hold 0 or 1 elements.

Field Summary

Modifier and TypeField and Description
private static final FixedCapacitySet<?>
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static <T> FixedCapacitySet<T>
protected final void
ensureNotFrozen()

Checks if the set is allowed to be mutated, and throws an UnsupportedOperationException otherwise.

public final void
freeze()

Freezes this collection, turning it permanently read-only.

public abstract boolean

Returns:

true if the given collection contains all elements of this collection, otherwise false
isSuperSetOf
(Collection<?>
a collection to check, cannot be null
c
)

Checks if the given collection contains all elements of this collection.

public static <
the element type
T
>
FixedCapacitySet<T>

Returns:

a new empty set, never null
of
(int
the maximum possible number of elements the set can hold, cannot be negative
maximumCapacity
)

Hides java.util.Set.of.

Creates a new FixedCapacitySet with the given maximum capacity.

Inherited from java.util.AbstractSet:
equalshashCoderemoveAll

Field Detail

EMPTYback to summary
private static final FixedCapacitySet<?> EMPTY
frozenback to summary
private boolean frozen

Constructor Detail

FixedCapacitySetback to summary
public FixedCapacitySet()

Method Detail

emptyback to summary
private static <T> FixedCapacitySet<T> empty()
Annotations
@SuppressWarnings:unchecked
ensureNotFrozenback to summary
protected final void ensureNotFrozen()

Checks if the set is allowed to be mutated, and throws an UnsupportedOperationException otherwise.

freezeback to summary
public final void freeze()

Freezes this collection, turning it permanently read-only. After freezing, any method that would modify the collection will instead throw UnsupportedOperationException.

This can be used to avoid wrapping the collection with an unmodifiable collection or making a read-only copy.

isSuperSetOfback to summary
public abstract boolean isSuperSetOf(Collection<?> c)

Checks if the given collection contains all elements of this collection. This is the same as containsAll(Collection) with the source and target reversed, ie. "a.containsAll(b)" is equivalent to "b.isSuperSetOf(a)".

If the given collection is small, or has good contains(Object) performance, using this inverse function avoids creating an Iterator for this collection.

Parameters
c:Collection<?>

a collection to check, cannot be null

Returns:boolean

true if the given collection contains all elements of this collection, otherwise false

ofback to summary
public static <T> FixedCapacitySet<T> of(int maximumCapacity)

Hides java.util.Set.of.

Creates a new FixedCapacitySet with the given maximum capacity. If the capacity is exceeded, fixed capacity sets do not grow, but instead throw an IllegalStateException.

Parameters
<T>
the element type
maximumCapacity:int

the maximum possible number of elements the set can hold, cannot be negative

Returns:FixedCapacitySet<T>

a new empty set, never null

com.sun.javafx.css back to summary

private final Class FixedCapacitySet.Duo<T>

extends FixedCapacitySet<T>
Class Inheritance
Type Parameters
<T>
the element type

A set that can hold 0, 1 or 2 elements.

Field Summary

Modifier and TypeField and Description
private T
private T
private int

Constructor Summary

AccessConstructor and Description
private
Duo()

Method Summary

Modifier and TypeMethod and Description
public boolean
add(T
element to be added to this set
e
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Adds the specified element to this set if it is not already present (optional operation).

public boolean
contains(Object
element whose presence in this set is to be tested
o
)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Returns true if this set contains the specified element.

public int
hashCode()

Overrides java.util.AbstractSet.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Returns the hash code value for this set.

public boolean
isSuperSetOf(Collection<?>
a collection to check, cannot be null
c
)

Implements abstract com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Checks if the given collection contains all elements of this collection.

public Iterator<T>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Returns the number of elements in this set (its cardinality).

Inherited from com.sun.javafx.css.FixedCapacitySet:
ensureNotFrozenfreezeof

Field Detail

element1back to summary
private T element1
element2back to summary
private T element2
sizeback to summary
private int size

Constructor Detail

Duoback to summary
private Duo()

Method Detail

addback to summary
public boolean add(T e)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Doc from java.util.Set.add.

Adds the specified element to this set if it is not already present (optional operation). More formally, adds the specified element e to this set if the set contains no element e2 such that Objects.equals(e, e2). If this set already contains the element, the call leaves the set unchanged and returns false. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements.

The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including null, and throw an exception, as described in the specification for Collection.add. Individual set implementations should clearly document any restrictions on the elements that they may contain.

Parameters
e:T

element to be added to this set

Returns:boolean

true if this set did not already contain the specified element

Annotations
@Override
containsback to summary
public boolean contains(Object o)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Doc from java.util.Set.contains.

Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that Objects.equals(o, e).

Parameters
o:Object

element whose presence in this set is to be tested

Returns:boolean

true if this set contains the specified element

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.util.AbstractSet.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Doc from java.util.AbstractSet.hashCode.

Returns the hash code value for this set. The hash code of a set is defined to be the sum of the hash codes of the elements in the set, where the hash code of a null element is defined to be zero. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two sets s1 and s2, as required by the general contract of Object#hashCode.

This implementation iterates over the set, calling the hashCode method on each element in the set, and adding up the results.

Returns:int

the hash code value for this set

Annotations
@Override
isSuperSetOfback to summary
public boolean isSuperSetOf(Collection<?> c)

Implements abstract com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Doc from com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Checks if the given collection contains all elements of this collection. This is the same as containsAll(Collection) with the source and target reversed, ie. "a.containsAll(b)" is equivalent to "b.isSuperSetOf(a)".

If the given collection is small, or has good contains(Object) performance, using this inverse function avoids creating an Iterator for this collection.

Parameters
c:Collection<?>

a collection to check, cannot be null

Returns:boolean

true if the given collection contains all elements of this collection, otherwise false

Annotations
@Override
iteratorback to summary
public Iterator<T> iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:Iterator<T>

an iterator over the elements in this set

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Doc from java.util.Set.size.

Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this set (its cardinality)

Annotations
@Override
com.sun.javafx.css back to summary

private final Class FixedCapacitySet.Hashless<T>

extends FixedCapacitySet<T>
Class Inheritance
Type Parameters
<T>
the element type

A set which can hold a fixed maximum number of elements. This implementation does not use hashing, but does eliminate duplicates (as per the set contract). Performance is better than sets which use hashing when the number of elements is small enough (cut off point is somewhere around 10 elements, but it will depend on the cost of the hash function).

Field Summary

Modifier and TypeField and Description
private final T[]
private int

Constructor Summary

AccessConstructor and Description
private
Hashless(int capacity)

Method Summary

Modifier and TypeMethod and Description
public boolean
add(T
element to be added to this set
e
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Adds the specified element to this set if it is not already present (optional operation).

public boolean
contains(Object
element whose presence in this set is to be tested
o
)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Returns true if this set contains the specified element.

public int
hashCode()

Overrides java.util.AbstractSet.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Returns the hash code value for this set.

public boolean
isSuperSetOf(Collection<?>
a collection to check, cannot be null
c
)

Implements abstract com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Checks if the given collection contains all elements of this collection.

public Iterator<T>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Returns the number of elements in this set (its cardinality).

Inherited from com.sun.javafx.css.FixedCapacitySet:
ensureNotFrozenfreezeof

Field Detail

elementsback to summary
private final T[] elements
sizeback to summary
private int size

Constructor Detail

Hashlessback to summary
private Hashless(int capacity)
Annotations
@SuppressWarnings:unchecked

Method Detail

addback to summary
public boolean add(T e)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Doc from java.util.Set.add.

Adds the specified element to this set if it is not already present (optional operation). More formally, adds the specified element e to this set if the set contains no element e2 such that Objects.equals(e, e2). If this set already contains the element, the call leaves the set unchanged and returns false. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements.

The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including null, and throw an exception, as described in the specification for Collection.add. Individual set implementations should clearly document any restrictions on the elements that they may contain.

Parameters
e:T

element to be added to this set

Returns:boolean

true if this set did not already contain the specified element

Annotations
@Override
containsback to summary
public boolean contains(Object o)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Doc from java.util.Set.contains.

Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that Objects.equals(o, e).

Parameters
o:Object

element whose presence in this set is to be tested

Returns:boolean

true if this set contains the specified element

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.util.AbstractSet.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Doc from java.util.AbstractSet.hashCode.

Returns the hash code value for this set. The hash code of a set is defined to be the sum of the hash codes of the elements in the set, where the hash code of a null element is defined to be zero. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two sets s1 and s2, as required by the general contract of Object#hashCode.

This implementation iterates over the set, calling the hashCode method on each element in the set, and adding up the results.

Returns:int

the hash code value for this set

Annotations
@Override
isSuperSetOfback to summary
public boolean isSuperSetOf(Collection<?> c)

Implements abstract com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Doc from com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Checks if the given collection contains all elements of this collection. This is the same as containsAll(Collection) with the source and target reversed, ie. "a.containsAll(b)" is equivalent to "b.isSuperSetOf(a)".

If the given collection is small, or has good contains(Object) performance, using this inverse function avoids creating an Iterator for this collection.

Parameters
c:Collection<?>

a collection to check, cannot be null

Returns:boolean

true if the given collection contains all elements of this collection, otherwise false

Annotations
@Override
iteratorback to summary
public Iterator<T> iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:Iterator<T>

an iterator over the elements in this set

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Doc from java.util.Set.size.

Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this set (its cardinality)

Annotations
@Override
com.sun.javafx.css back to summary

private final Class FixedCapacitySet.OpenAddressed<T>

extends FixedCapacitySet<T>
Class Inheritance
Type Parameters
<T>
the element type

A set which can hold a fixed maximum number of elements. This implementation uses open addressing to handle hash collisions using linear probing. It has a memory footprint which is much smaller than an equivalent HashSet but has worse worst case performance (for modification and contains) when there are many collisions. Iteration speed will be similar to other array based collections (which is to say, faster than HashSet).

Field Summary

Modifier and TypeField and Description
private final T[]
private final int
private final int
private int

Constructor Summary

AccessConstructor and Description
private
OpenAddressed(int capacity)

Method Summary

Modifier and TypeMethod and Description
public boolean
add(T
element to be added to this set
e
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Adds the specified element to this set if it is not already present (optional operation).

public boolean
contains(Object
element whose presence in this set is to be tested
o
)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Returns true if this set contains the specified element.

private int
public int
hashCode()

Overrides java.util.AbstractSet.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Returns the hash code value for this set.

public boolean
isSuperSetOf(Collection<?>
a collection to check, cannot be null
c
)

Implements abstract com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Checks if the given collection contains all elements of this collection.

public Iterator<T>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Returns the number of elements in this set (its cardinality).

Inherited from com.sun.javafx.css.FixedCapacitySet:
ensureNotFrozenfreezeof

Field Detail

elementsback to summary
private final T[] elements
maskback to summary
private final int mask
requestedCapacityback to summary
private final int requestedCapacity
sizeback to summary
private int size

Constructor Detail

OpenAddressedback to summary
private OpenAddressed(int capacity)
Annotations
@SuppressWarnings:unchecked

Method Detail

addback to summary
public boolean add(T e)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Doc from java.util.Set.add.

Adds the specified element to this set if it is not already present (optional operation). More formally, adds the specified element e to this set if the set contains no element e2 such that Objects.equals(e, e2). If this set already contains the element, the call leaves the set unchanged and returns false. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements.

The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including null, and throw an exception, as described in the specification for Collection.add. Individual set implementations should clearly document any restrictions on the elements that they may contain.

Parameters
e:T

element to be added to this set

Returns:boolean

true if this set did not already contain the specified element

Annotations
@Override
containsback to summary
public boolean contains(Object o)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Doc from java.util.Set.contains.

Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that Objects.equals(o, e).

Parameters
o:Object

element whose presence in this set is to be tested

Returns:boolean

true if this set contains the specified element

Annotations
@Override
determineBucketIndexback to summary
private int determineBucketIndex(Object o)
hashCodeback to summary
public int hashCode()

Overrides java.util.AbstractSet.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Doc from java.util.AbstractSet.hashCode.

Returns the hash code value for this set. The hash code of a set is defined to be the sum of the hash codes of the elements in the set, where the hash code of a null element is defined to be zero. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two sets s1 and s2, as required by the general contract of Object#hashCode.

This implementation iterates over the set, calling the hashCode method on each element in the set, and adding up the results.

Returns:int

the hash code value for this set

Annotations
@Override
isSuperSetOfback to summary
public boolean isSuperSetOf(Collection<?> c)

Implements abstract com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Doc from com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Checks if the given collection contains all elements of this collection. This is the same as containsAll(Collection) with the source and target reversed, ie. "a.containsAll(b)" is equivalent to "b.isSuperSetOf(a)".

If the given collection is small, or has good contains(Object) performance, using this inverse function avoids creating an Iterator for this collection.

Parameters
c:Collection<?>

a collection to check, cannot be null

Returns:boolean

true if the given collection contains all elements of this collection, otherwise false

Annotations
@Override
iteratorback to summary
public Iterator<T> iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:Iterator<T>

an iterator over the elements in this set

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Doc from java.util.Set.size.

Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this set (its cardinality)

Annotations
@Override
com.sun.javafx.css back to summary

private final Class FixedCapacitySet.Single<T>

extends FixedCapacitySet<T>
Class Inheritance
Type Parameters
<T>
the element type

A set that can hold 0 or 1 elements.

Field Summary

Modifier and TypeField and Description
private T

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
add(T
element to be added to this set
e
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Adds the specified element to this set if it is not already present (optional operation).

public boolean
contains(Object
element whose presence in this set is to be tested
o
)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Returns true if this set contains the specified element.

public int
hashCode()

Overrides java.util.AbstractSet.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Returns the hash code value for this set.

public boolean
isSuperSetOf(Collection<?>
a collection to check, cannot be null
c
)

Implements abstract com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Checks if the given collection contains all elements of this collection.

public Iterator<T>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Returns the number of elements in this set (its cardinality).

Inherited from com.sun.javafx.css.FixedCapacitySet:
ensureNotFrozenfreezeof

Field Detail

elementback to summary
private T element

Constructor Detail

Singleback to summary
private Single()

Method Detail

addback to summary
public boolean add(T e)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Doc from java.util.Set.add.

Adds the specified element to this set if it is not already present (optional operation). More formally, adds the specified element e to this set if the set contains no element e2 such that Objects.equals(e, e2). If this set already contains the element, the call leaves the set unchanged and returns false. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements.

The stipulation above does not imply that sets must accept all elements; sets may refuse to add any particular element, including null, and throw an exception, as described in the specification for Collection.add. Individual set implementations should clearly document any restrictions on the elements that they may contain.

Parameters
e:T

element to be added to this set

Returns:boolean

true if this set did not already contain the specified element

Annotations
@Override
containsback to summary
public boolean contains(Object o)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Doc from java.util.Set.contains.

Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that Objects.equals(o, e).

Parameters
o:Object

element whose presence in this set is to be tested

Returns:boolean

true if this set contains the specified element

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.util.AbstractSet.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Doc from java.util.AbstractSet.hashCode.

Returns the hash code value for this set. The hash code of a set is defined to be the sum of the hash codes of the elements in the set, where the hash code of a null element is defined to be zero. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two sets s1 and s2, as required by the general contract of Object#hashCode.

This implementation iterates over the set, calling the hashCode method on each element in the set, and adding up the results.

Returns:int

the hash code value for this set

Annotations
@Override
isSuperSetOfback to summary
public boolean isSuperSetOf(Collection<?> c)

Implements abstract com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Doc from com.sun.javafx.css.FixedCapacitySet.isSuperSetOf.

Checks if the given collection contains all elements of this collection. This is the same as containsAll(Collection) with the source and target reversed, ie. "a.containsAll(b)" is equivalent to "b.isSuperSetOf(a)".

If the given collection is small, or has good contains(Object) performance, using this inverse function avoids creating an Iterator for this collection.

Parameters
c:Collection<?>

a collection to check, cannot be null

Returns:boolean

true if the given collection contains all elements of this collection, otherwise false

Annotations
@Override
iteratorback to summary
public Iterator<T> iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:Iterator<T>

an iterator over the elements in this set

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Doc from java.util.Set.size.

Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this set (its cardinality)

Annotations
@Override