jfun.jaskell
Class ListLiteral

java.lang.Object
  extended by jfun.util.List
      extended by jfun.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()
Specified by:
isEmpty in interface jfun.util.Sizeable
Specified by:
isEmpty in class jfun.util.List

head

public java.lang.Object head()
Specified by:
head in class jfun.util.List

tail

public jfun.util.List tail()
Specified by:
tail in class jfun.util.List

rev

public jfun.util.List rev()
Overrides:
rev in class jfun.util.List

revAppend

public jfun.util.List revAppend(jfun.util.List l)
Specified by:
revAppend in class jfun.util.List

size

public int size()
Specified by:
size in interface jfun.util.Sizeable
Specified by:
size in class jfun.util.List

revArray

public java.lang.Object[] revArray(int ind,
                                   java.lang.Object[] buf)
Overrides:
revArray in class jfun.util.List

toArray

public java.lang.Object[] toArray(int ind,
                                  java.lang.Object[] buf)
Overrides:
toArray in class jfun.util.List

toList

public void toList(java.util.List to)
Overrides:
toList in class jfun.util.List

toString

public java.lang.String toString()
Overrides:
toString in class jfun.util.List