org.severe.jripples.eig
Class JRipplesEIGNode

java.lang.Object
  extended by org.severe.jripples.eig.JRipplesEIGNode
All Implemented Interfaces:
java.lang.Comparable, org.eclipse.core.runtime.IAdaptable

public class JRipplesEIGNode
extends java.lang.Object
implements org.eclipse.core.runtime.IAdaptable, java.lang.Comparable

JRipplesEIGNode class represents a node of the EIG (Evolving Interoperation Graph). Node serves as the container for the components of the project under analysis, as well as the container for the extra information that can be associated with this class like Incremental Change status(mark) and probability.

Author:
Maksym Petrenko
See Also:
JRipplesEIG

Constructor Summary
JRipplesEIGNode(org.eclipse.jdt.core.IMember member)
          Constructor - creates a node with the specified IMember and sets node's mark and probability to empty string.
Please note that nodes, created directly with the constructor, will not be handeleded in the EIG.
 
Method Summary
 int compareTo(JRipplesEIGNode node)
          Compares two nodes by comparing their underlying IMembers (see JRipplesIMemberServices.areSimilar(IMember, IMember)).
 int compareTo(java.lang.Object arg0)
           
 java.lang.Object getAdapter(java.lang.Class adapter)
          Provides an adapter for the IMember, IResource JRipplesEIGNode and String classes.
 java.lang.String getFullName()
          Returns node's fully qualified name.
 java.lang.String getMark()
          associates EIG mark with the node.
 org.eclipse.jdt.core.IMember getNodeIMember()
          Returns node's underlying IMember - the actual component of IMember type of the project ander analysis, which this node represents.
 java.lang.String getProbability()
          Return probability value associated with the node.
 java.lang.String getShortName()
          Returns node's short name - simple, human-readable string, which is used for node presentation in GUI.
 boolean isTop()
          Tests if the node is a top-level class.
 void setMark(java.lang.String mark)
          associates EIG mark with the node.
 void setProbability(java.lang.String probability)
          associate probability value with the node.
 java.lang.String toString()
          Returns node's fully qualified name - see getFullName().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JRipplesEIGNode

public JRipplesEIGNode(org.eclipse.jdt.core.IMember member)
Constructor - creates a node with the specified IMember and sets node's mark and probability to empty string.
Please note that nodes, created directly with the constructor, will not be handeleded in the EIG. To creare a node that is handeled by the EIG, use JRipplesEIG.addNode(IMember) instead.

Parameters:
member - IMember, which this node represents
Method Detail

getShortName

public java.lang.String getShortName()
Returns node's short name - simple, human-readable string, which is used for node presentation in GUI. Simple name is obtained by calling org.eclipse.jdt.core.IMember.getElementName(). Couple different nodes within the same EIG can have the same short name. Use getFullName() instead if you need to get node's unique name.

Returns:
short name of the node's underlying IMember if it is set, empty string otherwise

getFullName

public java.lang.String getFullName()
Returns node's fully qualified name. For if the underlying memeber is of type IType, the returned full name is equal to the fully qualified name of the node's underlying IMember. For IMethod and IField type of IMember, the full name is composed by taking fully qualified name of the top declaring class of this IMember, and adding the short name of the IMember to it, separated by a "::" string. Use getShortName() if you need to get node's simlple name to present this node in a GUI.

Returns:
fully qualified name of the underlying member if it is set, empty string otherwise

getMark

public java.lang.String getMark()
associates EIG mark with the node. Typically, EIG marks are used to denote the status of the node's underlying member during Incremental Change process.

Returns:
EIG mark of the node if there is a one; blank string otherwise.
See Also:
setMark(String)

getNodeIMember

public org.eclipse.jdt.core.IMember getNodeIMember()
Returns node's underlying IMember - the actual component of IMember type of the project ander analysis, which this node represents.

Returns:
underlying instance of IMember of the node if there is a one; null otherwise.
See Also:
setNodeIMember(IMember)

getProbability

public java.lang.String getProbability()
Return probability value associated with the node. Typically, probabilities are used to denote the probability of some event, that can happen with the node's underlying member. Probabilities can be evaluated through different software metrics during Incremental Change process.

Returns:
probability, associated with the node if there is a one; null otherwise.
See Also:
setProbability(String)

isTop

public boolean isTop()
Tests if the node is a top-level class. This is done by investigating underlying IMember java element.

Returns:
true, if the class is a top class; false otherwise.
See Also:
getNodeIMember()

setMark

public void setMark(java.lang.String mark)
associates EIG mark with the node. Typically, EIG marks are used to denote the status of the node's underlying member during Incremental Change process.

Parameters:
mark - EIG mark to be associated with this node
See Also:
getMark()

setProbability

public void setProbability(java.lang.String probability)
associate probability value with the node. Typically, probabilities are used to denote the probability of some event, that can happen with the node's underlying member. Probabilities can be evaluated through different software metrics during Incremental Change process.

Parameters:
probability - probability to be associated with this node
See Also:
getProbability()

toString

public java.lang.String toString()
Returns node's fully qualified name - see getFullName().

Overrides:
toString in class java.lang.Object
Returns:
node's fully qualified name - see getFullName() for more details.

compareTo

public int compareTo(JRipplesEIGNode node)
Compares two nodes by comparing their underlying IMembers (see JRipplesIMemberServices.areSimilar(IMember, IMember)).

Parameters:
node - node to compare with
Returns:
true if nodes' fully qualified names are equal; null otherwise

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Provides an adapter for the IMember, IResource JRipplesEIGNode and String classes.

Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Parameters:
adapter - class for which adapter is needed

compareTo

public int compareTo(java.lang.Object arg0)
Specified by:
compareTo in interface java.lang.Comparable