APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.javafx.css

pack-priv abstract Class BitSet<T>

extends AbstractSet<T>
implements ObservableSet<T>
Class Inheritance
All Implemented Interfaces
javafx.collections.ObservableSet, javafx.beans.Observable, java.util.Set, java.util.Collection, java.lang.Iterable
Known Direct Subclasses
com.sun.javafx.css.PseudoClassState
Imports
java.util.AbstractSet, .Collection, .Iterator, .NoSuchElementException, com.sun.javafx.collections.SetListenerHelper, javafx.beans.InvalidationListener, javafx.collections.FXCollections, .ObservableSet, .SetChangeListener

Pseudo-class state and style-classes are represented as bits in a long[] which makes matching faster.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private long[]
private static final long[]
private SetListenerHelper<T>

Constructor Summary

AccessConstructor and Description
protected
BitSet()

Create an empty set of T

Method Summary

Modifier and TypeMethod and Description
public boolean
add(T t)

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
addAll(Collection<? extends T> c)

Overrides java.util.AbstractCollection.addAll.

Implements java.util.Set.addAll, java.util.Collection.addAll.

Adds all of the elements in the specified collection to this set if they're not already present (optional operation).

public void
addListener(SetChangeListener<? super T> setChangeListener)

Implements javafx.collections.ObservableSet.addListener.

Add a listener to this observable set.

public void
addListener(InvalidationListener invalidationListener)

Implements javafx.beans.Observable.addListener.

Adds an InvalidationListener which will be notified whenever the Observable becomes invalid.

public void
clear()

Overrides java.util.AbstractCollection.clear.

Implements java.util.Set.clear, java.util.Collection.clear.

Removes all of the elements from this set (optional operation).

public boolean
contains(Object 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 boolean
containsAll(Collection<?> c)

Overrides java.util.AbstractCollection.containsAll.

Implements java.util.Set.containsAll, java.util.Collection.containsAll.

Returns true if this set contains all of the elements of the specified collection.

public boolean
equals(Object obj)

Overrides java.util.AbstractSet.equals.

Implements java.util.Set.equals, java.util.Collection.equals.

Compares the specified object with this set for equality.

private boolean
equalsBitSet(BitSet<?> other)

pack-priv long[]
protected abstract Class<T>

Returns:

a Class of type T, never null
getElementType
()

Returns the element type.

protected abstract int
getIndex(T t)

protected abstract T
getT(int index)

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
isEmpty()

Overrides java.util.AbstractCollection.isEmpty.

Implements java.util.Set.isEmpty, java.util.Collection.isEmpty.

Returns true if this set contains no elements.

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.

private void
notifyObservers(T element, boolean removed)

public boolean
remove(Object o)

Overrides java.util.AbstractCollection.remove.

Implements java.util.Set.remove, java.util.Collection.remove.

Removes the specified element from this set if it is present (optional operation).

public boolean
removeAll(Collection<?> c)

Overrides java.util.AbstractSet.removeAll.

Implements java.util.Set.removeAll, java.util.Collection.removeAll.

Removes from this set all of its elements that are contained in the specified collection (optional operation).

public void
removeListener(SetChangeListener<? super T> setChangeListener)

Implements javafx.collections.ObservableSet.removeListener.

Tries to removed a listener from this observable set.

public void
removeListener(InvalidationListener invalidationListener)

Implements javafx.beans.Observable.removeListener.

Removes the given listener from the list of listeners, that are notified whenever the value of the Observable becomes invalid.

public boolean
retainAll(Collection<?> c)

Overrides java.util.AbstractCollection.retainAll.

Implements java.util.Set.retainAll, java.util.Collection.retainAll.

Retains only the elements in this set that are contained in the specified collection (optional operation).

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).

Field Detail

bitsback to summary
private long[] bits
EMPTY_SETback to summary
private static final long[] EMPTY_SET
listenerHelperback to summary
private SetListenerHelper<T> listenerHelper

Constructor Detail

BitSetback to summary
protected BitSet()

Create an empty set of T

Method Detail

addback to summary
public boolean add(T t)

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.

Annotations
@Override
addAllback to summary
public boolean addAll(Collection<? extends T> c)

Overrides java.util.AbstractCollection.addAll.

Implements java.util.Set.addAll, java.util.Collection.addAll.

Doc from java.util.Set.addAll.

Adds all of the elements in the specified collection to this set if they're not already present (optional operation). If the specified collection is also a set, the addAll operation effectively modifies this set so that its value is the union of the two sets. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress.

Annotations
@Override
addListenerback to summary
public void addListener(SetChangeListener<? super T> setChangeListener)

Implements javafx.collections.ObservableSet.addListener.

Doc from javafx.collections.ObservableSet.addListener.

Add a listener to this observable set.

Annotations
@Override
addListenerback to summary
public void addListener(InvalidationListener invalidationListener)

Implements javafx.beans.Observable.addListener.

Doc from javafx.beans.Observable.addListener.

Adds an InvalidationListener which will be notified whenever the Observable becomes invalid. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

Note that the same actual InvalidationListener instance may be safely registered for different Observables.

The Observable stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by calling removeListener after use or to use an instance of WeakInvalidationListener avoid this situation.

Annotations
@Override
clearback to summary
public void clear()

Overrides java.util.AbstractCollection.clear.

Implements java.util.Set.clear, java.util.Collection.clear.

Doc from java.util.Set.clear.

Removes all of the elements from this set (optional operation). The set will be empty after this call returns.

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).

Annotations
@Override
containsAllback to summary
public boolean containsAll(Collection<?> c)

Overrides java.util.AbstractCollection.containsAll.

Implements java.util.Set.containsAll, java.util.Collection.containsAll.

Doc from java.util.Set.containsAll.

Returns true if this set contains all of the elements of the specified collection. If the specified collection is also a set, this method returns true if it is a subset of this set.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.util.AbstractSet.equals.

Implements java.util.Set.equals, java.util.Collection.equals.

Doc from java.util.Set.equals.

Compares the specified object with this set for equality. Returns true if the specified object is also a set, the two sets have the same size, and every member of the specified set is contained in this set (or equivalently, every member of this set is contained in the specified set). This definition ensures that the equals method works properly across different implementations of the set interface.

Annotations
@Override
equalsBitSetback to summary
private boolean equalsBitSet(BitSet<?> other)
getBitsback to summary
pack-priv long[] getBits()
getElementTypeback to summary
protected abstract Class<T> getElementType()

Returns the element type.

Returns:Class<T>

a Class of type T, never null

getIndexback to summary
protected abstract int getIndex(T t)
getTback to summary
protected abstract T getT(int index)
hashCodeback to summary
public int hashCode()

Overrides java.util.AbstractSet.hashCode.

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

Doc from java.util.Set.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.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Overrides java.util.AbstractCollection.isEmpty.

Implements java.util.Set.isEmpty, java.util.Collection.isEmpty.

Doc from java.util.Set.isEmpty.

Returns true if this set contains no elements.

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). This returned iterator is not fail-fast.

Annotations
@Override
notifyObserversback to summary
private void notifyObservers(T element, boolean removed)
removeback to summary
public boolean remove(Object o)

Overrides java.util.AbstractCollection.remove.

Implements java.util.Set.remove, java.util.Collection.remove.

Doc from java.util.Set.remove.

Removes the specified element from this set if it is present (optional operation). More formally, removes an element e such that Objects.equals(o, e), if this set contains such an element. Returns true if this set contained the element (or equivalently, if this set changed as a result of the call). (This set will not contain the element once the call returns.)

Annotations
@Override
removeAllback to summary
public boolean removeAll(Collection<?> c)

Overrides java.util.AbstractSet.removeAll.

Implements java.util.Set.removeAll, java.util.Collection.removeAll.

Doc from java.util.Set.removeAll.

Removes from this set all of its elements that are contained in the specified collection (optional operation). If the specified collection is also a set, this operation effectively modifies this set so that its value is the asymmetric set difference of the two sets.

Annotations
@Override
removeListenerback to summary
public void removeListener(SetChangeListener<? super T> setChangeListener)

Implements javafx.collections.ObservableSet.removeListener.

Doc from javafx.collections.ObservableSet.removeListener.

Tries to removed a listener from this observable set. If the listener is not attached to this list, nothing happens.

Annotations
@Override
removeListenerback to summary
public void removeListener(InvalidationListener invalidationListener)

Implements javafx.beans.Observable.removeListener.

Doc from javafx.beans.Observable.removeListener.

Removes the given listener from the list of listeners, that are notified whenever the value of the Observable becomes invalid.

If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.

Annotations
@Override
retainAllback to summary
public boolean retainAll(Collection<?> c)

Overrides java.util.AbstractCollection.retainAll.

Implements java.util.Set.retainAll, java.util.Collection.retainAll.

Doc from java.util.Set.retainAll.

Retains only the elements in this set that are contained in the specified collection (optional operation). In other words, removes from this set all of its elements that are not contained in the specified collection. If the specified collection is also a set, this operation effectively modifies this set so that its value is the intersection of the two sets.

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.

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

private Class BitSet.Change

extends SetChangeListener.Change<T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final T
private static final boolean
private static final boolean
private final boolean

Constructor Summary

AccessConstructor and Description
public
Change(T element, boolean removed)

Method Summary

Modifier and TypeMethod and Description
public T
public T
public boolean
wasAdded()

Implements abstract javafx.collections.SetChangeListener.Change.wasAdded.

If this change is a result of add operation.

public boolean
wasRemoved()

Implements abstract javafx.collections.SetChangeListener.Change.wasRemoved.

If this change is a result of removal operation.

Inherited from javafx.collections.SetChangeListener.Change:
getSet

Field Detail

elementback to summary
private final T element
ELEMENT_ADDEDback to summary
private static final boolean ELEMENT_ADDED
ELEMENT_REMOVEDback to summary
private static final boolean ELEMENT_REMOVED
removedback to summary
private final boolean removed

Constructor Detail

Changeback to summary
public Change(T element, boolean removed)

Method Detail

getElementAddedback to summary
public T getElementAdded()

Implements abstract javafx.collections.SetChangeListener.Change.getElementAdded.

Doc from javafx.collections.SetChangeListener.Change.getElementAdded.

Get the new element. Return null if this is a removal.

Annotations
@Override
getElementRemovedback to summary
public T getElementRemoved()

Implements abstract javafx.collections.SetChangeListener.Change.getElementRemoved.

Doc from javafx.collections.SetChangeListener.Change.getElementRemoved.

Get the old element. Return null if this is an addition.

Annotations
@Override
wasAddedback to summary
public boolean wasAdded()

Implements abstract javafx.collections.SetChangeListener.Change.wasAdded.

Doc from javafx.collections.SetChangeListener.Change.wasAdded.

If this change is a result of add operation.

Annotations
@Override
wasRemovedback to summary
public boolean wasRemoved()

Implements abstract javafx.collections.SetChangeListener.Change.wasRemoved.

Doc from javafx.collections.SetChangeListener.Change.wasRemoved.

If this change is a result of removal operation.

Annotations
@Override