Class MappedObservableList<A,B>

java.lang.Object
java.util.AbstractCollection<A>
java.util.AbstractList<A>
javafx.collections.ObservableListBase<A>
javafx.collections.transformation.TransformationList<A,B>
org.jhotdraw8.fxcollection.mapped.MappedObservableList<A,B>
Type Parameters:
A - the element type of this list
B - the element type of the source list
All Implemented Interfaces:
Iterable<A>, Collection<A>, List<A>, SequencedCollection<A>, javafx.beans.Observable, javafx.collections.ObservableList<A>

public class MappedObservableList<A,B> extends javafx.collections.transformation.TransformationList<A,B>
Maps an ObservableList in an ObservableList of a different element type.
Author:
Werner Randelshofer
  • Constructor Details

    • MappedObservableList

      public MappedObservableList(@NonNull javafx.collections.ObservableList<B> source, Function<A,B> toB, Function<B,A> toA)
  • Method Details

    • sourceChanged

      protected void sourceChanged(javafx.collections.ListChangeListener.Change<? extends B> c)
      Specified by:
      sourceChanged in class javafx.collections.transformation.TransformationList<A,B>
    • getSourceIndex

      public int getSourceIndex(int index)
      Specified by:
      getSourceIndex in class javafx.collections.transformation.TransformationList<A,B>
    • getViewIndex

      public int getViewIndex(int index)
      Specified by:
      getViewIndex in class javafx.collections.transformation.TransformationList<A,B>
    • get

      public A get(int index)
      Specified by:
      get in interface List<A>
      Specified by:
      get in class AbstractList<A>
    • size

      public int size()
      Specified by:
      size in interface Collection<A>
      Specified by:
      size in interface List<A>
      Specified by:
      size in class AbstractCollection<A>
    • remove

      public A remove(int index)
      Specified by:
      remove in interface List<A>
      Overrides:
      remove in class AbstractList<A>
    • remove

      public boolean remove(Object o)
      Specified by:
      remove in interface Collection<A>
      Specified by:
      remove in interface List<A>
      Overrides:
      remove in class AbstractCollection<A>
    • add

      public void add(int index, A e)
      Specified by:
      add in interface List<A>
      Overrides:
      add in class AbstractList<A>
    • add

      public boolean add(A e)
      Specified by:
      add in interface Collection<A>
      Specified by:
      add in interface List<A>
      Overrides:
      add in class AbstractList<A>
    • set

      public A set(int index, A e)
      Specified by:
      set in interface List<A>
      Overrides:
      set in class AbstractList<A>
    • remove

      public void remove(int from, int to)
      Specified by:
      remove in interface javafx.collections.ObservableList<A>
      Overrides:
      remove in class javafx.collections.ObservableListBase<A>