uk.ac.ebi.intenz.domain.history
Class HistoryGraph

java.lang.Object
  extended by uk.ac.ebi.intenz.domain.history.HistoryGraph

public class HistoryGraph
extends Object

The directed acyclic history graph stores all events related to an enzyme.

The list of all events may include all previous and following events, depending on the state of the regarded enzyme. This implementation provides standard graph methods such as removing and inserting nodes and events. Each application of these methods includes a check for cycles.

See HistoryEvent and HistoryNode for more information about the elements of the history graph.

Instances of this class are immutable.

Version:
$Revision: 1.2 $ $Date: 2008/01/28 12:33:04 $
Author:
Michael Darsow

Constructor Summary
HistoryGraph(HistoryNode rootNode)
          Returns a HistoryGraph instance.
 
Method Summary
 SortedSet<HistoryEvent> getEdges()
           
 HistoryEvent getLatestHistoryEventOfAll()
          Returns the most recent event of the WHOLE graph.
 HistoryEvent getLatestHistoryEventOfRoot()
          Returns the most recent event of the root node only.
 HistoryEvent getLatestRelevantHistoryEventOfRoot()
          Returns the most recent event of the root node only.
 HistoryNode getRootNode()
           
 boolean isDeletedRootNode()
          Returns true if this node's event is a DELETION event.
 boolean isTransferredRootNode()
          Returns true if this node's event is a TRANSFER event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoryGraph

public HistoryGraph(HistoryNode rootNode)
Returns a HistoryGraph instance.

Parameters:
rootNode - The root node of the history graph.
Throws:
NullPointerException - if rootNode is empty.
Method Detail

isDeletedRootNode

public boolean isDeletedRootNode()
Returns true if this node's event is a DELETION event.

This is only the case if the root node is the beforeNode of the event. Otherwise the event is a CREATION event where the root node represents the afterNode, that is the new entry an enzyme has been deleted to.

Returns:
true if the root node's event is of type uk.ac.ebi.intenz.domain.constants.EventConstant.DELETION.

isTransferredRootNode

public boolean isTransferredRootNode()
Returns true if this node's event is a TRANSFER event.

This is only the case if the root node is the beforeNode of the event. Otherwise the event is a CREATION event where the root node represents the afterNode, that is the new entry an enzyme has been transferred to.

Returns:
true if the root node's event is of type uk.ac.ebi.intenz.domain.constants.EventConstant.TRANSFER.

getRootNode

public HistoryNode getRootNode()

getEdges

public SortedSet<HistoryEvent> getEdges()

getLatestHistoryEventOfAll

public HistoryEvent getLatestHistoryEventOfAll()
Returns the most recent event of the WHOLE graph.

Returns:
the most recent event.

getLatestHistoryEventOfRoot

public HistoryEvent getLatestHistoryEventOfRoot()
Returns the most recent event of the root node only.

Returns:
the most recent event.

getLatestRelevantHistoryEventOfRoot

public HistoryEvent getLatestRelevantHistoryEventOfRoot()
Returns the most recent event of the root node only.

Returns:
the most recent event.


Copyright © 2013 EMBL-EBI. All Rights Reserved.