netkit.classifiers.aggregators
Class AggregatorByValueImp

java.lang.Object
  extended by netkit.classifiers.aggregators.AggregatorImp
      extended by netkit.classifiers.aggregators.AggregatorByValueImp
All Implemented Interfaces:
Aggregator, AggregatorByValue
Direct Known Subclasses:
Count, Exist, Ratio

public abstract class AggregatorByValueImp
extends AggregatorImp
implements AggregatorByValue

This should be the parent class for any AggregatorByValue class. It sets up the basic structure for an AggregatorByValue and defines most of the needed API. The only thing needed to be implemented by any subclass is the getValue(Node, Estimate) method.

Author:
Sofus A. Macskassy (sofmac@gmail.com)

Field Summary
protected  double attributeValue
           
 
Fields inherited from class netkit.classifiers.aggregators.AggregatorImp
aggregateCache, attribIdx, attribute, edgeType, name, type
 
Constructor Summary
AggregatorByValueImp(java.lang.String aggName, EdgeType edgeType, Attribute attribute, Type type, double value)
          Specifies the core parameters needed to instantiate an AggregatorByValue class.
 
Method Summary
 double getAttributeValue()
          Gets the value value that is being aggregated on (e.g., how often did 'aquavit' appear would return the double value representing 'aquavit' in an AttributeCategorical)
 java.lang.String toString()
           
 
Methods inherited from class netkit.classifiers.aggregators.AggregatorImp
getAttribute, getAttributeIndex, getEdgeType, getName, getNodeInfo, getType, getValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface netkit.classifiers.aggregators.Aggregator
getAttribute, getEdgeType, getName, getType, getValue, getValue
 

Field Detail

attributeValue

protected final double attributeValue
Constructor Detail

AggregatorByValueImp

public AggregatorByValueImp(java.lang.String aggName,
                            EdgeType edgeType,
                            Attribute attribute,
                            Type type,
                            double value)
Specifies the core parameters needed to instantiate an AggregatorByValue class. This calls the standard aggregator constructor with all these parameters, which helps set the name and other internal variables. The name of the 'virtual' attribute is set in the AggregatorImp constructor.

Parameters:
aggName - The prefix name of this aggregator attribute
edgeType - The name of the relation to follow to find neighbor nodes to aggregate over
attribute - The attribute of neighboring nodes that should be aggregated on
type - The attribute type of this aggregator
value - The value to aggregate on (e.g., the double representing 'aquavit')
See Also:
AggregatorImp
Method Detail

getAttributeValue

public final double getAttributeValue()
Description copied from interface: AggregatorByValue
Gets the value value that is being aggregated on (e.g., how often did 'aquavit' appear would return the double value representing 'aquavit' in an AttributeCategorical)

Specified by:
getAttributeValue in interface AggregatorByValue
Returns:
the value passed in as the 'value' in the Constructor

toString

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