bibliothek.gui.dock.station.support
Interface PlaceholderList.Filter<M>

Type Parameters:
M - the kind of data this filter offers
All Superinterfaces:
Iterable<M>
Enclosing class:
PlaceholderList<D extends PlaceholderListItem>

public static interface PlaceholderList.Filter<M>
extends Iterable<M>

A sublist of a PlaceholderList, the elements in this list are filtered by a strategy that is defined by the PlaceholderList. Modifying this list has an effect in the enclosing PlaceholderList.

Author:
Benjamin Sigg

Method Summary
 void add(int index, M object)
          Inserts object at location index of this list.
 void add(M object)
          Adds object to this list, the object is added at the end of the list.
 void addPlaceholder(int index, Path placeholder)
          Adds a placeholder at location index, ensures that this placeholder is only present at index.
 M get(int index)
          Gets the index'th element of this list.
 PlaceholderMetaMap getMetaMap(int index)
          Gets a mutable map which is associated with the index'th entry, the content of this map is stored persistently.
 int indexOf(M object)
          Searches the first occurrence of object.
 void move(int source, int destination)
          Moves the item at location source to location destination.
 M remove(int index)
          Removes the object at location index from this list.
 int remove(M object)
          Removes the first occurrence of object.
 M set(int index, M object)
          Replaces the object at location index by object.
 int size()
          The number of elements that are in this list
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

size

int size()
The number of elements that are in this list

Returns:
the length

get

M get(int index)
Gets the index'th element of this list.

Parameters:
index - the location of some element
Returns:
the element, not null

getMetaMap

PlaceholderMetaMap getMetaMap(int index)
Gets a mutable map which is associated with the index'th entry, the content of this map is stored persistently.

Parameters:
index - the location of some element
Returns:
the map associated with that element

add

void add(M object)
Adds object to this list, the object is added at the end of the list.

Parameters:
object - the new object, not null

add

void add(int index,
         M object)
Inserts object at location index of this list.

Parameters:
index - the location
object - the new element, not null

addPlaceholder

void addPlaceholder(int index,
                    Path placeholder)
Adds a placeholder at location index, ensures that this placeholder is only present at index.

Parameters:
index - some location
placeholder - the placeholder to insert

set

M set(int index,
      M object)
Replaces the object at location index by object.

Parameters:
index - the location
object - the new element, not null
Returns:
the old object at that place

remove

M remove(int index)
Removes the object at location index from this list.

Parameters:
index - the location of some object
Returns:
the object that was removed, not null

remove

int remove(M object)
Removes the first occurrence of object. This method searches with help of the Object.equals(Object) method.

Parameters:
object - the object to remove, not null
Returns:
the index of the removed object or -1 if it was not found

indexOf

int indexOf(M object)
Searches the first occurrence of object.

Parameters:
object - the object to search, not null
Returns:
the location or -1 if the object was not found

move

void move(int source,
          int destination)
Moves the item at location source to location destination.

Parameters:
source - the current location of some item
destination - the new location