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

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

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

Minimal interface for presentation models with list-editing capabilities.

Author:
Michael Karneim

Method Summary
 void addListListener(ListListener l)
          Adds a ListListener to this model.
 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 l)
          Removes a ListListener from this model.
 int size()
          Returns the number of elements in this collection.
 void sortBy(boolean ascending, Path... path)
           
 void sortBy(java.util.Collection<SortKey> newSortKeys)
           
 void sortBy(SortKey... sortKeys)
           
 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 java.lang.Iterable
iterator
 

Method Detail

addListListener

void addListListener(ListListener l)
Adds a ListListener to this model.

Parameters:
l -

removeListListener

void removeListListener(ListListener l)
Removes a ListListener from this model.

Parameters:
l -

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)

sortBy

void sortBy(java.util.Collection<SortKey> newSortKeys)

sortBy

void sortBy(SortKey... sortKeys)

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


© 2010 by Michael Karneim, http://www.beanfabrics.org