|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttnt.metrics.WordFreqKs
public class WordFreqKs
The WordFreqKs class encapsulates a word, its frequency in the corpus and
the keystrokes required to type it.
It also implements a compareTo
method to sort such objects in
ascending order according to keystrokes. Objects with equal keystrokes are
sorted in decending order of frequency, then in ascending order by word.
Field Summary | |
---|---|
int |
freq
The frequency of this word in the corpus. |
java.lang.String |
ks
The keystrokes required to input this word. |
java.lang.String |
word
A word in the corpus. |
Constructor Summary | |
---|---|
WordFreqKs(java.lang.String w,
int f,
java.lang.String k)
|
Method Summary | |
---|---|
int |
compareTo(WordFreqKs other)
Sorts objects according to keystrokes. |
static java.lang.String[] |
getFieldOrder()
Returns the order of the fields returned by toStringArray() . |
java.lang.String |
toString()
Returns a tab-delimited String composed of word,
frequency and keystrokes. |
java.lang.String[] |
toStringArray()
Returns a String array composed of word, frequency and
keystrokes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.lang.String word
public int freq
public java.lang.String ks
Constructor Detail |
---|
public WordFreqKs(java.lang.String w, int f, java.lang.String k)
Method Detail |
---|
public java.lang.String toString()
String
composed of word,
frequency and keystrokes.
toString
in class java.lang.Object
String
representing this object.public java.lang.String[] toStringArray()
String
array composed of word, frequency and
keystrokes. Aids in displaying data in a table.
String[]
representation of this object.public static java.lang.String[] getFieldOrder()
toStringArray()
.
String[]
, representing field headings.public int compareTo(WordFreqKs other)
Important: Changing the functionality of this method could affect the correctness of classes that use it!
compareTo
in interface java.lang.Comparable<WordFreqKs>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |