public class Initializer extends java.lang.Object implements java.lang.Cloneable, Traversable
| Constructor and Description |
|---|
Initializer(Expression value)
Constructs a new initializer with the specified initializing value.
|
Initializer(Expression designator,
Expression value)
Constructs a new designated initializer with the given designator and the
initial value.
|
Initializer(Expression designator,
java.util.List values)
Constructs a new initializer with the specified designator and the list
of values.
|
Initializer(java.util.List values)
Constructs a new initializer with the specified list of values.
|
| Modifier and Type | Method and Description |
|---|---|
Initializer |
clone() |
static void |
defaultPrint(Initializer i,
java.io.PrintWriter o)
Prints an initializer to the specified writer.
|
java.util.List<Traversable> |
getChildren()
Provides access to the children of this object as a list.
|
Expression |
getDesignator() |
Traversable |
getParent()
Provides access to the parent of this object.
|
void |
print(java.io.PrintWriter o)
Prints an initializer object by calling its default print method.
|
void |
removeChild(Traversable child)
Removes the specified child.
|
void |
setChild(int index,
Traversable t)
Sets the indexth child of this object to t.
|
static void |
setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently
created objects will use the supplied method.
|
void |
setParent(Traversable t)
Sets the parent of this object.
|
void |
setPrintMethod(java.lang.reflect.Method m)
Overrides the print method for this object only.
|
java.lang.String |
toString()
Converts this initializer to a string by calling the default print method.
|
public Initializer(Expression value)
value - the initializing value expression.public Initializer(Expression designator, Expression value)
designator - the designator for a member or an element.value - the initial value.public Initializer(java.util.List values)
values - the list of initializing values.public Initializer(Expression designator, java.util.List values)
designator - the designator for a member or an element.values - the list of initializing values.public Initializer clone()
clone in class java.lang.Objectpublic static void defaultPrint(Initializer i, java.io.PrintWriter o)
i - The initializer to print.o - The writer on which to print the initializer.public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<Traversable> getChildren()
TraversablegetChildren in interface Traversablepublic Traversable getParent()
TraversablegetParent in interface Traversablepublic Expression getDesignator()
public void print(java.io.PrintWriter o)
public void removeChild(Traversable child)
TraversableremoveChild in interface Traversablechild - a reference to a child object that must match with ==.public void setChild(int index,
Traversable t)
TraversablesetChild in interface Traversablepublic static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.public void setParent(Traversable t)
TraversablesetParent in interface Traversablepublic void setPrintMethod(java.lang.reflect.Method m)
m - The new print method.