Package org.gephi.appearance
Class AttributePartitionImpl
- java.lang.Object
-
- org.gephi.appearance.PartitionImpl
-
- org.gephi.appearance.AttributePartitionImpl
-
- All Implemented Interfaces:
Partition
public class AttributePartitionImpl extends PartitionImpl
- Author:
- mbastian
-
-
Field Summary
Fields Modifier and Type Field Description protected WeakReference<org.gephi.graph.api.Column>column-
Fields inherited from class org.gephi.appearance.PartitionImpl
colorMap
-
Fields inherited from interface org.gephi.appearance.api.Partition
DEFAULT_COLOR
-
-
Constructor Summary
Constructors Constructor Description AttributePartitionImpl(org.gephi.graph.api.Column column)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcount(Object value, org.gephi.graph.api.Graph graph)Returns the number of elements for the given value.booleanequals(Object obj)org.gephi.graph.api.ColumngetColumn()Returns the column associated with this partition.intgetElementCount(org.gephi.graph.api.Graph graph)Returns the number of elements that have a value in this partition.private org.gephi.graph.api.Index<org.gephi.graph.api.Element>getIndex(org.gephi.graph.api.Graph graph)ObjectgetValue(org.gephi.graph.api.Element element, org.gephi.graph.api.Graph graph)Returns the element's value for this partition.CollectiongetValues(org.gephi.graph.api.Graph graph)Returns the collection of values this partition represents.ClassgetValueType()intgetVersion(org.gephi.graph.api.Graph graph)inthashCode()booleanisValid(org.gephi.graph.api.Graph graph)floatpercentage(Object value, org.gephi.graph.api.Graph graph)Returns the percentage of elements with the given value.intsize(org.gephi.graph.api.Graph graph)Returns the number of values this partition represents.-
Methods inherited from class org.gephi.appearance.PartitionImpl
getColor, getSortedValues, setColor, setColors
-
-
-
-
Field Detail
-
column
protected final WeakReference<org.gephi.graph.api.Column> column
-
-
Method Detail
-
getValue
public Object getValue(org.gephi.graph.api.Element element, org.gephi.graph.api.Graph graph)
Description copied from interface:PartitionReturns the element's value for this partition.- Parameters:
element- element to get the value forgraph- graph this element belongs to- Returns:
- the value for this partition
-
getIndex
private org.gephi.graph.api.Index<org.gephi.graph.api.Element> getIndex(org.gephi.graph.api.Graph graph)
-
getValues
public Collection getValues(org.gephi.graph.api.Graph graph)
Description copied from interface:PartitionReturns the collection of values this partition represents. Each value has at least one element.- Parameters:
graph- graph this partition applies to- Returns:
- values
-
getElementCount
public int getElementCount(org.gephi.graph.api.Graph graph)
Description copied from interface:PartitionReturns the number of elements that have a value in this partition.- Parameters:
graph- graph this partition applies to- Returns:
- element count
-
count
public int count(Object value, org.gephi.graph.api.Graph graph)
Description copied from interface:PartitionReturns the number of elements for the given value.- Parameters:
value- valuegraph- graph this partition applies to- Returns:
- value count
-
percentage
public float percentage(Object value, org.gephi.graph.api.Graph graph)
Description copied from interface:PartitionReturns the percentage of elements with the given value.- Parameters:
value- value- Returns:
- percentage, between zero and 100
-
size
public int size(org.gephi.graph.api.Graph graph)
Description copied from interface:PartitionReturns the number of values this partition represents.- Parameters:
graph- this element belongs to- Returns:
- value count
-
getColumn
public org.gephi.graph.api.Column getColumn()
Description copied from interface:PartitionReturns the column associated with this partition.- Returns:
- column or null if partition not based on a column
-
getValueType
public Class getValueType()
- Specified by:
getValueTypein classPartitionImpl
-
isValid
public boolean isValid(org.gephi.graph.api.Graph graph)
- Specified by:
isValidin classPartitionImpl
-
getVersion
public int getVersion(org.gephi.graph.api.Graph graph)
- Specified by:
getVersionin classPartitionImpl
-
-