edu.mas.kern
Class LIST<C>

java.lang.Object
  extended by edu.mas.kern.LIST<C>

public class LIST<C>
extends java.lang.Object

MAS and SAC2/Aldes LIST emulation and adaptor class.

Author:
Heinz Kredel

Field Summary
protected  java.util.Iterator<C> iter
          Internal iterator.
protected  java.util.LinkedList<C> list
          Internal data structure.
static LIST<?> SIL
           
 
Constructor Summary
  LIST()
          LIST constructor.
protected LIST(java.util.LinkedList<C> l)
          internal LIST constructor.
  LIST(java.util.List<C> l)
          LIST constructor.
 
Method Summary
static
<C> LIST<C>
CCONC(LIST<C> L1, LIST<C> L2)
          Constructive concatenation.
static
<C> LIST<C>
CINV(LIST<C> L)
          Constructive inverse.
static long CLOCK()
          Clock.
static
<C> LIST<C>
COMP(C a, LIST<C> L)
          Composition. a is an object.
static
<C> LIST<C>
COMP2(C a, C b, LIST<C> L)
          Composition 2. a and b are objects.
static
<C> LIST<C>
COMP3(C a, C b, C c, C d, LIST<C> L)
          Composition 4. a1, a2, a3 and a4 are objects.
static
<C> LIST<C>
COMP3(C a, C b, C c, LIST<C> L)
          Composition 3. a1, a2 and a3 are objects.
static
<C> LIST<C>
CONC(LIST<C> L1, LIST<C> L2)
          Concatenation.
static
<C> boolean
EQUAL(LIST<C> L1, LIST<C> L2)
          Equal. a and b are objects. t=true if a and b are equal and otherwise t=false.
static
<C> int
EXTENT(LIST<C> L)
          Extent.
static
<C> C
FIRST(LIST<C> L)
          First.
static
<C> C
FOURTH(LIST<C> L)
          Fourth.
static
<C> LIST<C>
INV(LIST<C> L)
          Inverse.
static
<C> boolean
isEmpty(LIST<C> L)
          Is empty.
protected static
<C> boolean
isNull(LIST<C> L)
          Is null.
static
<C> C
LELT(LIST<C> L, int i)
          List element.
static
<C> int
LENGTH(LIST<C> L)
          Length.
static
<C> LIST<C>
LIST1(C a)
          List, 1 element. a in an object.
static
<C> LIST<C>
LIST10(C a1, C a2, C a3, C a4, C a5, C a6, C a7, C a8, C a9, C a10)
          List, 10 elements. a1, a2, a3, a4, a5, a6, a7, a8, a9 and a10 are objects.
static
<C> LIST<C>
LIST2(C a, C b)
          List, 2 elements. a and b are objects.
static
<C> LIST<C>
LIST3(C a, C b, C c)
          List, 3 elements. a1, a2 and a3 are objects.
static
<C> LIST<C>
LIST4(C a, C b, C c, C d)
          List, 4 elements. a1, a2, a3 and a4 are objects.
static
<C> LIST<C>
LIST5(C a, C b, C c, C d, C e)
          List, 5 elements. a1,a2,a3,a4 and a5 are objects.
static
<C> int
ORDER(LIST<C> L)
          Order.
static
<C> LIST<C>
RED(LIST<C> L)
          Reductum.
static
<C> LIST<C>
RED2(LIST<C> L, int i)
          Reductum 2.
static
<C> LIST<C>
RED3(LIST<C> L, int i)
          Reductum 3.
static
<C> LIST<C>
RED4(LIST<C> L, int i)
          Reductum 4.
static
<C> LIST<C>
REDUCT(LIST<C> L, int i)
          Reductum.
static
<C> C
SECOND(LIST<C> L)
          Second.
static
<C> void
SFIRST(LIST<C> L, C a)
          Set first.
static
<C> void
SRED(LIST<C> L, LIST<C> LP)
          Set reductum.
static
<C> C
THIRD(LIST<C> L)
          Third.
 java.lang.String toString()
          To string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIL

public static final LIST<?> SIL

list

protected java.util.LinkedList<C> list
Internal data structure.


iter

protected java.util.Iterator<C> iter
Internal iterator.

Constructor Detail

LIST

public LIST()
LIST constructor.


LIST

protected LIST(java.util.LinkedList<C> l)
internal LIST constructor.

Parameters:
l -

LIST

public LIST(java.util.List<C> l)
LIST constructor.

Parameters:
l - any Java List
Method Detail

isNull

protected static <C> boolean isNull(LIST<C> L)
Is null. Test if the list L is null.


isEmpty

public static <C> boolean isEmpty(LIST<C> L)
Is empty. Test if the list L is empty.


LENGTH

public static <C> int LENGTH(LIST<C> L)
Length. L is a list. Returns length(L).


FIRST

public static <C> C FIRST(LIST<C> L)
First. L is a non-null list. a is the first element of L.


RED

public static <C> LIST<C> RED(LIST<C> L)
Reductum. L is a non-null list. Returns the reductum of L.


SFIRST

public static <C> void SFIRST(LIST<C> L,
                              C a)
