Gephi Toolkit Javadoc

org.gephi.ranking.api
Interface Ranking<Element>


public interface Ranking<Element>

Rankings role is to provide numerical values from objects. These values are then send to transformer to be converted in visual signs (e.g. color or size).

For instance for nodes, ranking can be the degree of the node or a numerical value like an 'age' or 'duration'.

The getElementType() method should return either Ranking.NODE_ELEMENT or Ranking.EDGE_ELEMENT to define if it works with node or edge elements. This is important because it defines which objects the getValue() eventually receives. For nodes, it is given a NodeData object and for edges a EdgeData.

One can reuse the AbstractRanking class defined in the RankingPlugin module.

Author:
Mathieu Bastian
See Also:
Transformer

Field Summary
static java.lang.String DEGREE_RANKING
          Default in degree ranking's name
static java.lang.String EDGE_ELEMENT
          Element type for edges.
static java.lang.String INDEGREE_RANKING
          Default out degree ranking's name
static java.lang.String NODE_ELEMENT
          Element type for nodes.
static java.lang.String OUTDEGREE_RANKING
          Default out degree ranking's name
 
Method Summary
 java.lang.String getDisplayName()
          Returns the display name of this ranking.
 java.lang.String getElementType()
          Return the type of element this ranking is manipulating.
 java.lang.Number getMaximumValue()
          Returns the maximum value of this ranking.
 java.lang.Number getMinimumValue()
          Returns the minimum value of this ranking.
 java.lang.String getName()
          Returns the name of this ranking.
 java.lang.Number getValue(Element element)
          Returns the value of the element.
 float normalize(java.lang.Number value)
          Normalize value between 0 and 1 using the minimum and the maximum value.
 java.lang.Number unNormalize(float normalizedValue)
          Unnormalize normalizedValue and returns the original element value.
 

Field Detail

NODE_ELEMENT

static final java.lang.String NODE_ELEMENT
Element type for nodes. The ranking receives a NodeData object.

See Also:
Constant Field Values

EDGE_ELEMENT

static final java.lang.String EDGE_ELEMENT
Element type for edges. The ranking receives a EdgeData object.

See Also:
Constant Field Values

DEGREE_RANKING

static final java.lang.String DEGREE_RANKING
Default in degree ranking's name

See Also:
Constant Field Values

INDEGREE_RANKING

static final java.lang.String INDEGREE_RANKING
Default out degree ranking's name

See Also:
Constant Field Values

OUTDEGREE_RANKING

static final java.lang.String OUTDEGREE_RANKING
Default out degree ranking's name

See Also:
Constant Field Values
Method Detail

getValue

java.lang.Number getValue(Element element)
Returns the value of the element.

Parameters:
element - the element to get the value from
Returns:
the element's value

getMinimumValue

java.lang.Number getMinimumValue()
Returns the minimum value of this ranking.

Returns:
the minimum value

getMaximumValue

java.lang.Number getMaximumValue()
Returns the maximum value of this ranking.

Returns:
the maximum value

normalize

float normalize(java.lang.Number value)
Normalize value between 0 and 1 using the minimum and the maximum value. For example if value is equal to the maximum, it returns 1.0.

Parameters:
value - the value to normalize
Returns:
the normalized value between zero and one

unNormalize

java.lang.Number unNormalize(float normalizedValue)
Unnormalize normalizedValue and returns the original element value.

Parameters:
normalizedValue - the value to unnormalize
Returns:
the original value of the element

getDisplayName

java.lang.String getDisplayName()
Returns the display name of this ranking.

Returns:
the display name of this ranking

getName

java.lang.String getName()
Returns the name of this ranking. It should be unique.

Returns:
the name of this ranking

getElementType

java.lang.String getElementType()
Return the type of element this ranking is manipulating. Value can either be Ranking.NODE_ELEMENT or Ranking.EDGE_ELEMENT.

Returns:
the type of element this ranking is manipulating

Gephi Toolkit Javadoc