marf.Stats
Class StatisticalObject

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

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

Generic Statistical Object.

$Id: StatisticalObject.java,v 1.17 2007/12/18 21:57:14 mokhov Exp $

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

Field Summary
protected  int iFrequency
          Number of occurrences of this object basic data in a given document (for example a corpus or a WAVE file).
protected  int iRank
          Rank of the object in the document.
 
Constructor Summary
StatisticalObject()
          Constructs a default statistical object.
StatisticalObject(int piFrequency)
          Constructs a statistical object with a frequency parameter.
StatisticalObject(StatisticalObject poStatisticalObject)
          Copy-constructor.
 
Method Summary
 java.lang.Object clone()
          Implements Cloneable interface for the StatisticalObject.
 boolean equals(java.lang.Object poStatisticalObject)
          Checks equality of two StatisticalObjects whether the parameter is not null and its toString()'s output is equal to this one.
 int getFrequency()
          Retrieves the object's frequency.
static java.lang.String getMARFSourceCodeRevision()
          Returns source code revision information.
 int getRank()
          Retrieves the object's rank.
 int hashCode()
          Overrides hashCode() since equals() is overridden by returning the hash code of the toString().
 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.
 java.lang.String toString()
          Reports frequency and rank of an occurrence of a statistical object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

iFrequency

protected int iFrequency
Number of occurrences of this object basic data in a given document (for example a corpus or a WAVE file). Default 0.


iRank

protected int iRank
Rank of the object in the document. The rank of 1 indicates the most frequent. 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

StatisticalObject

public StatisticalObject(StatisticalObject poStatisticalObject)
Copy-constructor.

Parameters:
poStatisticalObject - statistical object to copy properties of
Since:
0.3.0.5
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()
Retrieves 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

clone

public java.lang.Object clone()
Implements Cloneable interface for the StatisticalObject.

Overrides:
clone in class java.lang.Object
Since:
0.3.0.5
See Also:
Object.clone()

equals

public boolean equals(java.lang.Object poStatisticalObject)
Checks equality of two StatisticalObjects whether the parameter is not null and its toString()'s output is equal to this one.

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

hashCode

public int hashCode()
Overrides hashCode() since equals() is overridden by returning the hash code of the toString().

Overrides:
hashCode in class java.lang.Object
Since:
0.3.0.5
See Also:
Object.hashCode(), equals(Object)

toString

public java.lang.String toString()
Reports frequency and rank of an occurrence of a statistical object.

Overrides:
toString in class java.lang.Object
Since:
0.3.0.5
See Also:
Object.toString()

getMARFSourceCodeRevision

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

Returns:
revision string


SourceForge Logo