- java.lang.Object
-  
      - java.util.AbstractCollection<E>
-  
        - java.util.AbstractList<E>
-  
          - javafx.collections.ObservableListBase<E>
-  
            - javafx.collections.transformation.TransformationList<E,E>
-  
              - javafx.collections.transformation.SortedList<E>
 
 
 
 
 
-  
       - All Implemented Interfaces:
-  
         Iterable<E>,Collection<E>,List<E>,Observable,ObservableList<E>
 
 
 public final class SortedList<E> extends TransformationList<E,E> 包装一个ObservableList并对其内容进行排序。 ObservableList中的所有更改都会立即传播到SortedList。 注意:无效的SortedList(由于比较结果不合格)不会再向通知发送任何通知。- 从以下版本开始:
- JavaFX 8.0
- 另请参见:
-  
         TransformationList
 
-  
        
       -  
             Property SummaryProperties Type Property 描述 ObjectProperty<Comparator<? super E>>comparator比较器,表示此SortedList的顺序。
 -  
             Field Summary-  
               Fields inherited from class java.util.AbstractListmodCount
 
-  
               
 -  
             构造方法摘要构造方法 Constructor 描述 SortedList(ObservableList<? extends E> source)在源列表周围构造一个新的无序SortedList包装器。SortedList(ObservableList<? extends E> source, Comparator<? super E> comparator)创建一个围绕源列表的新SortedList。
 -  
             方法摘要所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 ObjectProperty<Comparator<? super E>>comparatorProperty()比较器,表示此SortedList的顺序。Eget(int index)返回此列表中指定位置的元素。Comparator<? super E>getComparator()获取属性比较器的值。intgetSourceIndex(int index)将此列表元素的索引映射到直接源列表中的索引。intgetViewIndex(int index)将直接源列表的元素的索引映射到此列表中的索引。voidsetComparator(Comparator<? super E> comparator)设置属性比较器的值。intsize()返回此列表中的元素数。protected voidsourceChanged(ListChangeListener.Change<? extends E> c)当来自源的更改被触发时调用。-  
               Methods inherited from class java.util.AbstractCollectionaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 -  
               Methods inherited from class java.util.AbstractListadd, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 -  
               Methods inherited from interface java.util.CollectionparallelStream, removeIf, stream
 -  
               Methods inherited from interface java.util.Listadd, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
 -  
               Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 -  
               Methods inherited from interface javafx.beans.ObservableaddListener, removeListener
 -  
               Methods inherited from interface javafx.collections.ObservableListaddAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sorted
 -  
               Methods inherited from class javafx.collections.ObservableListBaseaddAll, addListener, addListener, beginChange, endChange, fireChange, hasListeners, nextAdd, nextPermutation, nextRemove, nextRemove, nextReplace, nextSet, nextUpdate, remove, removeAll, removeListener, removeListener, retainAll, setAll, setAll
 -  
               Methods inherited from class javafx.collections.transformation.TransformationListgetSource, getSourceIndexFor, isInTransformationChain
 
-  
               
 
-  
             
-  
        
       -  
             Property Detail-  comparatorpublic final ObjectProperty<Comparator<? super E>> comparatorProperty 比较器,表示此SortedList的顺序。 空的无序SortedList。
 
-  
 -  
             构造方法详细信息-  SortedListpublic SortedList(ObservableList<? extends E> source, Comparator<? super E> comparator) 创建一个围绕源列表的新SortedList。 源列表将使用提供的比较器进行排序。 如果提供null,则列表保持无序,并且等于源列表。- 参数
-  
              source- 要包装的列表
-  
              comparator- 用于无序列表的比较器或null
 
 -  SortedListpublic SortedList(ObservableList<? extends E> source) 在源列表周围构造一个新的无序SortedList包装器。- 参数
-  
              source- 源列表
- 另请参见:
-  
              SortedList(javafx.collections.ObservableList, java.util.Comparator)
 
 
-  
 -  
             方法详细信息-  sourceChangedprotected void sourceChanged(ListChangeListener.Change<? extends E> c) 描述从类别复制:TransformationList当来自源的更改被触发时调用。- Specified by:
-  
              sourceChanged在TransformationList<E,E>
- 参数
-  
              c- 更改
 
 -  comparatorPropertypublic final ObjectProperty<Comparator<? super E>> comparatorProperty() 比较器,表示此SortedList的顺序。 空的无序SortedList。
 -  getComparatorpublic final Comparator<? super E> getComparator() 获取属性比较器的值。- Property description:
- 比较器,表示此SortedList的顺序。 空的无序SortedList。
 
 -  setComparatorpublic final void setComparator(Comparator<? super E> comparator) 设置属性比较器的值。- Property description:
- 比较器,表示此SortedList的顺序。 空的无序SortedList。
 
 -  getpublic E get(int index) 返回此列表中指定位置的元素。- Specified by:
-  
              get在接口List<E>
- Specified by:
-  
              get在AbstractList<E>
- 参数
-  
              index- 要返回的元素的索引
- 结果
- 该列表中指定位置的元素
- 异常
-  
              IndexOutOfBoundsException- 如果索引超出范围(index < 0 || index >= size())
 
 -  sizepublic int size() 返回此列表中的元素数。- Specified by:
-  
              size在接口Collection<E>
- Specified by:
-  
              size在接口List<E>
- Specified by:
-  
              size在AbstractCollection<E>
- 结果
- 此列表中的元素数
 
 -  getSourceIndexpublic int getSourceIndex(int index) 说明从类别复制:TransformationList将此列表元素的索引映射到直接源列表中的索引。- Specified by:
-  
              getSourceIndex在TransformationList<E,E>
- 参数
-  
              index- 此列表中的索引
- 结果
- 源列表中元素的起始索引
- 另请参见:
-  
              TransformationList.getSource()
 
 -  getViewIndexpublic int getViewIndex(int index) 描述从类别复制:TransformationList将直接源列表的元素的索引映射到此列表中的索引。- Specified by:
-  
              getViewIndex在TransformationList<E,E>
- 参数
-  
              index- 源列表中的索引
- 结果
- 如果列表中包含该元素的索引,否则为负值
- 另请参见:
-  
              TransformationList.getSource(),TransformationList.getSourceIndex(int)
 
 
-  
 
-