|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetkit.util.Factory<Aggregator>
netkit.classifiers.aggregators.AggregatorFactory
public final class AggregatorFactory
This Factory class is a singleton class which creates Aggregators. It relies on the aggregator.properties file and on reflection to do this job. It is final and provides the logic based on whether an aggregator is by value or general. Any new aggregators should subclass AggregatorImp or AggregatorByValueImp and should then be added to the aggretator.properties file.
AggregatorByValueImp
,
AggregatorImp
,
Factory
Method Summary | |
---|---|
boolean |
canAggregate(java.lang.String name,
Attribute attrib)
Checks if the fully specified classname is an aggregator that can aggregate a given attribute. |
Aggregator |
get(java.lang.String name)
Get an instance of the fully named aggregator. |
Aggregator |
get(java.lang.String name,
Configuration defaultConf)
Get an instance of the fully named aggregator using a given Configuration map. |
Aggregator |
get(java.lang.String name,
EdgeType[] edgeTypes,
Attribute attribute)
This is not yet supported. |
Aggregator |
get(java.lang.String name,
EdgeType[] edgeTypes,
Attribute attribute,
Configuration defaultConf)
This is not yet supported. |
Aggregator |
get(java.lang.String name,
EdgeType[] edgeTypes,
Attribute attribute,
double value)
This is not yet supported. |
Aggregator |
get(java.lang.String name,
EdgeType[] edgeTypes,
Attribute attribute,
double value,
Configuration defaultConf)
This is not yet supported. |
Aggregator |
get(java.lang.String name,
EdgeType edgeType,
Attribute attribute)
Get an instance of the named general attribute aggregator for the given relation and attribute. |
Aggregator |
get(java.lang.String name,
EdgeType edgeType,
Attribute attribute,
Configuration defaultConf)
Get an instance of the named general attribute aggregator for the given relation and attribute. |
Aggregator |
get(java.lang.String name,
EdgeType edgeType,
Attribute attribute,
double value)
Get an instance of the named attribute aggregator-by-value for the given relation, attribute and value. |
Aggregator |
get(java.lang.String name,
EdgeType edgeType,
Attribute attribute,
double value,
Configuration defaultConf)
Get an instance of the named attribute aggregator-by-value for the given relation, attribute and value. |
static AggregatorFactory |
getInstance()
Getter method to get the singleton AggregatorFactory class. |
boolean |
isByValue(java.lang.String name)
Checks to see if the aggregator by the given name is an instance of AggregatorByValue |
Methods inherited from class netkit.util.Factory |
---|
getClassName, getConfig, getValidNames |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static AggregatorFactory getInstance()
public boolean isByValue(java.lang.String name)
name
- Name of the aggregator whose value to check. This is a fully specified class name.
AggregatorByValue
public boolean canAggregate(java.lang.String name, Attribute attrib)
name
- The fully specified class name of an aggregator whose capabilities are being checkedattrib
- The attribute that we want to aggregate with the named aggregator
public Aggregator get(java.lang.String name)
get
in class Factory<Aggregator>
name
- The fully specificed name of an aggregator.
java.lang.IllegalArgumentException
- Is always thrownpublic Aggregator get(java.lang.String name, Configuration defaultConf)
get
in class Factory<Aggregator>
name
- The fully specificed name of an aggregator.defaultConf
- A default configuration to use
java.lang.IllegalArgumentException
- Is always thrownpublic Aggregator get(java.lang.String name, EdgeType edgeType, Attribute attribute)
name
- The fully specified name of an aggregatoredgeType
- The name of a relationship used to find neighborsattribute
- The attribute to aggregate on
java.lang.RuntimeException
- If the named aggregator is not found in the aggregator.properties file or if there are any trouble instantiating the aggregator (such as the fact that it cannot aggregate the given attribute)Aggregator
,
canAggregate(String, netkit.graph.Attribute)
public Aggregator get(java.lang.String name, EdgeType edgeType, Attribute attribute, Configuration defaultConf)
name
- The fully specified name of an aggregatoredgeType
- The name of a relationship used to find neighborsattribute
- The attribute to aggregate ondefaultConf
- The default configuration to fall back on in case nothing appropriate is found in the 'aggregator.properties' file.
java.lang.RuntimeException
- If the named aggregator is not found in the aggregator.properties file or if there are any trouble instantiating the aggregator (such as the fact that it cannot aggregate the given attribute)Aggregator
,
canAggregate(String, netkit.graph.Attribute)
public Aggregator get(java.lang.String name, EdgeType edgeType, Attribute attribute, double value)
name
- The fully specified name of an aggregator (which should be of type AggregatorByValue)edgeType
- The name of a relationship used to find neighborsattribute
- The attribute to aggregate onvalue
- The double value representing the value of the attribute to aggregate on (e.g., 'aquavit')
java.lang.RuntimeException
- If the named aggregator is not found in the aggregator.properties file or if there are any trouble instantiating the aggregator (such as the fact that it cannot aggregate the given attribute)AggregatorByValue
,
canAggregate(String, netkit.graph.Attribute)
public Aggregator get(java.lang.String name, EdgeType edgeType, Attribute attribute, double value, Configuration defaultConf)
name
- The fully specified name of an aggregator (which should be of type AggregatorByValue)edgeType
- The name of a relationship used to find neighborsattribute
- The attribute to aggregate onvalue
- The double value representing the value of the attribute to aggregate on (e.g., 'aquavit')defaultConf
- The default configuration to fall back on in case nothing appropriate is found in the 'aggregator.properties' file.
java.lang.RuntimeException
- If the named aggregator is not found in the aggregator.properties file or if there are any trouble instantiating the aggregator (such as the fact that it cannot aggregate the given attribute)AggregatorByValue
,
canAggregate(String, netkit.graph.Attribute)
public Aggregator get(java.lang.String name, EdgeType[] edgeTypes, Attribute attribute)
name
- edgeTypes
- attribute
-
java.lang.UnsupportedOperationException
- is always thrownpublic Aggregator get(java.lang.String name, EdgeType[] edgeTypes, Attribute attribute, Configuration defaultConf)
name
- edgeTypes
- attribute
-
java.lang.UnsupportedOperationException
- is always thrownpublic Aggregator get(java.lang.String name, EdgeType[] edgeTypes, Attribute attribute, double value)
name
- edgeTypes
- attribute
-
java.lang.UnsupportedOperationException
- is always thrownpublic Aggregator get(java.lang.String name, EdgeType[] edgeTypes, Attribute attribute, double value, Configuration defaultConf)
name
- edgeTypes
- attribute
-
java.lang.UnsupportedOperationException
- is always thrown
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |