ca.umontreal.iro.rali
Class PathCount

java.lang.Object
  extended by ca.umontreal.iro.rali.PathCount
All Implemented Interfaces:
java.lang.Comparable<PathCount>

public class PathCount
extends java.lang.Object
implements java.lang.Comparable<PathCount>

Pair with a String and a count of its occurrences to be used in a Map


Field Summary
static java.util.Comparator<PathCount> decVal
          Decreasing frequency comparator
 
Method Summary
 void bump()
          Increment the count by one of this XPath
 int compareTo(PathCount that)
          Natural comparison on the alphabetic value of the string
 boolean equals(java.lang.Object that)
          Two paths are equals if their string are equal
 java.lang.String getPath()
          Accessor for the path
 int getVal()
          Accessor for the count
 int hashCode()
          The hashcode of this element is the one of the string of the XPath
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

decVal

public static java.util.Comparator<PathCount> decVal
Decreasing frequency comparator

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPath

public java.lang.String getPath()
Accessor for the path

Returns:
string describing the path

getVal

public int getVal()
Accessor for the count

Returns:
the number of occurrences of this path

bump

public void bump()
Increment the count by one of this XPath


hashCode

public int hashCode()
The hashcode of this element is the one of the string of the XPath

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object that)
Two paths are equals if their string are equal

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

compareTo

public int compareTo(PathCount that)
Natural comparison on the alphabetic value of the string

Specified by:
compareTo in interface java.lang.Comparable<PathCount>
See Also:
Comparable.compareTo(java.lang.Object)