Class PathCount

java.lang.Object
  extended by 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
private  java.lang.String path
           
private  int val
           
 
Constructor Summary
PathCount(java.lang.String path)
          Initialize the count to 1 for this path string
 
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

val

private int val

path

private java.lang.String path

decVal

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

Constructor Detail

PathCount

PathCount(java.lang.String path)
Initialize the count to 1 for this path string

Parameters:
path -
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:

getVal

public int getVal()
Accessor for the count

Returns:

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)