Package org.gephi.appearance
Class EdgeTypePartitionImpl
- java.lang.Object
-
- org.gephi.appearance.PartitionImpl
-
- org.gephi.appearance.EdgeTypePartitionImpl
-
- All Implemented Interfaces:
Partition
public class EdgeTypePartitionImpl extends PartitionImpl
- Author:
- mbastian
-
-
Field Summary
Fields Modifier and Type Field Description private org.gephi.graph.api.Columncolumnprivate ClassvalueType-
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 EdgeTypePartitionImpl(org.gephi.graph.api.Column column, Class valueType)
-
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.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.Edge>getIndex(org.gephi.graph.api.Graph graph)ObjectgetValue(org.gephi.graph.api.Element element, org.gephi.graph.api.Graph gr)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)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
-
valueType
private final Class valueType
-
column
private final org.gephi.graph.api.Column column
-
-
Constructor Detail
-
EdgeTypePartitionImpl
public EdgeTypePartitionImpl(org.gephi.graph.api.Column column, Class valueType)
-
-
Method Detail
-
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
-
getValue
public Object getValue(org.gephi.graph.api.Element element, org.gephi.graph.api.Graph gr)
Description copied from interface:PartitionReturns the element's value for this partition.- Parameters:
element- element to get the value forgr- graph this element belongs to- Returns:
- the value for this partition
-
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
-
getIndex
private org.gephi.graph.api.Index<org.gephi.graph.api.Edge> getIndex(org.gephi.graph.api.Graph graph)
-
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
-
-