ref_send API 2.17
defensive programming in Java

org.ref_send.list
Class List<T>

java.lang.Object
  extended by org.ref_send.list.List<T>
Type Parameters:
T - element type
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<T>

public final class List<T>
extends java.lang.Object
implements java.lang.Iterable<T>, java.io.Serializable

A linked list.

See Also:
Serialized Form

Method Summary
 void append(T value)
          Appends a value.
 Receiver<T> appender()
          Constructs an appender.
 T getFront()
          Gets the front value.
 long getSize()
          Gets the element count.
 boolean isEmpty()
          Is the element count zero?
 java.util.Iterator<T> iterator()
          Iterates over the values in this list.
static
<T> List<T>
list()
          Constructs a list.
 T pop()
          Removes the front element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

list

public static <T> List<T> list()
Constructs a list.

Type Parameters:
T - element type

iterator

public final java.util.Iterator<T> iterator()
Iterates over the values in this list.

Specified by:
iterator in interface java.lang.Iterable<T>
Returns:
forward iterator over this list

isEmpty

public boolean isEmpty()
Is the element count zero?


getSize

public long getSize()
Gets the element count.


getFront

public T getFront()
           throws java.lang.NullPointerException
Gets the front value.

Returns:
front value
Throws:
java.lang.NullPointerException - list is empty

pop

public T pop()
      throws java.lang.NullPointerException
Removes the front element.

Returns:
removed value
Throws:
java.lang.NullPointerException - list is empty

append

public void append(T value)
Appends a value.

Parameters:
value - value to append

appender

public Receiver<T> appender()
Constructs an appender.


ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.