cfa.vo.iris.utils
Interface IList<T>

All Superinterfaces:
Iterable<T>
All Known Subinterfaces:
IXSed, IXSegment<T>
All Known Implementing Classes:
List, XSed, XSegment

public interface IList<T>
extends Iterable<T>

In the SED domain, list of objects might be inconsistent even though the objects come from the same classe. For example an SED must have segments with interconvertible units. This interfaces allows to define "more-than-type-safe" lists, since its add methods throw an exception when some sort of consistency check fails. Also, this interface supports IDs for lists.

Author:
olaurino

Method Summary
 void add(int position, T element)
          Add an element in a certain position.
 boolean add(T element)
          Add an element to this list.
 boolean addAll(Collection<? extends T> elements)
          Add a collection of elements this list.
 boolean addAll(IList<? extends T> elements)
          Add an IList of elements to this list.
 T get(int i)
           
 String getId()
          Get the ID string for this list.
 boolean isEmpty()
          Check whether this list is empty.
 boolean remove(T element)
          Remove an element from this list.
 void setId(String id)
          Set the ID string for this list.
 int size()
          Get the size of this list.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getId

String getId()
Get the ID string for this list.

Returns:
The ID string.

setId

void setId(String id)
Set the ID string for this list.

Parameters:
id - The ID string.

add

boolean add(T element)
            throws SedException
Add an element to this list.

Parameters:
element - The element to be added.
Returns:
Throws:
SedException - An Exception is thrown when the element fails a compatibility check.

addAll

boolean addAll(Collection<? extends T> elements)
               throws SedException
Add a collection of elements this list.

Parameters:
elements - The elements to be added.
Returns:
Throws:
SedException - An Exception is thrown when an element in the collection fails a compatibility check.

addAll

boolean addAll(IList<? extends T> elements)
               throws SedException
Add an IList of elements to this list.

Parameters:
elements - The elements to be added.
Returns:
Throws:
SedException - An Exception is thrown when an element in the IList fails a compatibility check.

add

void add(int position,
         T element)
         throws SedException
Add an element in a certain position.

Parameters:
position - The position in which the element has to be added.
element - The element to be added.
Throws:
SedException - SedException An Exception is thrown when the element fails a compatibility check.

remove

boolean remove(T element)
Remove an element from this list.

Parameters:
element - The element to be removed.
Returns:

size

int size()
Get the size of this list.

Returns:
the size of this list as a int.

isEmpty

boolean isEmpty()
Check whether this list is empty.

Returns:
True if the list is empty.

get

T get(int i)


Copyright © 2013. All rights reserved.