hypercast
Class StatsProcessor

java.lang.Object
  |
  +--hypercast.StatsProcessor

public class StatsProcessor
extends java.lang.Object

This class defines the functions of accessing to a set of statistics. Usually the instance of this class is created by an I_Stats object and handles the statistics defined in this I_Stats object.


Constructor Summary
StatsProcessor(hypercast.I_Stats statsObject, boolean readableFlag, boolean writableFlag)
           
 
Method Summary
 void addStatsElement(java.lang.String Name, hypercast.I_Stats statisticsObj, int minoccur, int maxoccur)
          Add a StatsElement instance into the StatsElement instance vector.
static boolean allElementsInVectorMatchGivenName(java.util.Vector vec, java.lang.String name)
          Check if the all Element instances in the given Vector match the given name.
 boolean containStatsElement(java.lang.String name)
          Check if the vector contains a StatsElement instance which has the given name.
static java.util.Vector getElementsFromElementArray(org.w3c.dom.Element[] el, java.lang.String name)
          Get the Vector that contains all Elements in the Element array which match the given name.
static java.util.Vector getElementsFromElementVector(java.util.Vector vec, java.lang.String name)
          Get the Vector that contains all Elements in the Element Vector which match the given name.
static java.util.Vector getNameListFromElementArray(org.w3c.dom.Element[] el)
          Get the name list of all different Element instances in the given Element array.
 int getNumOfStatistics()
          Get the size of StatsElement vector stored in this object.
 org.w3c.dom.Element[] getReadSchemaResult(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath)
          Return the Element which contains the read schema element for the stsitstics specified by parameter xpath.
 org.w3c.dom.Element[] getStatsResult(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath)
          Return the Element array which contains the value or sub-tree of stsitstics specified by parameter xpath.
 org.w3c.dom.Element[] getWriteSchemaResult(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath)
          Return the Element which contains the write schema element for the stsitstics specified by parameter xpath.
 boolean newValueArrayIsValid(org.w3c.dom.NodeList nl)
          Check if the node list (represents new value Element array) match the StatsElement instances in the StatsElement instance vector.
 void removeAllStatsElement()
          Remove all StatsElement instances in the StatsElement instance vector.
 void removeAllStatsElement(java.lang.String name)
          Remove all StatsElement instances in the StatsElement instance vector which have the given name.
 void removeStatsElement(hypercast.I_AddressPair addrPair)
          Remove the StatsElement instance in the StatsElement instance vector.
 void removeStatsElement(int index)
          Remove a StatsElement instance in the StatsElement instance vector which has given index value.
 void removeStatsElement(java.lang.Object obj)
          Remove the StatsElement instance in the StatsElement instance vector.
 void removeStatsElement(java.lang.String name, int index)
          Remove the StatsElement instance in the StatsElement instance vector.
 org.w3c.dom.Element[] setStatsResult(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath, org.w3c.dom.Element newValue)
          Set the value or sub-tree of stsitstics specified by xpath.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatsProcessor

public StatsProcessor(hypercast.I_Stats statsObject,
                      boolean readableFlag,
                      boolean writableFlag)
Method Detail

addStatsElement

public void addStatsElement(java.lang.String Name,
                            hypercast.I_Stats statisticsObj,
                            int minoccur,
                            int maxoccur)
Add a StatsElement instance into the StatsElement instance vector.


removeStatsElement

public void removeStatsElement(int index)
Remove a StatsElement instance in the StatsElement instance vector which has given index value.


removeStatsElement

public void removeStatsElement(java.lang.Object obj)
Remove the StatsElement instance in the StatsElement instance vector. The I_Stats object contains in this instance matchs the given object (by equals() operation).


removeStatsElement

public void removeStatsElement(hypercast.I_AddressPair addrPair)
Remove the StatsElement instance in the StatsElement instance vector. The I_Stats object contains in this instance matchs the given object (by equals() operation).


removeStatsElement

public void removeStatsElement(java.lang.String name,
                               int index)
Remove the StatsElement instance in the StatsElement instance vector. The removed StatsElement instance has the given index in the StatsElement instances which match the given names.


removeAllStatsElement

public void removeAllStatsElement()
Remove all StatsElement instances in the StatsElement instance vector.


removeAllStatsElement

public void removeAllStatsElement(java.lang.String name)
Remove all StatsElement instances in the StatsElement instance vector which have the given name.


getNumOfStatistics

public int getNumOfStatistics()
Get the size of StatsElement vector stored in this object.


containStatsElement

public boolean containStatsElement(java.lang.String name)
Check if the vector contains a StatsElement instance which has the given name.


getElementsFromElementArray

public static java.util.Vector getElementsFromElementArray(org.w3c.dom.Element[] el,
                                                           java.lang.String name)
Get the Vector that contains all Elements in the Element array which match the given name.


getElementsFromElementVector

public static java.util.Vector getElementsFromElementVector(java.util.Vector vec,
                                                            java.lang.String name)
Get the Vector that contains all Elements in the Element Vector which match the given name.


allElementsInVectorMatchGivenName

public static boolean allElementsInVectorMatchGivenName(java.util.Vector vec,
                                                        java.lang.String name)
Check if the all Element instances in the given Vector match the given name.


getNameListFromElementArray

public static java.util.Vector getNameListFromElementArray(org.w3c.dom.Element[] el)
Get the name list of all different Element instances in the given Element array.


newValueArrayIsValid

public boolean newValueArrayIsValid(org.w3c.dom.NodeList nl)
Check if the node list (represents new value Element array) match the StatsElement instances in the StatsElement instance vector.


getStatsResult

public org.w3c.dom.Element[] getStatsResult(org.w3c.dom.Document doc,
                                            org.apache.xpath.XPath xpath)
                                     throws HyperCastStatsException
Return the Element array which contains the value or sub-tree of stsitstics specified by parameter xpath.

HyperCastStatsException

setStatsResult

public org.w3c.dom.Element[] setStatsResult(org.w3c.dom.Document doc,
                                            org.apache.xpath.XPath xpath,
                                            org.w3c.dom.Element newValue)
                                     throws HyperCastStatsException
Set the value or sub-tree of stsitstics specified by xpath. The value or sub-tree actually set is returned as an Element or sub-tree.

HyperCastStatsException

getReadSchemaResult

public org.w3c.dom.Element[] getReadSchemaResult(org.w3c.dom.Document doc,
                                                 org.apache.xpath.XPath xpath)
                                          throws HyperCastStatsException
Return the Element which contains the read schema element for the stsitstics specified by parameter xpath.

HyperCastStatsException

getWriteSchemaResult

public org.w3c.dom.Element[] getWriteSchemaResult(org.w3c.dom.Document doc,
                                                  org.apache.xpath.XPath xpath)
                                           throws HyperCastStatsException
Return the Element which contains the write schema element for the stsitstics specified by parameter xpath.

HyperCastStatsException