net.xqhs.graphs.graph
Class NodeAlphaComparator

java.lang.Object
  extended by net.xqhs.graphs.graph.NodeAlphaComparator
All Implemented Interfaces:
java.util.Comparator<Node>
Direct Known Subclasses:
LinearGraphRepresentation.NodeInAlphaComparator

public class NodeAlphaComparator
extends java.lang.Object
implements java.util.Comparator<Node>

A simple Comparator class for Node instances, that also supports comparison of NodeP instances by generic index. Sorts labeled nodes lexicographically and generic nodes (if both arguments are NodeP instances) by increasing generic index.

Author:
Andrei Olaru

Constructor Summary
NodeAlphaComparator()
           
 
Method Summary
 int compare(Node n0, Node n1)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

NodeAlphaComparator

public NodeAlphaComparator()
Method Detail

compare

public int compare(Node n0,
                   Node n1)
Specified by:
compare in interface java.util.Comparator<Node>