Class AbstractGraphNode<K,V>

java.lang.Object
ubic.basecode.dataStructure.Visitable
ubic.basecode.dataStructure.graph.AbstractGraphNode<K,V>
All Implemented Interfaces:
GraphNode<K,V>
Direct Known Subclasses:
DirectedGraphNode, UndirectedGraphNode

public abstract class AbstractGraphNode<K,V> extends Visitable implements GraphNode<K,V>
Author:
Paul Pavlidis
  • Field Details

    • item

      protected V item
    • key

      protected K key
    • visited

      protected boolean visited
  • Constructor Details

    • AbstractGraphNode

      public AbstractGraphNode(K key)
      Create a new node when given only a key.
      Parameters:
      key -
    • AbstractGraphNode

      public AbstractGraphNode(K key, V value)
  • Method Details

    • getItem

      public V getItem()
      Get the actual contents of the node.
      Specified by:
      getItem in interface GraphNode<K,V>
      Returns:
    • getKey

      public K getKey()
      Get the key for the node.
      Specified by:
      getKey in interface GraphNode<K,V>
      Returns:
      Object
    • isVisited

      public boolean isVisited()
      Overrides:
      isVisited in class Visitable
    • mark

      public void mark()
      Overrides:
      mark in class Visitable
    • setItem

      public void setItem(V value)
      Description copied from interface: GraphNode
      Set the contents of the node.
      Specified by:
      setItem in interface GraphNode<K,V>
      Parameters:
      value -
    • setValue

      public void setValue(K key, V value)
      Description copied from interface: GraphNode
      Set the key and value associated with this node.
      Specified by:
      setValue in interface GraphNode<K,V>
      Parameters:
      key -
      value -
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • unMark

      public void unMark()
      Overrides:
      unMark in class Visitable