org.ckkloverdos.tuple
Class ListTuple

java.lang.Object
  extended by org.ckkloverdos.tuple.TupleSkeleton
      extended by org.ckkloverdos.tuple.ListTuple
All Implemented Interfaces:
ITuple

public class ListTuple
extends TupleSkeleton

A ITuple implementation backed by a List.

Author:
Christos KK Loverdos

Constructor Summary
ListTuple(java.util.List list)
          Constructs the tuple from the list.
 
Method Summary
 java.lang.Object get(int n)
          Returns the nth element of the tuple.
 boolean isEmpty()
          Returns true iff this tuple contains no elements.
 boolean isNull(int n)
          Returns true iff the nth element of the tuple is null.
 int size()
          Returns the size of this tuple.
 
Methods inherited from class org.ckkloverdos.tuple.TupleSkeleton
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListTuple

public ListTuple(java.util.List list)
Constructs the tuple from the list.

Parameters:
list -
Method Detail

get

public java.lang.Object get(int n)
Returns the nth element of the tuple. Indices start from zero.

Parameters:
n -
Throws:
java.lang.IndexOutOfBoundsException - if the index n is beyond the bounds of this tuple.
java.lang.NullPointerException - if the underlying list is null.

size

public int size()
Returns the size of this tuple. If the underlying list is null, then it returns zero.


isNull

public boolean isNull(int n)
Returns true iff the nth element of the tuple is null.

Parameters:
n -
Throws:
java.lang.IndexOutOfBoundsException - if the index n is beyond the bounds of this tuple.
java.lang.NullPointerException - if the underlying list is null.

isEmpty

public boolean isEmpty()
Returns true iff this tuple contains no elements. If the underlying list is null, then it returns true.



Copyright © 1999-2007 Christos KK Loverdos. All Rights Reserved.