| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarf.Storage.ResultSet
public class ResultSet
Class ResultSet represents classification result set - IDs and some stats. May be sorted.
$Id: ResultSet.java,v 1.22 2007/12/23 06:29:46 mokhov Exp $
| Field Summary | |
|---|---|
protected  Result[] | 
aoResultSetSorted
References to the objects in the oResultSet in the sorted order.  | 
protected  int | 
iSortMode
Used to remember in which direction sorting was performed, so some methods can work correctly.  | 
protected  java.util.Vector | 
oResultSet
Distances from other samples and other stats or probabilities and likelihood (growable and shrinkable).  | 
static int | 
UNSORTED
Indicates that this result set is unsorted.  | 
| Constructor Summary | |
|---|---|
ResultSet()
Default constructor, which is equivalent to ResultSet(new Vector()). | 
|
ResultSet(ResultSet poResultSet)
Copy-constructor.  | 
|
ResultSet(java.util.Vector poResultSet)
ID Vector ResultSet Constructor.  | 
|
| Method Summary | |
|---|---|
 void | 
addResult(int piID,
          double pdOutcome)
Add result to the result set.  | 
 void | 
addResult(int piID,
          double pdOutcome,
          java.lang.String pstrDescription)
Add result to the result set.  | 
 void | 
addResult(Result poResult)
Add result to the result set based on already pre-constructed object.  | 
 java.lang.Object | 
clone()
Implements Cloneable interface for the ResultSet object.  | 
 int | 
getAverageID()
Retrieves ID of a subject with average distance/probability.  | 
 Result | 
getAverageResult()
Retrieves the result from the result set with the average outcome value.  | 
static java.lang.String | 
getMARFSourceCodeRevision()
Returns source code revision information.  | 
 int | 
getMaximumID()
Retrieves ID of a subject with maximum distance/probability.  | 
 Result | 
getMaximumResult()
Retrieves the result from the result set with the maximum outcome value.  | 
 Result | 
getMinimumResult()
Retrieves the result from the result set with the minimum outcome value.  | 
 int | 
getMininumID()
Retrieves ID of a subject with minimum distance/probability.  | 
 int | 
getRandomID()
Retrieves a pseudo random ID of a subject.  | 
 Result | 
getRandomResult()
Retrieves pseudo-random result object from the result set.  | 
 Result[] | 
getResultSetSorted()
Allows querying the current array of references to the contained Result objects sorted (if sorting was performed).  | 
 java.util.Vector | 
getResultSetVector()
Retrieves the underlying unsorted result collection.  | 
 int | 
getSecondClosestID()
Returns second closest ID.  | 
 int | 
getSecondMaximumID()
Retrieves ID of a subject with the distance/probability next to the maximum.  | 
 int | 
getSecondMininumID()
Retrieves ID of a subject with the distance/probability next to the minimum.  | 
 int | 
getSortMode()
Allows querying the sort mode the result set may be currently sorted in accordance with.  | 
 void | 
setResultSetSorted(Result[] paoResultSetSorted)
Allows setting the current array of sorted references to the contained Result objects if sorted outside.  | 
 void | 
setResultSetVector(java.util.Vector poResultSet)
Sets the underlying unsorted result collection.  | 
 void | 
setSortMode(int piSortMode)
Allows setting the sort mode the result set may be sorted next time in accordance with.  | 
 int | 
size()
Retrieves result count of the results in this result set.  | 
 void | 
sort(int piMode)
Perform sorting of the results in the result set.  | 
 java.lang.String | 
toString()
Returns inner ResultSet data converted to string.  | 
| Methods inherited from class java.lang.Object | 
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final int UNSORTED
protected java.util.Vector oResultSet
protected Result[] aoResultSetSorted
protected int iSortMode
SortComparator.ASCENDING
 or SortComparator.DESCENDING. It is set by
 the sort() method only.
getSecondClosestID(), 
sort(int), 
SortComparator.ASCENDING, 
SortComparator.DESCENDING, 
UNSORTED| Constructor Detail | 
|---|
public ResultSet()
ResultSet(new Vector()).
public ResultSet(java.util.Vector poResultSet)
poResultSet - Vector of relevant data
java.lang.IllegalArgumentException - if the parameter is nullpublic ResultSet(ResultSet poResultSet)
poResultSet - ResultSet object reference to make a copy of| Method Detail | 
|---|
public final int getMininumID()
java.lang.ArrayIndexOutOfBoundsException - if there are no resultspublic final int getSecondMininumID()
java.lang.ArrayIndexOutOfBoundsException - if there is only one
 or no result in the result set.public final int getMaximumID()
java.lang.ArrayIndexOutOfBoundsException - if there are no resultspublic final int getSecondMaximumID()
java.lang.ArrayIndexOutOfBoundsException - if there is only one
 or no result in the result set.public final int getSecondClosestID()
getSecondMininumID(), 
getSecondMaximumID()public final int getAverageID()
java.lang.ArrayIndexOutOfBoundsException - if there are no resultspublic final int getRandomID()
java.lang.ArrayIndexOutOfBoundsException - if there are no resultspublic final void sort(int piMode)
piMode - sorting mode, either SortComparator.ASCENDING or
 SortComparator.DESCENDING.
java.lang.IllegalArgumentException - if the parameter is neither of the two modesSortComparator.ASCENDING, 
SortComparator.DESCENDING
public final void addResult(int piID,
                            double pdOutcome,
                            java.lang.String pstrDescription)
piID - subject ID recognizedpdOutcome - outcome of the recognition distance or likelihoodpstrDescription - textual description of the result
public final void addResult(int piID,
                            double pdOutcome)
piID - subject ID recognizedpdOutcome - outcome of the recognition distance or likelihoodpublic final void addResult(Result poResult)
poResult - Result object prepared outside
java.lang.IllegalArgumentException - of the parameter is nullpublic Result getMinimumResult()
public Result getAverageResult()
public Result getRandomResult()
public Result getMaximumResult()
public java.util.Vector getResultSetVector()
public Result[] getResultSetSorted()
public void setResultSetVector(java.util.Vector poResultSet)
poResultSet - the result set vector to setpublic void setResultSetSorted(Result[] paoResultSetSorted)
paoResultSetSorted - the new collection of sorted referencespublic void setSortMode(int piSortMode)
piSortMode - the sort mode to setUNSORTED, 
SortComparator.ASCENDING, 
SortComparator.DESCENDING, 
iSortModepublic final int getSortMode()
UNSORTED, 
SortComparator.ASCENDING, 
SortComparator.DESCENDING, 
iSortModepublic java.lang.String toString()
toString in class java.lang.Objectpublic int size()
public java.lang.Object clone()
clone in class java.lang.ObjectObject.clone()public static java.lang.String getMARFSourceCodeRevision()
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||