jfun.jaskell
Class ListLiteral

java.lang.Object
  extended byjfun.util.List
      extended byjfun.jaskell.ListLiteral
All Implemented Interfaces:
java.io.Serializable, jfun.util.Sizeable

public final class ListLiteral
extends jfun.util.List

A literal list that's backed by an array.

Author:
Ben Yu Apr 4, 2006 2:15:57 PM
See Also:
Serialized Form

Field Summary
 
Fields inherited from class jfun.util.List
nil
 
Constructor Summary
ListLiteral(int from, int end, java.lang.Object[] arr)
          To create a ListLiteral object.
ListLiteral(int from, java.lang.Object[] arr)
          To create a ListLiteral object.
ListLiteral(java.lang.Object[] arr)
          To create a ListLiteral object.
 
Method Summary
 java.lang.Object head()
           
 boolean isEmpty()
           
 jfun.util.List rev()
           
 jfun.util.List revAppend(jfun.util.List l)
           
 java.lang.Object[] revArray(int ind, java.lang.Object[] buf)
           
 int size()
           
 jfun.util.List tail()
           
 java.lang.Object[] toArray(int ind, java.lang.Object[] buf)
           
 void toList(java.util.List to)
           
 java.lang.String toString()
           
 
Methods inherited from class jfun.util.List
cons, equals, fromArray, fromArray, hashCode, revArray, revArray, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListLiteral

public ListLiteral(java.lang.Object[] arr)
To create a ListLiteral object.

Parameters:
arr - the array object backing the list.

ListLiteral

public ListLiteral(int from,
                   java.lang.Object[] arr)
To create a ListLiteral object.

Parameters:
from - the starting index in the array.
arr - the array object backing the list.

ListLiteral

public ListLiteral(int from,
                   int end,
                   java.lang.Object[] arr)
To create a ListLiteral object.

Parameters:
from - the starting index in the array.
end - the ending index in the array, exclusive.
arr - the array object backing the list.
Method Detail

isEmpty

public boolean isEmpty()

head

public java.lang.Object head()

tail

public jfun.util.List tail()

rev

public jfun.util.List rev()

revAppend

public jfun.util.List revAppend(jfun.util.List l)

size

public int size()

revArray

public java.lang.Object[] revArray(int ind,
                                   java.lang.Object[] buf)

toArray

public java.lang.Object[] toArray(int ind,
                                  java.lang.Object[] buf)

toList

public void toList(java.util.List to)

toString

public java.lang.String toString()