Tea Java Runtime API
Version 3.1.0

com.pdmfc.tea.runtime
Class SObjPair

java.lang.Object
  |
  +--com.pdmfc.tea.runtime.SObjPair

public class SObjPair
extends java.lang.Object

Implements a pair. A list can easily be built with this kind of objects.


Field Summary
 java.lang.Object _car
          The left hand side object of the pair.
 java.lang.Object _cdr
          The right hand side object of the pair.
 
Constructor Summary
SObjPair()
          Builds a pair with nothing inside it.
SObjPair(java.lang.Object car, java.lang.Object cdr)
          Builds a pair containing two objects.
 
Method Summary
 java.util.Enumeration elements()
          Deprecated. Use iterator().
static SObjPair emptyList()
          Creates a pair representing an empty list.
 java.util.Iterator iterator()
          Builds an java.util.Iterator that will orderly iterator over the elements in the list whose head is this SObjPair object.
 int length()
          Determines the size of the list starting with this node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_car

public java.lang.Object _car
The left hand side object of the pair.

_cdr

public java.lang.Object _cdr
The right hand side object of the pair.
Constructor Detail

SObjPair

public SObjPair()
Builds a pair with nothing inside it.

SObjPair

public SObjPair(java.lang.Object car,
                java.lang.Object cdr)
Builds a pair containing two objects.
Parameters:
car - The left hand side object.
cdr - The right hand side object.
Method Detail

emptyList

public static SObjPair emptyList()
Creates a pair representing an empty list.
Returns:
A newly created SObjPair object representing the empty list.

length

public int length()
           throws SRuntimeException
Determines the size of the list starting with this node.
Returns:
The number of nodes in the list, starting with this node.
Throws:
SRuntimeException - Thrown if the list starting with this node is not properly formed.

elements

public java.util.Enumeration elements()
Deprecated. Use iterator().

Builds an java.util.Enumeration that will orderly iterator over the elements in the list whose head is this SObjPair object.
Returns:
A newly created java.util.Enumeration object that will iterate over the list elements.

iterator

public java.util.Iterator iterator()
Builds an java.util.Iterator that will orderly iterator over the elements in the list whose head is this SObjPair object.
Returns:
A newly created java.util.Iterator object that will iterate over the list elements.

Tea Java Runtime API
Version 3.1.0

© 2002 PDM&FC, All Rights Reserved.