next up previous
Next: About this document ... Up: Demeter/Java User Manual Version Previous: Further Reading

Subsections

Appendix

 

Construction Class Interface

A construction class ``A'' with field ``B b'' has the following public methods.

B get_b()
 -- returns field b

void set_b(B)
 -- sets field b

static A parse(java.io.InputStream in)
static A parse(String s)
 -- returns an object constructed according to the grammar specified
    in the class dictionary

Repetition Class Interface

A repetition (collection) class ``A'' with members of type ``B'' has the following public methods.

void addElement(B)
 -- adds an element to the back of the list

boolean contains(B)
 -- uses B.equals() to check if an element is in the collection

java.util.Enumeration elements()
 -- if you don't want to use the Enumeration methods directly

boolean hasMoreElements()
 -- complements nextElement()

boolean isEmpty()
 -- is the list empty?

Object nextElement()
 -- makes an imperative change to the collection object
    (you can run through the list only once)

void push(B)
 -- adds an element to the front of the list

static A parse(java.io.InputStream in)
static A parse(String s)
 -- returns an object constructed according to the grammar specified
    in the class dictionary



Joshua C. Marshall
12/2/1998