Package org.gephi.appearance
Class FunctionImpl
- java.lang.Object
-
- org.gephi.appearance.FunctionImpl
-
- All Implemented Interfaces:
Function
- Direct Known Subclasses:
AttributeFunctionImpl,GraphFunctionImpl,SimpleFunctionImpl
public abstract class FunctionImpl extends Object implements Function
- Author:
- mbastian
-
-
Field Summary
Fields Modifier and Type Field Description protected org.gephi.graph.api.Columncolumnprotected Class<? extends org.gephi.graph.api.Element>elementClassprotected WeakReference<org.gephi.graph.api.Graph>lastGraphprotected booleanlastTransformNullValuesprotected AppearanceModelImplmodelprotected Stringnameprotected PartitionImplpartitionprotected RankingImplrankingprotected Transformertransformerprotected TransformerUItransformerUIprotected AtomicIntegerversion
-
Constructor Summary
Constructors Modifier Constructor Description protectedFunctionImpl(AppearanceModelImpl model, String name, Class<? extends org.gephi.graph.api.Element> elementClass, org.gephi.graph.api.Column column, Transformer transformer, TransformerUI transformerUI, PartitionImpl partition, RankingImpl ranking)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Class<? extends org.gephi.graph.api.Element>getElementClass()Returns the element class this function will be applied to.org.gephi.graph.api.GraphgetGraph()Returns the graph this function is being applied on.StringgetId()Returns the function's unique identifier.AppearanceModelImplgetModel()Returns the model this function belongs to.TransformergetTransformer()Returns the transformer associated with this function.TransformerUIgetUI()Returns the transformer user interface associated with this function.booleanhasChanged()Returns true if the underlying partition or ranking changed its boundaries or values since last time checked.inthashCode()booleanisAttribute()Returns true if this function is based on attribute column.booleanisPartition()Returns true if this function is a partition function.booleanisRanking()Returns true if this function is a ranking function.booleanisSimple()Returns true if this function is a simple function.booleanisValid()Returns true if the function is valid.StringtoString()voidtransform(org.gephi.graph.api.Element element)Transforms the given element.voidtransformAll(Iterable<? extends org.gephi.graph.api.Element> elementIterable)Transforms all the given elements.private voidtransformPartition(org.gephi.graph.api.Element element, org.gephi.graph.api.Graph graph)private voidtransformRanking(org.gephi.graph.api.Element element, org.gephi.graph.api.Graph graph, Number minValue, Number maxValue)
-
-
-
Field Detail
-
model
protected final AppearanceModelImpl model
-
elementClass
protected final Class<? extends org.gephi.graph.api.Element> elementClass
-
name
protected final String name
-
column
protected final org.gephi.graph.api.Column column
-
transformer
protected final Transformer transformer
-
transformerUI
protected final TransformerUI transformerUI
-
partition
protected final PartitionImpl partition
-
ranking
protected final RankingImpl ranking
-
version
protected final AtomicInteger version
-
lastGraph
protected WeakReference<org.gephi.graph.api.Graph> lastGraph
-
lastTransformNullValues
protected boolean lastTransformNullValues
-
-
Constructor Detail
-
FunctionImpl
protected FunctionImpl(AppearanceModelImpl model, String name, Class<? extends org.gephi.graph.api.Element> elementClass, org.gephi.graph.api.Column column, Transformer transformer, TransformerUI transformerUI, PartitionImpl partition, RankingImpl ranking)
-
-
Method Detail
-
transform
public void transform(org.gephi.graph.api.Element element)
Description copied from interface:FunctionTransforms the given element.
-
transformAll
public void transformAll(Iterable<? extends org.gephi.graph.api.Element> elementIterable)
Description copied from interface:FunctionTransforms all the given elements.- Specified by:
transformAllin interfaceFunction- Parameters:
elementIterable- element iterable to tranform
-
transformPartition
private void transformPartition(org.gephi.graph.api.Element element, org.gephi.graph.api.Graph graph)
-
transformRanking
private void transformRanking(org.gephi.graph.api.Element element, org.gephi.graph.api.Graph graph, Number minValue, Number maxValue)
-
hasChanged
public boolean hasChanged()
Description copied from interface:FunctionReturns true if the underlying partition or ranking changed its boundaries or values since last time checked.- Specified by:
hasChangedin interfaceFunction- Returns:
- true if changed, false otherwise
-
isValid
public boolean isValid()
Description copied from interface:FunctionReturns true if the function is valid. A function may not be valid if the underlying column has been removed for instance.
-
getGraph
public org.gephi.graph.api.Graph getGraph()
Description copied from interface:FunctionReturns the graph this function is being applied on.
-
getTransformer
public Transformer getTransformer()
Description copied from interface:FunctionReturns the transformer associated with this function.- Specified by:
getTransformerin interfaceFunction- Returns:
- transformer
-
getUI
public TransformerUI getUI()
Description copied from interface:FunctionReturns the transformer user interface associated with this function.
-
isSimple
public boolean isSimple()
Description copied from interface:FunctionReturns true if this function is a simple function.If true, this instance can be casted to
SimpleFunction.
-
isAttribute
public boolean isAttribute()
Description copied from interface:FunctionReturns true if this function is based on attribute column.If true, this instance can be casted to
AttributeFunction.- Specified by:
isAttributein interfaceFunction- Returns:
- true if attribute, false otherwise
-
isPartition
public boolean isPartition()
Description copied from interface:FunctionReturns true if this function is a partition function.If true, this instance can be casted to
PartitionFunction.- Specified by:
isPartitionin interfaceFunction- Returns:
- true if partition, false otherwise
-
isRanking
public boolean isRanking()
Description copied from interface:FunctionReturns true if this function is a ranking function.If true, this instance can be casted to
RankingFunction.
-
getElementClass
public Class<? extends org.gephi.graph.api.Element> getElementClass()
Description copied from interface:FunctionReturns the element class this function will be applied to.- Specified by:
getElementClassin interfaceFunction- Returns:
- element class
-
getModel
public AppearanceModelImpl getModel()
Description copied from interface:FunctionReturns the model this function belongs to.
-
getId
public String getId()
Description copied from interface:FunctionReturns the function's unique identifier.
-
-