- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- javafx.collections.ObservableListBase<E>
-
- javafx.collections.ModifiableObservableListBase<E>
-
- com.gluonhq.connect.GluonObservableList<E>
-
- Type Parameters:
E- the type of the elements inside this list
- All Implemented Interfaces:
GluonObservable,Iterable<E>,Collection<E>,List<E>,Observable,ObservableList<E>,EventTarget
- Direct Known Subclasses:
GluonObservableListImpl,GluonObservableRemoteFunctionChunkedListImpl,GluonObservableRemoteFunctionListImpl
public class GluonObservableList<E> extends ModifiableObservableListBase<E> implements GluonObservable, ObservableList<E>
A GluonObservableList is an ObservableList that is linked with a data source.
-
-
Property Summary
Properties Type Property Description ReadOnlyObjectProperty<Throwable>exceptionHolds the exception that was thrown when a synchronization operation failed.ReadOnlyBooleanPropertyinitializedA boolean property that is true when the observable has been initialized successfully after its initial retrieval.ReadOnlyObjectProperty<ConnectState>stateHolds the current state of this observable.
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description GluonObservableList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventDispatchChainbuildEventDispatchChain(EventDispatchChain tail)protected voiddoAdd(int index, E element)Adds theelementto the List at the position ofindex.protected EdoRemove(int index)Removes the element at position ofindex.protected EdoSet(int index, E element)Sets theelementin the List at the position ofindex.ReadOnlyObjectProperty<Throwable>exceptionProperty()Holds the exception that was thrown when a synchronization operation failed.Eget(int index)Returns the element at the specified position in this list.ThrowablegetException()Gets the value of the property exception.ConnectStategetState()Gets the value of the property state.ReadOnlyBooleanPropertyinitializedProperty()A boolean property that is true when the observable has been initialized successfully after its initial retrieval.booleanisInitialized()Gets the value of the property initialized.voidsetException(Throwable exception)Sets the value of the property exception.voidsetOnCancelled(EventHandler<ConnectStateEvent> value)The onCancelled event handler is called whenever the GluonObservable state transitions to the CANCELLED state.voidsetOnFailed(EventHandler<ConnectStateEvent> value)The onFailed event handler is called whenever the GluonObservable state transitions to the FAILED state.voidsetOnReady(EventHandler<ConnectStateEvent> value)The onReady event handler is called whenever the GluonObservable state transitions to the READY state.voidsetOnRemoved(EventHandler<ConnectStateEvent> value)The onRemoved event handler is called whenever the GluonObservable state transitions to the REMOVED state.voidsetOnRunning(EventHandler<ConnectStateEvent> value)The onRunning event handler is called whenever the GluonObservable state transitions to the RUNNING state.voidsetOnSucceeded(EventHandler<ConnectStateEvent> value)The onSucceeded event handler is called whenever the GluonObservable state transitions to the SUCCEEDED state.voidsetState(ConnectState state)Sets the value of the property state.intsize()Returns the number of elements in this list.ReadOnlyObjectProperty<ConnectState>stateProperty()Holds the current state of this observable.-
Methods inherited from class javafx.collections.ModifiableObservableListBase
add, addAll, addAll, remove, remove, removeAll, removeRange, retainAll, set, setAll, subList
-
Methods inherited from class javafx.collections.ObservableListBase
addAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll
-
Methods inherited from class java.util.AbstractList
add, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator
-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
-
Methods inherited from interface javafx.beans.Observable
addListener, removeListener
-
Methods inherited from interface javafx.collections.ObservableList
addAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sorted
-
-
-
-
Property Detail
-
initialized
public ReadOnlyBooleanProperty initializedProperty
- Specified by:
initializedPropertyin interfaceGluonObservable- See Also:
isInitialized()
-
state
public ReadOnlyObjectProperty<ConnectState> stateProperty
- Specified by:
statePropertyin interfaceGluonObservable- See Also:
getState(),setState(ConnectState)
-
exception
public ReadOnlyObjectProperty<Throwable> exceptionProperty
- Specified by:
exceptionPropertyin interfaceGluonObservable- See Also:
getException(),setException(Throwable)
-
-
Method Detail
-
isInitialized
public boolean isInitialized()
Gets the value of the property initialized.- Specified by:
isInitializedin interfaceGluonObservable- Property description:
- Returns:
- true when the observable is initialized; false otherwise.
-
initializedProperty
public ReadOnlyBooleanProperty initializedProperty()
Description copied from interface:GluonObservableA boolean property that is true when the observable has been initialized successfully after its initial retrieval.- Specified by:
initializedPropertyin interfaceGluonObservable- See Also:
isInitialized()
-
getState
public ConnectState getState()
Gets the value of the property state.- Specified by:
getStatein interfaceGluonObservable- Property description:
- Returns:
- the current state
-
setState
public void setState(ConnectState state)
Sets the value of the property state.- Property description:
-
stateProperty
public ReadOnlyObjectProperty<ConnectState> stateProperty()
Description copied from interface:GluonObservableHolds the current state of this observable. This property can be used to listen for changes in the synchronization process.- Specified by:
statePropertyin interfaceGluonObservable- See Also:
getState(),setState(ConnectState)
-
getException
public Throwable getException()
Gets the value of the property exception.- Specified by:
getExceptionin interfaceGluonObservable- Property description:
- Returns:
- the exception, if one has occurred; otherwise null.
-
setException
public void setException(Throwable exception)
Sets the value of the property exception.- Property description:
-
exceptionProperty
public ReadOnlyObjectProperty<Throwable> exceptionProperty()
Description copied from interface:GluonObservableHolds the exception that was thrown when a synchronization operation failed.- Specified by:
exceptionPropertyin interfaceGluonObservable- See Also:
getException(),setException(Throwable)
-
setOnReady
public void setOnReady(EventHandler<ConnectStateEvent> value)
Description copied from interface:GluonObservableThe onReady event handler is called whenever the GluonObservable state transitions to the READY state.- Specified by:
setOnReadyin interfaceGluonObservable- Parameters:
value- the event handler, can be null to clear it
-
setOnRunning
public void setOnRunning(EventHandler<ConnectStateEvent> value)
Description copied from interface:GluonObservableThe onRunning event handler is called whenever the GluonObservable state transitions to the RUNNING state.- Specified by:
setOnRunningin interfaceGluonObservable- Parameters:
value- the event handler, can be null to clear it
-
setOnFailed
public void setOnFailed(EventHandler<ConnectStateEvent> value)
Description copied from interface:GluonObservableThe onFailed event handler is called whenever the GluonObservable state transitions to the FAILED state.- Specified by:
setOnFailedin interfaceGluonObservable- Parameters:
value- the event handler, can be null to clear it
-
setOnSucceeded
public void setOnSucceeded(EventHandler<ConnectStateEvent> value)
Description copied from interface:GluonObservableThe onSucceeded event handler is called whenever the GluonObservable state transitions to the SUCCEEDED state.- Specified by:
setOnSucceededin interfaceGluonObservable- Parameters:
value- the event handler, can be null to clear it
-
setOnCancelled
public void setOnCancelled(EventHandler<ConnectStateEvent> value)
Description copied from interface:GluonObservableThe onCancelled event handler is called whenever the GluonObservable state transitions to the CANCELLED state.- Specified by:
setOnCancelledin interfaceGluonObservable- Parameters:
value- the event handler, can be null to clear it
-
setOnRemoved
public void setOnRemoved(EventHandler<ConnectStateEvent> value)
Description copied from interface:GluonObservableThe onRemoved event handler is called whenever the GluonObservable state transitions to the REMOVED state.- Specified by:
setOnRemovedin interfaceGluonObservable- Parameters:
value- the event handler, can be null to clear it
-
get
public E get(int index)
Returns the element at the specified position in this list.
-
size
public int size()
Returns the number of elements in this list.- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classModifiableObservableListBase<E>- Returns:
- the number of elements in this list
-
doAdd
protected void doAdd(int index, E element)Adds theelementto the List at the position ofindex.For the description of possible exceptions, please refer to the documentation of
AbstractList.add(java.lang.Object)method.- Specified by:
doAddin classModifiableObservableListBase<E>- Parameters:
index- the position where to add the elementelement- the element that will be added- Throws:
ClassCastException- if the type of the specified element is incompatible with this listNullPointerException- if the specified arguments contain one or more null elementsIllegalArgumentException- if some property of this element prevents it from being added to this listIndexOutOfBoundsException- if the index is out of range(index < 0 || index > size())
-
doSet
protected E doSet(int index, E element)
Sets theelementin the List at the position ofindex.For the description of possible exceptions, please refer to the documentation of
ModifiableObservableListBase.set(int, java.lang.Object)method.- Specified by:
doSetin classModifiableObservableListBase<E>- Parameters:
index- the position where to set the elementelement- the element that will be set at the specified position- Returns:
- the old element at the specified position
- Throws:
ClassCastException- if the type of the specified element is incompatible with this listNullPointerException- if the specified arguments contain one or more null elementsIllegalArgumentException- if some property of this element prevents it from being added to this listIndexOutOfBoundsException- if the index is out of range(index < 0 || index >= size())
-
doRemove
protected E doRemove(int index)
Removes the element at position ofindex.- Specified by:
doRemovein classModifiableObservableListBase<E>- Parameters:
index- the index of the removed element- Returns:
- the removed element
- Throws:
IndexOutOfBoundsException- if the index is out of range(index < 0 || index >= size())
-
buildEventDispatchChain
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail)
- Specified by:
buildEventDispatchChainin interfaceEventTarget
-
-