procope.data.networks
Class NetworkEdge

java.lang.Object
  extended by procope.data.networks.NetworkEdge
All Implemented Interfaces:
Comparable<NetworkEdge>

public class NetworkEdge
extends Object
implements Comparable<NetworkEdge>

Represents one edge in a ProteinNetwork. Contains the IDs of both involved proteins, the weight of the edge and any annotations associated with this edge. The class is not instantiatable outside of the package.

Note:Source and target information are not relevant for undirected networks.

Author:
Jan Krumsiek

Method Summary
 int compareTo(NetworkEdge o)
          Compare this network edge with another.
 Object getAnnotation(String key)
          Retrieves a single annotation from the annotation list
 Map<String,Object> getAnnotations()
          Returns all annotations associated with this edge
 int getSource()
          Returns the protein from which this edge is originating.
 int getTarget()
          Returns the protein to which this edge is leading.
 float getWeight()
          Returns the weight of this edge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSource

public int getSource()
Returns the protein from which this edge is originating.

Returns:
source protein ID

getTarget

public int getTarget()
Returns the protein to which this edge is leading.

Returns:
target protein ID

getWeight

public float getWeight()
Returns the weight of this edge

Returns:
weight of the edge or Float.NaN if the edge has no weight associated

getAnnotations

public Map<String,Object> getAnnotations()
Returns all annotations associated with this edge

Returns:
a map of associates or an empty, immutable map if no there are no annotations for this edge

getAnnotation

public Object getAnnotation(String key)
Retrieves a single annotation from the annotation list

Parameters:
key - key of the annotation
Returns:
the value of that annotation or null if no value is associated with that key

compareTo

public int compareTo(NetworkEdge o)
Compare this network edge with another. An edge is greater than another edge if its weight is greater.

Specified by:
compareTo in interface Comparable<NetworkEdge>