tom.library.sl
Class VisitableIntrospector

java.lang.Object
  extended by tom.library.sl.VisitableIntrospector
All Implemented Interfaces:
Introspector

public class VisitableIntrospector
extends Object
implements Introspector


Method Summary
 Object getChildAt(Object o, int i)
          Return the i-th subterm of the object o
 int getChildCount(Object o)
          Return the number of subterms of the object o
 Object[] getChildren(Object o)
          Return the children of a given object
static Introspector getInstance()
           
 Object setChildAt(Object o, int i, Object child)
          Replace the i-th subterm of the object o by child
 Object setChildren(Object o, Object[] children)
          Replace all children of a given object, and return the new object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Introspector getInstance()

setChildren

public Object setChildren(Object o,
                          Object[] children)
Description copied from interface: Introspector
Replace all children of a given object, and return the new object

Specified by:
setChildren in interface Introspector
Parameters:
o - the object whose children are replace
children - the new subterm of the object

getChildren

public Object[] getChildren(Object o)
Description copied from interface: Introspector
Return the children of a given object

Specified by:
getChildren in interface Introspector
Parameters:
o - the subject

setChildAt

public Object setChildAt(Object o,
                         int i,
                         Object child)
Description copied from interface: Introspector
Replace the i-th subterm of the object o by child

Specified by:
setChildAt in interface Introspector
Parameters:
o - the subject
i - the index of the subterm
child - the new subterm

getChildAt

public Object getChildAt(Object o,
                         int i)
Description copied from interface: Introspector
Return the i-th subterm of the object o

Specified by:
getChildAt in interface Introspector
Parameters:
o - the subject
i - the index of the subterm (0<=i<=childCount)

getChildCount

public int getChildCount(Object o)
Description copied from interface: Introspector
Return the number of subterms of the object o

Specified by:
getChildCount in interface Introspector
Parameters:
o - the subject
Returns:
the number of children