patron
Class NotEmpty

java.lang.Object
  extended by patron.List
      extended by patron.NotEmpty

public class NotEmpty
extends List

la classe des listes non vides.

Author:
jroyer

Field Summary
 int head
          le champ tete.
 List tail
          le champ reste.
 
Constructor Summary
NotEmpty(int e, List l)
          le constructeur indispensable.
 
Method Summary
 List append(List l)
          concatenation purement fonctionnelle.
 boolean isEmpty()
          teste la liste vide.
 int length()
          la longueur.
 NotEmpty putLast(int e)
          ajout a la fin purement fonctionnelle.
 List reverse()
          inversion purement fonctionnelle.
 java.lang.String toString()
          redefinition.
 
Methods inherited from class patron.List
cons
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

head

public int head
le champ tete.


tail

public List tail
le champ reste.

Constructor Detail

NotEmpty

public NotEmpty(int e,
                List l)
le constructeur indispensable.

Parameters:
e - la tete de liste
l - le reste de la liste
Method Detail

isEmpty

public final boolean isEmpty()
teste la liste vide.

Specified by:
isEmpty in class List
Returns:
un booleen

length

public final int length()
la longueur.

Specified by:
length in class List
Returns:
un entier

append

public final List append(List l)
concatenation purement fonctionnelle.

Specified by:
append in class List
Parameters:
l - autre liste
Returns:
une liste

putLast

public final NotEmpty putLast(int e)
ajout a la fin purement fonctionnelle.

Specified by:
putLast in class List
Parameters:
e - a ajouter
Returns:
nouvelle liste

reverse

public final List reverse()
inversion purement fonctionnelle.

Specified by:
reverse in class List
Returns:
une liste

toString

public final java.lang.String toString()
redefinition.

Specified by:
toString in class List
Returns:
une chaine