Package org.apache.pivot.io
Class FileList
- java.lang.Object
-
- org.apache.pivot.collections.adapter.ListAdapter<java.io.File>
-
- org.apache.pivot.io.FileList
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<java.io.File>,Collection<java.io.File>,List<java.io.File>,Sequence<java.io.File>
public class FileList extends ListAdapter<java.io.File>
Collection representing a list of files. Each entry in the list is unique; i.e. a single file can't be added to the list more than once.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.pivot.collections.List
List.ItemIterator<T>, List.ListListenerList<T>
-
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence
Sequence.Tree<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intadd(java.io.File file)Adds an item to the list.voidinsert(java.io.File file, int index)Inserts an item into the list.voidsetComparator(java.util.Comparator<java.io.File> comparator)Sets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order.java.io.Fileupdate(int index, java.io.File file)Updates the item at the given index.-
Methods inherited from class org.apache.pivot.collections.adapter.ListAdapter
clear, get, getComparator, getLength, getList, getListListeners, indexOf, isEmpty, iterator, remove, remove, toString
-
-
-
-
Method Detail
-
add
public int add(java.io.File file)
Description copied from interface:ListAdds an item to the list. If the list is unsorted, the item is appended to the end of the list. Otherwise, it is inserted at the appropriate index.- Specified by:
addin interfaceList<java.io.File>- Specified by:
addin interfaceSequence<java.io.File>- Overrides:
addin classListAdapter<java.io.File>- Parameters:
file- The item to be added to the sequence.- Returns:
- The index at which the item was added.
- See Also:
ListListener.itemInserted(List, int)
-
insert
@UnsupportedOperation public void insert(java.io.File file, int index)
Description copied from interface:ListInserts an item into the list.- Specified by:
insertin interfaceList<java.io.File>- Specified by:
insertin interfaceSequence<java.io.File>- Overrides:
insertin classListAdapter<java.io.File>- Parameters:
file- The item to be added to the list.index- The index at which the item should be inserted. Must be a value between0andgetLength().- See Also:
ListListener.itemInserted(List, int)
-
update
@UnsupportedOperation public java.io.File update(int index, java.io.File file)
Description copied from interface:ListUpdates the item at the given index.- Specified by:
updatein interfaceList<java.io.File>- Specified by:
updatein interfaceSequence<java.io.File>- Overrides:
updatein classListAdapter<java.io.File>- Parameters:
index- The index of the item to update.file- The item that will replace any existing value at the given index.- Returns:
- The item that was previously stored at the given index.
- See Also:
ListListener.itemUpdated(List, int, Object)
-
setComparator
@UnsupportedOperation public void setComparator(java.util.Comparator<java.io.File> comparator)
Description copied from interface:CollectionSets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order.Calling this method more than once with the same comparator will re-sort the collection.
- Specified by:
setComparatorin interfaceCollection<java.io.File>- Specified by:
setComparatorin interfaceList<java.io.File>- Overrides:
setComparatorin classListAdapter<java.io.File>- Parameters:
comparator- The comparator used to order elements in the collection, or null if the collection is unsorted.- See Also:
ListListener.comparatorChanged(List, Comparator)
-
-