org.beanfabrics.model
Interface IListPM<T extends PresentationModel>

Type Parameters:
T - the element type parameter
All Superinterfaces:
Bean, ContextOwner, HasComparable, java.lang.Iterable<T>, PresentationModel, Supportable, Validatable
All Known Subinterfaces:
IMapPM<K,V>
All Known Implementing Classes:
ColumnListPM, ListPM, MapPM, PropertiesPM

public interface IListPM<T extends PresentationModel>
extends PresentationModel, java.lang.Iterable<T>

Minimal interface for presentation models with list-editing capabilities.


Method Summary
 void addListListener(ListListener listener)
          Adds the given listener.
 boolean contains(T obj)
          Returns true if this collection contains the specified element.
 T getAt(int index)
          Returns the element at the specified position in this list.
 Selection<T> getSelection()
          Returns the selection of this list.
 java.util.Collection<SortKey> getSortKeys()
          Returns the (immutable) collection of SortKey objects that reflect the current sorting state of this list.
 int indexOf(T element)
          Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
 boolean isEmpty()
          Returns true if this collection contains no elements.
 java.util.ListIterator<T> listIterator(int index)
          Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.
 void removeListListener(ListListener listener)
          Removes the given listener.
 int size()
          Returns the number of elements in this collection.
 void sortBy(boolean ascending, Path... path)
          Sorts the elements of this list PM by comparing the child nodes at the end of the given paths.
 void sortBy(java.util.Collection<SortKey> newSortKeys)
          Sorts the elements of this list PM by the specified sort keys.
 void sortBy(SortKey... sortKeys)
          Sorts the elements of this list PM by the specified sort keys.
 void swap(int indexA, int indexB)
          Swaps the position of the two elements specified by the given indexes.
 void swap(T elemA, T elemB)
          Swaps the position of the two specified elements.
 java.lang.Object[] toArray()
          Returns an array containing all of the elements in this list in proper sequence (from first to last element).
 java.util.Collection<T> toCollection()
          Returns a new Collection of all elements.
 
Methods inherited from interface org.beanfabrics.Bean
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface org.beanfabrics.validation.Validatable
getValidationState, getValidator, isValid, revalidate
 
Methods inherited from interface org.beanfabrics.support.Supportable
getSupportMap
 
Methods inherited from interface org.beanfabrics.context.ContextOwner
getContext
 
Methods inherited from interface org.beanfabrics.HasComparable
getComparable
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

addListListener

void addListListener(ListListener listener)
Adds the given listener.

Parameters:
listener -

removeListListener

void removeListListener(ListListener listener)
Removes the given listener.

Parameters:
listener -

size

int size()
Returns the number of elements in this collection.

Returns:
the number of elements in this collection

isEmpty

boolean isEmpty()
Returns true if this collection contains no elements.

Returns:
true if this collection contains no elements

contains

boolean contains(T obj)
Returns true if this collection contains the specified element.

Parameters:
obj -
Returns:
true if this collection contains the specified element

indexOf

int indexOf(T element)
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

Parameters:
element -
Returns:
the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element

getAt

T getAt(int index)
Returns the element at the specified position in this list.

Parameters:
index -
Returns:
the element at the specified position in this list

swap

void swap(int indexA,
          int indexB)
Swaps the position of the two elements specified by the given indexes.

Parameters:
indexA -
indexB -

swap

void swap(T elemA,
          T elemB)
Swaps the position of the two specified elements.

Parameters:
elemA -
elemB -

sortBy

void sortBy(boolean ascending,
            Path... path)
Sorts the elements of this list PM by comparing the child nodes at the end of the given paths.

Parameters:
ascending - if true, the resulting order will be ascending, otherwise descending.
paths - one or more Path objects that define the sort keys

sortBy

void sortBy(java.util.Collection<SortKey> newSortKeys)
Sorts the elements of this list PM by the specified sort keys.

Parameters:
newSortKeys - the sort keys used for sorting the elements of this list PM

sortBy

void sortBy(SortKey... sortKeys)
Sorts the elements of this list PM by the specified sort keys.

Parameters:
newSortKeys - the sort keys used for sorting the elements of this list PM

getSortKeys

java.util.Collection<SortKey> getSortKeys()
Returns the (immutable) collection of SortKey objects that reflect the current sorting state of this list.

Returns:
the (immutable) collection of SortKey objects that reflect the current sorting state of this list

toCollection

java.util.Collection<T> toCollection()
Returns a new Collection of all elements.

Returns:
a new Collection of all elements

listIterator

java.util.ListIterator<T> listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.

Parameters:
index -
Returns:
a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list

toArray

java.lang.Object[] toArray()
Returns an array containing all of the elements in this list in proper sequence (from first to last element).

Returns:
an array containing all of the elements in this list in proper sequence (from first to last element)

getSelection

Selection<T> getSelection()
Returns the selection of this list.

Returns:
the selection of this list