toxTree.tree
Class RulesList

java.lang.Object
  extended by java.util.Observable
      extended by toxTree.tree.RulesList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<IDecisionRule>, java.util.Collection<IDecisionRule>, java.util.List<IDecisionRule>, IDecisionRuleList, XMLSerializable

public class RulesList
extends java.util.Observable
implements IDecisionRuleList, XMLSerializable

List of IDecisionRule

Author:
Nina Jeliazkova Modified 2005-8-2
See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList<IDecisionRule> list
           
 
Fields inherited from interface toxTree.core.XMLSerializable
xmltag_CATEGORIES, xmltag_CATEGORY, xmltag_CATEGORYTHRESHOLD, xmltag_CLASS, xmltag_EXPLANATION, xmltag_ID, xmltag_METHOD, xmltag_METHODPARAMETER, xmltag_METHODS, xmltag_NAME, xmltag_RULE, xmltag_RULEEXAMPLE, xmltag_RULES, xmltag_TREEROOT
 
Constructor Summary
RulesList()
           
RulesList(java.lang.String[] customRules)
          Creates RulesList given the names of IDecisionRule classes Example : RulesList(new String[] { "toxTree.tree.rules.RuleSubstructure", "toxTree.tree.rules.RuleAromatic"}); Rules are created from corresponding class names
 
Method Summary
 boolean add(IDecisionRule arg0)
          Adds an object only if it is a rule IDecisionRule otherwise returns false
 void add(int arg0, IDecisionRule arg1)
          not implemented
 boolean addAll(java.util.Collection arg0)
          Adds all objects from the Collection TODO verify if objects are IDecisionRule
 boolean addAll(int arg0, java.util.Collection arg1)
           
 void addRule(IDecisionRule rule)
          adds a rule IDecisionRule
 void clear()
           
 boolean contains(java.lang.Object arg0)
           
 boolean containsAll(java.util.Collection arg0)
           
 boolean equals(java.lang.Object arg0)
           
 void fromXML(org.w3c.dom.Element xml)
           
 IDecisionRule get(int arg0)
           
 java.util.ArrayList getList()
           
 IDecisionRule getRule(int index)
          returns a rule IDecisionRule
 int hashCode()
           
 int indexOf(java.lang.Object arg0)
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 int lastIndexOf(java.lang.Object arg0)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int arg0)
           
 IDecisionRule remove(int arg0)
           
 boolean remove(java.lang.Object arg0)
           
 boolean removeAll(java.util.Collection arg0)
           
 boolean retainAll(java.util.Collection arg0)
           
 IDecisionRule set(int arg0, IDecisionRule arg1)
           
 void setList(java.util.ArrayList list)
           
 void setRules(java.lang.String[] customRules)
          Sets RulesList given the names of IDecisionRule classes Example : setRules(new String[] { "toxTree.tree.rules.RuleSubstructure", "toxTree.tree.rules.RuleAromatic"}); Rules are created from corresponding class names
 int size()
           
 java.util.List subList(int arg0, int arg1)
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] arg0)
           
 org.w3c.dom.Element toShallowXML(org.w3c.dom.Document document)
           
 java.lang.String toString()
           
 org.w3c.dom.Element toXML(org.w3c.dom.Document document)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

list

protected java.util.ArrayList<IDecisionRule> list
Constructor Detail

RulesList

public RulesList()

RulesList

public RulesList(java.lang.String[] customRules)
          throws DecisionMethodException
Creates RulesList given the names of IDecisionRule classes Example : RulesList(new String[] { "toxTree.tree.rules.RuleSubstructure", "toxTree.tree.rules.RuleAromatic"}); Rules are created from corresponding class names

Parameters:
customRules -
Throws:
DecisionMethodException
Method Detail

setRules

public void setRules(java.lang.String[] customRules)
              throws DecisionMethodException
Sets RulesList given the names of IDecisionRule classes Example : setRules(new String[] { "toxTree.tree.rules.RuleSubstructure", "toxTree.tree.rules.RuleAromatic"}); Rules are created from corresponding class names

Specified by:
setRules in interface IDecisionRuleList
Parameters:
customRules -
Throws:
DecisionMethodException

addRule

public void addRule(IDecisionRule rule)
adds a rule IDecisionRule

Specified by:
addRule in interface IDecisionRuleList

getRule

public IDecisionRule getRule(int index)
returns a rule IDecisionRule

Specified by:
getRule in interface IDecisionRuleList

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

size

public int size()
Specified by:
size in interface java.util.Collection<IDecisionRule>
Specified by:
size in interface java.util.List<IDecisionRule>

addAll

