public interface Partition
This interface has access to the underlying index so it can return the complete collection of different values, as well as the number of elements with this value.
Note that null
can be a valid value.
Colors can be associated with values.
Modifier and Type | Method and Description |
---|---|
int |
count(Object value)
Returns the number of elements for the given value.
|
Color |
getColor(Object value)
Returns the color for the given value.
|
Column |
getColumn()
Returns the column associated with this partition.
|
int |
getElementCount()
Returns the number of elements that have a value in this partition.
|
Collection |
getSortedValues()
Returns the same collection as
getValues() but sorted
descendant in counts. |
Object |
getValue(Element element,
Graph graph)
Returns the element's value for this partition.
|
Collection |
getValues()
Returns the collection of values this partition represents.
|
float |
percentage(Object value)
Returns the percentage of elements with the given value.
|
void |
setColor(Object value,
Color color)
Sets the color for the given value.
|
void |
setColors(Color[] colors)
Sets the colors for all values.
|
int |
size()
Returns the number of values this partition represents.
|
Collection getValues()
Collection getSortedValues()
getValues()
but sorted
descendant in counts.int getElementCount()
int count(Object value)
value
- valueObject getValue(Element element, Graph graph)
element
- element to get the value forgraph
- graph this element belongs toColor getColor(Object value)
value
- value to get the color forvoid setColor(Object value, Color color)
value
- value to set the color forcolor
- colorvoid setColors(Color[] colors)
colors
must be
equal to size()
.colors
- colors to setfloat percentage(Object value)
value
- valueint size()
Column getColumn()
Copyright © 2007–2017 Gephi Consortium. All rights reserved.