Spec-Zone.ru › OpenJavaFX 8
javafx.collections.transformation

Class TransformationList<E,F>

java.lang.Object
  • java.util.AbstractCollection<E>
    • java.util.AbstractList<E>
      • javafx.collections.ObservableListBase<E>
        • javafx.collections.transformation.TransformationList<E,F>

Type Parameters:

E - the type parameter of this list

All Implemented Interfaces:

Iterable<E>, Collection<E>, List<E>, Observable, ObservableList<E>

Direct Known Subclasses:

FilteredList, SortedList



public abstract class TransformationList<E,F>
extends ObservableListBase<E>
implements ObservableList<E>
A base class for all lists that wraps other lists in a way that changes the list's elements, order, size or generally it's structure. If the source list is observable, a listener is automatically added to it and the events are delegated to #onSourceChanged(javafx.collections.ListChangeListener.Change)

Since:

JavaFX 8.0

  • Field Summary

    • Fields inherited from class java.util.AbstractList

      modCount
  • Constructor Summary

    Constructors
    Modifier Constructor and Description
    protected TransformationList(ObservableList<? extends F> source)
    Creates a new Transformation list wrapped around the source list.
  • Method Summary

    All MethodsInstance MethodsAbstract MethodsConcrete Methods
    Modifier and Type Method and Description
    ObservableList<? extends F> getSource()
    The source list specified in the constructor of this transformation list.
    abstract int getSourceIndex(int index)
    Maps the index of this list's element to an index in the direct source list.
    int getSourceIndexFor(ObservableList<?> list, int index)
    Maps the index of this list's element to an index of the provided list.
    boolean isInTransformationChain(ObservableList<?> list)
    Checks whether the provided list is in the chain under this TransformationList.
    protected abstract void sourceChanged(ListChangeListener.Change<? extends F> c)
    Called when a change from the source is triggered.
    • 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, setAll
    • Methods inherited from class java.util.AbstractList

      add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
    • Methods inherited from class java.util.AbstractCollection

      addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toString
    • Methods inherited from class java.lang.Object

      clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Methods inherited from interface javafx.collections.ObservableList

      addAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sorted
    • Methods inherited from interface java.util.List

      add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
    • Methods inherited from interface java.util.Collection

      parallelStream, removeIf, stream
    • Methods inherited from interface java.lang.Iterable

      forEach
    • Methods inherited from interface javafx.beans.Observable

      addListener, removeListener
  • Constructor Detail

    • TransformationList

      protected TransformationList(ObservableList<? extends F> source)
      Creates a new Transformation list wrapped around the source list.

      Parameters:

      source - the wrapped list

  • Method Detail

    • getSource

      public final ObservableList<? extends F> getSource()
      The source list specified in the constructor of this transformation list.

      Returns:

      The List that is directly wrapped by this TransformationList

    • isInTransformationChain

      public final boolean isInTransformationChain(ObservableList<?> list)
      Checks whether the provided list is in the chain under this TransformationList. This means the list is either the direct source as returned by getSource() or the direct source is a TransformationList, and the list is in it's transformation chain.

      Parameters:

      list - the list to check

      Returns:

      true if the list is in the transformation chain as specified above.

    • sourceChanged

      protected abstract void sourceChanged(ListChangeListener.Change<? extends F> c)
      Called when a change from the source is triggered.

      Parameters:

      c - the change

    • getSourceIndex

      public abstract int getSourceIndex(int index)
      Maps the index of this list's element to an index in the direct source list.

      Parameters:

      index - the index in this list

      Returns:

      the index of the element's origin in the source list

      See Also:

      getSource()

    • getSourceIndexFor

      public final int getSourceIndexFor(ObservableList<?> list,
                                         int index)
      Maps the index of this list's element to an index of the provided list. The list must be in the transformation chain.

      Parameters:

      list - a list from the transformation chain

      Returns:

      the index of the element's origin in the provided list

      See Also:

      isInTransformationChain(javafx.collections.ObservableList)

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API