marf.Stats
Class StatisticalObject

java.lang.Object
  extended by marf.Stats.StatisticalObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
WordStats

public class StatisticalObject
extends java.lang.Object
implements java.io.Serializable

Generic Statistical Object.

$Id: StatisticalObject.java,v 1.9 2005/07/30 20:05:45 mokhov Exp $

Since:
0.3.0.2
Version:
$Revision: 1.9 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
protected  int iFrequency
          Word's frequency in a given corpus.
protected  int iRank
          Word's rank in the corpus.
 
Constructor Summary
StatisticalObject()
          Constructs a default statistical object.
StatisticalObject(int piFrequency)
          Constructs a statistical object with a frequency parameter
 
Method Summary
 int getFrequency()
          Retrieves the object's frequency.
static java.lang.String getMARFSourceCodeRevision()
          Returns source code revision information.
 int getRank()
          Restrieves the object's rank.
 int incFrequency()
          Increments the object frequency by one.
 int incRank()
          Increments rank of the object by one.
 void setRank(int piRank)
          Allows setting rank of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iFrequency

protected int iFrequency
Word's frequency in a given corpus. Default 0.


iRank

protected int iRank
Word's rank in the corpus. The rank of 1 indicates the top frequent word. Default is -1, i.e. unset.

Constructor Detail

StatisticalObject

public StatisticalObject()
Constructs a default statistical object.


StatisticalObject

public StatisticalObject(int piFrequency)
Constructs a statistical object with a frequency parameter

Parameters:
piFrequency - the desired frequency of this object
Method Detail

setRank

public final void setRank(int piRank)
Allows setting rank of this object.

Parameters:
piRank - the new rank

incRank

public final int incRank()
Increments rank of the object by one.

Returns:
the new rank

getRank

public final int getRank()
Restrieves the object's rank.

Returns:
current rank

getFrequency

public final int getFrequency()
Retrieves the object's frequency.

Returns:
current frequency

incFrequency

public final int incFrequency()
Increments the object frequency by one.

Returns:
the new frequency

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Returns source code revision information.

Returns:
revision string