All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class list.List

java.lang.Object
   |
   +----list.List

public class List
extends Object
Dies ist eine Implementierung von funktionalen Listen mit einer Konstanten nil, die die leere Liste repräsentiert und einer Klassenmethode cons(hd,tl) für die Cons-Operation. Jedesmal, wenn eine Element zu einer Liste hinzugefügt wird, wird ein neue Liste erzeugt anstatt die alte Liste zu verändern.

Author:
Hubert Baumeister

Variable Index

 o nil
Die Konstante nil repräsentiert die leere Liste.

Method Index

 o add(Object)
Es wird eine neue Liste erzeugt mit Kopf hd und this als dem Rest.
 o add(Object[])
Diese Operation fügt alle Elemente des Arrays der Reihe nach zu this hinzu.
 o append(List)
Fügt die Liste l an this an.
 o cons(Object, List)
Diese Operation erzeugt eine neue Liste mit hd als Kopf und tl als Rest.
 o hd()
Gibt den Kopf von this zurück.
 o isNil()
Liefert true, wenn this die leere Liste ist, false sonst.
 o tl()
Gibt this ohne den Kopf zurück.

Variables

 o nil
  public final static List nil
Die Konstante nil repräsentiert die leere Liste.

Methods

 o cons
  public static List cons(Object hd,
                          List tl)
Diese Operation erzeugt eine neue Liste mit hd als Kopf und tl als Rest.

 o hd
  public abstract Object hd()
Gibt den Kopf von this zurück. Es wird eine EmptyListException erzeugt, falls this keine Elemente enthält.

 o tl
  public abstract List tl()
Gibt this ohne den Kopf zurück. Es wird eine EmptyListException erzeugt, falls this keine Elemente enthält.

 o append
  public abstract List append(List l)
Fügt die Liste l an this an.

 o isNil
  public boolean isNil()
Liefert true, wenn this die leere Liste ist, false sonst.

 o add
  public List add(Object o)
Es wird eine neue Liste erzeugt mit Kopf hd und this als dem Rest.

 o add
  public List add(Object oa[])
Diese Operation fügt alle Elemente des Arrays der Reihe nach zu this hinzu.


All Packages  Class Hierarchy  This Package  Previous  Next  Index

Imprint | Data Protection