hypercast
Class NeighborhoodStats

java.lang.Object
  |
  +--hypercast.NeighborhoodStats
All Implemented Interfaces:
I_Stats

public class NeighborhoodStats
extends java.lang.Object
implements I_Stats

A stats entry for a neghbor


Field Summary
 hypercast.I_AddressPair addressPair
          Address pair of this neighbor
 
Constructor Summary
NeighborhoodStats(hypercast.I_AddressPair ap)
          Constructor.
NeighborhoodStats(hypercast.I_AddressPair ap, java.lang.String statsName)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Check if the given object (a address piar instance) matchs the addres pair in this object.
 org.w3c.dom.Element[] getReadSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath)
          Return the schema element which represents the root of the sub-tree, specified by the given xpath, in read schema tree.
 org.w3c.dom.Element[] getStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath)
          Return the result of query for the statistics specified by the given xpath.
 java.lang.String getStatsName()
          Gets the element name of this I_Stats instance.
 org.w3c.dom.Element[] getWriteSchema(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath)
          Return the schema element which represents the root of the sub-tree, specified by the given xpath, in write schema tree.
 void set(hypercast.NeighborhoodStats entry)
          Set the value of this entry by another entry
 org.w3c.dom.Element[] setStats(org.w3c.dom.Document doc, org.apache.xpath.XPath xpath, org.w3c.dom.Element newValue)
          Set the statistics specified by the given xpath.
 void setStatsName(java.lang.String name)
          Assigns a name to this I_Stats instance.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

addressPair

public hypercast.I_AddressPair addressPair
Address pair of this neighbor

Constructor Detail

NeighborhoodStats

public NeighborhoodStats(hypercast.I_AddressPair ap)
Constructor.


NeighborhoodStats

public NeighborhoodStats(hypercast.I_AddressPair ap,
                         java.lang.String statsName)
Constructor.

Method Detail

set

public void set(hypercast.NeighborhoodStats entry)
Set the value of this entry by another entry

Parameters:
entry -

equals

public boolean equals(java.lang.Object obj)
Check if the given object (a address piar instance) matchs the addres pair in this object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - an instance of I_AddressPair.

getStats

public org.w3c.dom.Element[] getStats(org.w3c.dom.Document doc,
                                      org.apache.xpath.XPath xpath)
                               throws HyperCastStatsException
Return the result of query for the statistics specified by the given xpath.

Specified by:
getStats in interface I_Stats
Parameters:
doc - Document used for create new elements or nodes.
xpath - XPath instance represents the statistics to be queried.
Throws:
HyperCastStatsException - If the xpath does not specify a valid subtree.
See Also:
I_Stats.getStats(org.w3c.dom.Document, org.apache.xpath.XPath)

setStats

public org.w3c.dom.Element[] setStats(org.w3c.dom.Document doc,
                                      org.apache.xpath.XPath xpath,
                                      org.w3c.dom.Element newValue)
                               throws HyperCastStatsException
Set the statistics specified by the given xpath. The value actually set is returned.

Specified by:
setStats in interface I_Stats
Parameters:
doc - Document used for create new elements or nodes.
xpath - XPath instance represents the statistics to be queried.
newValue - Element representing the value or sub-tree to be set.
Throws:
HyperCastStatsException - If the xpath does not specify a valid subtree or if any part of the the subtree is read-only, or if the newValue does not conform with the expected format.
See Also:
I_Stats.setStats(org.w3c.dom.Document, org.apache.xpath.XPath, org.w3c.dom.Element)

getReadSchema

public org.w3c.dom.Element[] getReadSchema(org.w3c.dom.Document doc,
                                           org.apache.xpath.XPath xpath)
                                    throws HyperCastStatsException
Return the schema element which represents the root of the sub-tree, specified by the given xpath, in read schema tree.

Specified by:
getReadSchema in interface I_Stats
Parameters:
doc - Document used for create new elements or nodes.
xpath - XPath instance representing the statistics which is the root of the sub-tree to be queried.
Throws:
HyperCastStatsException - If some part of the specified subtree does not correctly implement this interface method.
See Also:
I_Stats.getReadSchema(Document, XPath)

getWriteSchema

public org.w3c.dom.Element[] getWriteSchema(org.w3c.dom.Document doc,
                                            org.apache.xpath.XPath xpath)
                                     throws HyperCastStatsException
Return the schema element which represents the root of the sub-tree, specified by the given xpath, in write schema tree.

Specified by:
getWriteSchema in interface I_Stats
Parameters:
doc - Document used for create new elements or nodes.
xpath - XPath instance representing the statistics which is the root of the sub-tree to be queried.
Throws:
HyperCastStatsException - If some part of the specified subtree does not correctly implement this interface method.
See Also:
I_Stats.getWriteSchema(Document, XPath)

getStatsName

public java.lang.String getStatsName()
Description copied from interface: I_Stats
Gets the element name of this I_Stats instance. The element name is originally assigned from the attribute StstsName in the configuration file, and can be changed by this method.

Specified by:
getStatsName in interface I_Stats
See Also:
I_Stats.getStatsName()

setStatsName

public void setStatsName(java.lang.String name)
Description copied from interface: I_Stats
Assigns a name to this I_Stats instance. The assigned name becomes the tag of the element associated to this I_Stats instance on the statistics tree.

Specified by:
setStatsName in interface I_Stats
Parameters:
name - the name assigned to the I_Stats instance.
See Also:
I_Stats.setStatsName(String)