cfa.vo.iris.utils
Class List<T>

java.lang.Object
  extended by cfa.vo.iris.utils.List<T>
All Implemented Interfaces:
IList<T>, Iterable<T>
Direct Known Subclasses:
XSed, XSegment

public class List<T>
extends Object
implements IList<T>

Author:
olaurino

Constructor Summary
List()
           
List(Collection<T> elements)
           
List(String id)
           
List(String id, IList<T> elements)
           
 
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.
static
<T> IList<T>
filter(IList<T> target, IPredicate<T> predicate, String id)
           
 T get(int i)
           
protected  ArrayList<T> getElements()
           
 String getId()
          Get the ID string for this list.
 boolean isEmpty()
          Check whether this list is empty.
 Iterator<T> iterator()
           
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

List

public List()

List

public List(String id)

List

public List(String id,
            IList<T> elements)

List

public List(Collection<T> elements)
Method Detail

getId

public String getId()
Description copied from interface: IList
Get the ID string for this list.

Specified by:
getId in interface IList<T>
Returns:
The ID string.

setId

public void setId(String id)
Description copied from interface: IList
Set the ID string for this list.

Specified by:
setId in interface IList<T>
Parameters:
id - The ID string.

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>

add

public boolean add(T element)
            throws SedException
Description copied from interface: IList
Add an element to this list.

Specified by:
add in interface IList<T>
Parameters:
element - The element to be added.
Returns:
Throws:
SedException - An Exception is thrown when the element fails a compatibility check.

addAll

public boolean addAll(Collection<? extends T> elements)
               throws SedException
Description copied from interface: IList
Add a collection of elements this list.

Specified by:
addAll in interface IList<T>
Parameters:
elements - The elements to be added.
Returns:
Throws:
SedException - An Exception is thrown when an element in the collection fails a compatibility check.

add

public void add(int position,
                T element)
         throws SedException
Description copied from interface: IList
Add an element in a certain position.

Specified by:
add in interface IList<T>
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

public boolean remove(T element)
Description copied from interface: IList
Remove an element from this list.

Specified by:
remove in interface IList<T>
Parameters:
element - The element to be removed.
Returns:

getElements

protected final ArrayList<T> getElements()

filter

public static <T> IList<T> filter(IList<T> target,
                                  IPredicate<T> predicate,
                                  String id)

addAll

public boolean addAll(IList<? extends T> elements)
               throws SedException
Description copied from interface: IList
Add an IList of elements to this list.

Specified by:
addAll in interface IList<T>
Parameters:
elements - The elements to be added.
Returns:
Throws:
SedException - An Exception is thrown when an element in the IList fails a compatibility check.

size

public int size()
Description copied from interface: IList
Get the size of this list.

Specified by:
size in interface IList<T>
Returns:
the size of this list as a int.

isEmpty

public boolean isEmpty()
Description copied from interface: IList
Check whether this list is empty.

Specified by:
isEmpty in interface IList<T>
Returns:
True if the list is empty.

get

public T get(int i)
Specified by:
get in interface IList<T>


Copyright © 2013. All rights reserved.