Class SchemePair
java.lang.Object
|
+--SchemeObject
|
+--SchemeList
|
+--SchemePair
- public class SchemePair
- extends SchemeList
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SchemePair
public SchemePair(SchemeObject theCar,
SchemeObject theCdr)
SchemePair
public SchemePair()
getCar
public SchemeObject getCar()
- Description copied from class:
SchemeObject
- Dealing with the static type system of Java is not convenient
when manipulating SchemeObjects because Scheme itself is
denamically typed. To make manipulating Scheme objects and
lists in particular more convenient we make all SchemeObjects
provide a
getCar()
and getCdr()
method. If the object is not a SchemePair
then
these methods should through a ClassCastException. As such,
the following are equivalent:
SchemeObject o = ...;
System.out.println(o.getCar());
and
SchemeObject o = ...;
Scheme.out.println(((SchemePair)o).getCar());
- Overrides:
getCar
in class SchemeObject
- Following copied from class:
SchemeObject
- Returns:
- The
car
of the SchemePair
. - Throws:
ClassCastException
- if this object does not override this method.- See Also:
SchemePair
getCdr
public SchemeObject getCdr()
- Description copied from class:
SchemeObject
- Dealing with the static type system of Java is not convenient
when manipulating SchemeObjects because Scheme itself is
denamically typed. To make manipulating Scheme objects and
lists in particular more convenient we make all SchemeObjects
provide a
getCar()
and getCdr()
method. If the object is not a SchemePair
then
these methods should through a ClassCastException. As such,
the following are equivalent:
SchemeObject o = ...;
System.out.println(o.getCdr());
and
SchemeObject o = ...;
Scheme.out.println(((SchemePair)o).getCdr());
- Overrides:
getCdr
in class SchemeObject
- Following copied from class:
SchemeObject
- Returns:
- The
cdr
of the SchemePair
. - Throws:
ClassCastException
- if this object does not override this method.- See Also:
SchemePair
getNext
public SchemePair getNext()
setCar
public void setCar(SchemeObject newCar)
setCdr
public void setCdr(SchemeObject newCdr)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
inListToString
public java.lang.String inListToString()