Set first. L is a non-null list. a is a list. The first element of L is changed to a.


SRED

public static <C> void SRED(LIST<C> L,
                            LIST<C> LP)
Set reductum. L is a non-null list. LP is a list. The reductum of L is changed to LP.


COMP

public static <C> LIST<C> COMP(C a,
                               LIST<C> L)
Composition. a is an object. L is a list. Returns the composition of a and L.


toString

public java.lang.String toString()
To string.

Overrides:
toString in class java.lang.Object

REDUCT

public static <C> LIST<C> REDUCT(LIST<C> L,
                                 int i)
Reductum. A is a list. i is a non-negative beta-integer not less than LENGTH(A). B=A, if i=0. Otherwise, B is the i-th reductum of A.


RED2

public static <C> LIST<C> RED2(LIST<C> L,
                               int i)
Reductum 2. L is a list of length 2 or more. LP=RED(RED(L)).


RED3

public static <C> LIST<C> RED3(LIST<C> L,
                               int i)
Reductum 3. L is a list of length 3 or more. M is the third reductum of L.


RED4

public static <C> LIST<C> RED4(LIST<C> L,
                               int i)
Reductum 4. L is a list of length 4 or more. M is the fourth reductum of L.


CLOCK

public static long CLOCK()
Clock. Returns the current CPU clock reading in milliseconds. Intervalls are system dependent.


LELT

public static <C> C LELT(LIST<C> L,
                         int i)
List element. A is a list. 1 le i le LENGTH(A). a is the i-th element of A.


SECOND

public static <C> C SECOND(LIST<C> L)
Second. L is a list of length 2 or more. a is the second element of L.


THIRD

public static <C> C THIRD(LIST<C> L)
Third. L is a list of length 3 or more. a is the third element of L.


FOURTH

public static <C> C FOURTH(LIST<C> L)
Fourth. L is a list of length 4 or more. a is the fourth element of L.


CCONC

public static <C> LIST<C> CCONC(LIST<C> L1,
                                LIST<C> L2)
Constructive concatenation. L1 and L2 are lists. L is the concatenation of L1 and L2. The list L is constructed.


CINV

public static <C> LIST<C> CINV(LIST<C> L)
Constructive inverse. L is a list. M=INV(L). M is constructed using COMP.


INV

public static <C> LIST<C> INV(LIST<C> L)
Inverse. L is a list. The inverse of L is returned. The list L is modified.


COMP2

public static <C> LIST<C> COMP2(C a,
                                C b,
                                LIST<C> L)
Composition 2. a and b are objects. L is a list. M=COMP(a,COMP(b,L)).


COMP3

public static <C> LIST<C> COMP3(C a,
                                C b,
                                C c,
                                LIST<C> L)
Composition 3. a1, a2 and a3 are objects. L is a list. M=COMP(a1,COMP(a2,COMP(a3,L))).


COMP3

public static <C> LIST<C> COMP3(C a,
                                C b,
                                C c,
                                C d,
                                LIST<C> L)
Composition 4. a1, a2, a3 and a4 are objects. L is a list. M=COMP(a1,COMP(a2,COMP(a3,COMP(a4,l)))).


CONC

public static <C> LIST<C> CONC(LIST<C> L1,
                               LIST<C> L2)
Concatenation. L1 and L2 are lists. L=CONC(L1,L2). The list L1 is modified.


EQUAL

public static <C> boolean EQUAL(LIST<C> L1,
                                LIST<C> L2)
Equal. a and b are objects. t=true if a and b are equal and otherwise t=false.


EXTENT

public static <C> int EXTENT(LIST<C> L)
Extent. L is a list. n the number of cells of L.


LIST1

public static <C> LIST<C> LIST1(C a)
List, 1 element. a in an object. L is the list (a).


LIST10

public static <C> LIST<C> LIST10(C a1,
                                 C a2,
                                 C a3,
                                 C a4,
                                 C a5,
                                 C a6,
                                 C a7,
                                 C a8,
                                 C a9,
                                 C a10)
List, 10 elements. a1, a2, a3, a4, a5, a6, a7, a8, a9 and a10 are objects. L is the list (a1,a2,a3,a4,a5,a6,a7,a8,a9,a10).


LIST2

public static <C> LIST<C> LIST2(C a,
                                C b)
List, 2 elements. a and b are objects. L is the list (a,b).


LIST3

public static <C> LIST<C> LIST3(C a,
                                C b,
                                C c)
List, 3 elements. a1, a2 and a3 are objects. L=(a1,a2,a3).


LIST4

public static <C> LIST<C> LIST4(C a,
                                C b,
                                C c,
                                C d)
List, 4 elements. a1, a2, a3 and a4 are objects. L is the list (a1,a2,a3,a4).


LIST5

public static <C> LIST<C> LIST5(C a,
                                C b,
                                C c,
                                C d,
                                C e)
List, 5 elements. a1,a2,a3,a4 and a5 are objects. L is the list (a1,a2,a3,a4,a5).


ORDER

public static <C> int ORDER(LIST<C> L)
Order. L is a list. maximal depth of L.