public boolean addAll(java.util.Collection arg0)
Adds all objects from the Collection TODO verify if objects are IDecisionRule

Specified by:
addAll in interface java.util.Collection<IDecisionRule>
Specified by:
addAll in interface java.util.List<IDecisionRule>

add

public void add(int arg0,
                IDecisionRule arg1)
not implemented

Specified by:
add in interface java.util.List<IDecisionRule>

add

public boolean add(IDecisionRule arg0)
Adds an object only if it is a rule IDecisionRule otherwise returns false

Specified by:
add in interface java.util.Collection<IDecisionRule>
Specified by:
add in interface java.util.List<IDecisionRule>

addAll

public boolean addAll(int arg0,
                      java.util.Collection arg1)
Specified by:
addAll in interface java.util.List<IDecisionRule>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<IDecisionRule>
Specified by:
clear in interface java.util.List<IDecisionRule>

contains

public boolean contains(java.lang.Object arg0)
Specified by:
contains in interface java.util.Collection<IDecisionRule>
Specified by:
contains in interface java.util.List<IDecisionRule>

containsAll

public boolean containsAll(java.util.Collection arg0)
Specified by:
containsAll in interface java.util.Collection<IDecisionRule>
Specified by:
containsAll in interface java.util.List<IDecisionRule>

equals

public boolean equals(java.lang.Object arg0)
Specified by:
equals in interface java.util.Collection<IDecisionRule>
Specified by:
equals in interface java.util.List<IDecisionRule>
Overrides:
equals in class java.lang.Object

get

public IDecisionRule get(int arg0)
Specified by:
get in interface java.util.List<IDecisionRule>

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection<IDecisionRule>
Specified by:
hashCode in interface java.util.List<IDecisionRule>
Overrides:
hashCode in class java.lang.Object

indexOf

public int indexOf(java.lang.Object arg0)
Specified by:
indexOf in interface java.util.List<IDecisionRule>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<IDecisionRule>
Specified by:
isEmpty in interface java.util.List<IDecisionRule>

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable<IDecisionRule>
Specified by:
iterator in interface java.util.Collection<IDecisionRule>
Specified by:
iterator in interface java.util.List<IDecisionRule>

lastIndexOf

public int lastIndexOf(java.lang.Object arg0)
Specified by:
lastIndexOf in interface java.util.List<IDecisionRule>

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List<IDecisionRule>

listIterator

public java.util.ListIterator listIterator(int arg0)
Specified by:
listIterator in interface java.util.List<IDecisionRule>

remove

public IDecisionRule remove(int arg0)
Specified by:
remove in interface java.util.List<IDecisionRule>

remove

public boolean remove(java.lang.Object arg0)
Specified by:
remove in interface java.util.Collection<IDecisionRule>
Specified by:
remove in interface java.util.List<IDecisionRule>

removeAll

public boolean removeAll(java.util.Collection arg0)
Specified by:
removeAll in interface java.util.Collection<IDecisionRule>
Specified by:
removeAll in interface java.util.List<IDecisionRule>

retainAll

public boolean retainAll(java.util.Collection arg0)
Specified by:
retainAll in interface java.util.Collection<IDecisionRule>
Specified by:
retainAll in interface java.util.List<IDecisionRule>

set

public IDecisionRule set(int arg0,
                         IDecisionRule arg1)
Specified by:
set in interface java.util.List<IDecisionRule>

subList

public java.util.List subList(int arg0,
                              int arg1)
Specified by:
subList in interface java.util.List<IDecisionRule>

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<IDecisionRule>
Specified by:
toArray in interface java.util.List<IDecisionRule>

toArray

public java.lang.Object[] toArray(java.lang.Object[] arg0)
Specified by:
toArray in interface java.util.Collection<IDecisionRule>
Specified by:
toArray in interface java.util.List<IDecisionRule>

fromXML

public void fromXML(org.w3c.dom.Element xml)
             throws XMLDecisionMethodException
Specified by:
fromXML in interface XMLSerializable
Throws:
XMLDecisionMethodException

toShallowXML

public org.w3c.dom.Element toShallowXML(org.w3c.dom.Document document)
                                 throws XMLDecisionMethodException
Specified by:
toShallowXML in interface XMLSerializable
Throws:
XMLDecisionMethodException

toXML

public org.w3c.dom.Element toXML(org.w3c.dom.Document document)
                          throws XMLDecisionMethodException
Specified by:
toXML in interface XMLSerializable
Throws:
XMLDecisionMethodException

getList

public java.util.ArrayList getList()

setList

public void setList(java.util.ArrayList list)


Copyright © 2004-2012 Ideaconsult Ltd.. All Rights Reserved.