edu.wwu.tobikley.acgc.algorithms
Class CountingResult

java.lang.Object
  extended by edu.wwu.tobikley.acgc.algorithms.CountingResult
All Implemented Interfaces:
Comparable

public class CountingResult
extends Object
implements Comparable

Encapsulates the result of one iteration of a call of CountingAlgorithm.algorithm(). The following three pieces of information are included:

CountingResults are sorted by the result value.

Version:
1.0
Author:
Tobias Kley

Field Summary
private  BigInteger result
          The result itself.
private  long runTime
          The runtime it took the algorithm to compute the result.
private  String type
          The type of the result.
 
Constructor Summary
CountingResult(String type, BigInteger result, long runTime)
          Creates a new instance of a counting result.
 
Method Summary
 int compareTo(Object o)
          CountingResults are compared by the value of their result.
 BigInteger getResult()
           
 long getRunTime()
           
 String getType()
           
 String toString()
          Returns [type]: [result] in [runTime].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

private String type
The type of the result. Allowed are either "Overall" or "i. Iteration".


result

private BigInteger result
The result itself.


runTime

private long runTime
The runtime it took the algorithm to compute the result.

Constructor Detail

CountingResult

public CountingResult(String type,
                      BigInteger result,
                      long runTime)
Creates a new instance of a counting result.

Parameters:
type - The type of the result.
result - he result itself.
runTime - The runtime it took the algorithm to compute the result.
Method Detail

getType

public String getType()
Returns:
the type

getResult

public BigInteger getResult()
Returns:
the result

getRunTime

public long getRunTime()
Returns:
the runTime

toString

public String toString()
Returns [type]: [result] in [runTime].

Overrides:
toString in class Object
Returns:
String representation of the above form.

compareTo

public int compareTo(Object o)
CountingResults are compared by the value of their result.

Specified by:
compareTo in interface Comparable


Copyright © 2007 Tobias Kley. All Rights Reserved.