|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fun4j.Cons
public class Cons
Simple Binary Tree. This class represents a Lisp cons object. All Lisp data structures are internally represented as conses.
| Constructor Summary | |
|---|---|
Cons(java.lang.Object head,
java.lang.Object tail)
constructs a new Cons based on head and tail |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
getHd()
returns the head of a the Cons object |
java.lang.Object |
getTl()
returns the tail of a Cons object. |
java.lang.String |
prettyPrint()
simple prettyprinting for Cons objects. |
java.lang.String |
prettyPrint1(int depth,
int length,
int indent)
pretty print a Cons respecting printdepth and printlength |
static java.math.BigInteger |
printdepth(java.math.BigInteger newValue)
set the printdepth for list printing. |
static java.lang.Integer |
printdepth(java.lang.Integer newValue)
set the printdepth for list printing. |
static java.math.BigInteger |
printlength(java.math.BigInteger newValue)
set the printlength for list printing. |
static java.lang.Integer |
printlength(java.lang.Integer newValue)
set the printlength for list printing. |
void |
setHd(java.lang.Object hd)
sets the head of this Cons object |
void |
setTl(java.lang.Object tl)
sets the tail of a Cons object |
java.lang.String |
toString()
|
java.lang.String |
toString1(int depth,
int length)
print out a Cons respecting printdepth and printlength |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Cons(java.lang.Object head,
java.lang.Object tail)
head - the head Objecttail - the tail Object| Method Detail |
|---|
public java.lang.Object getHd()
public void setHd(java.lang.Object hd)
hd - the new head elementpublic java.lang.Object getTl()
public void setTl(java.lang.Object tl)
tl - the tail to setpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic static java.lang.Integer printdepth(java.lang.Integer newValue)
newValue - the new value
public static java.lang.Integer printlength(java.lang.Integer newValue)
newValue - the new value
public static java.math.BigInteger printdepth(java.math.BigInteger newValue)
newValue - the new value
public static java.math.BigInteger printlength(java.math.BigInteger newValue)
newValue - the new value
public java.lang.String toString()
toString in class java.lang.Object
public java.lang.String toString1(int depth,
int length)
depth - length -
public java.lang.String prettyPrint()
public java.lang.String prettyPrint1(int depth,
int length,
int indent)
depth - length - indent -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||