lima.mathematical.factorisation.quadraticsieve
Class QSWorkUnit

java.lang.Object
  |
  +--lima.mathematical.factorisation.quadraticsieve.QSWorkUnit
All Implemented Interfaces:
java.io.Serializable, WorkUnit

public class QSWorkUnit
extends java.lang.Object
implements WorkUnit, java.io.Serializable

Objects of this class are work units for a quadratic sieve object.

See Also:
QuadraticSieve, WorkUnit, Serialized Form

Constructor Summary
QSWorkUnit(lima.distribution.Constants remoteConstants, int constantsHashCode, int[] aFactorsRef, int cost)
           
 
Method Summary
 int cost()
          Guess how long this workunit will take to run, in ms on a midrange machine
 boolean equals(java.lang.Object other)
           
 void generateHashCode()
          WHAT DOES THIS DO? WHY? - pw
 java.math.BigInteger[] getRelations()
           
 int hashCode()
           
 boolean hasRun()
          Returns true iff run has completed on this workUnit.
 void run(lima.storage.Cache cache)
          Start processing this WorkUnit.
 int runtime()
          How long this WorkUnit took to run in ms.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QSWorkUnit

public QSWorkUnit(lima.distribution.Constants remoteConstants,
                  int constantsHashCode,
                  int[] aFactorsRef,
                  int cost)
Method Detail

generateHashCode

public void generateHashCode()
Description copied from interface: WorkUnit
WHAT DOES THIS DO? WHY? - pw

Specified by:
generateHashCode in interface WorkUnit

run

public void run(lima.storage.Cache cache)
Description copied from interface: WorkUnit
Start processing this WorkUnit. This method MUST return only after processing has finished, and the WorkUnit can be send back to the server.

Specified by:
run in interface WorkUnit

cost

public int cost()
Description copied from interface: WorkUnit
Guess how long this workunit will take to run, in ms on a midrange machine

Specified by:
cost in interface WorkUnit
See Also:
();

runtime

public int runtime()
            throws java.lang.IllegalStateException
Description copied from interface: WorkUnit
How long this WorkUnit took to run in ms. This should only be called after run has been called.

Specified by:
runtime in interface WorkUnit
Returns:
int
Throws:
java.lang.IllegalStateException - iff run has not been called.
See Also:
WorkUnit.runtime()

hasRun

public boolean hasRun()
Description copied from interface: WorkUnit
Returns true iff run has completed on this workUnit.

Specified by:
hasRun in interface WorkUnit
Returns:
boolean
See Also:
WorkUnit.hasRun()

getRelations

public java.math.BigInteger[] getRelations()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object