|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--corina.cross.Cross
Abstract class representing the scores of a crossdate. The data vector holds the crossdate scores; the range holds the range of end dates for the moving sample. After construction, the run() method must be called; making this a good candidate for running in a thread.
Instead of an abstract class, this might be better off as an interface (extends Runnable) with a couple of public accessor methods. I can still provide an abstract class that implements this interface, like Swing does in many places.
| Field Summary | |
double[] |
data
The crossdate scores. |
protected Sample |
fixed
Reference to the sample being held fixed. |
List |
highScores
A vector of high (statistically significant) scores. |
protected Sample |
moving
Reference to the sample being moved to compute the vector of scores. |
static ResourceBundle |
msg
Resource bundle for localization. |
| Constructor Summary | |
protected |
Cross()
|
|
Cross(Sample fixed,
Sample moving)
Create a crossdate, given fixed and moving samples. |
| Method Summary | |
abstract double |
compute(int offset_fixed,
int offset_moving)
Compute an individual score, starting at the given offsets into the fixed and moving samples. |
Sample |
getFixed()
Returns the fixed sample. |
abstract String |
getFormat()
Return a format string for this cross to be used with DecimalFormat. |
static int |
getMinimumOverlap()
The minimum allowable crossdate overlap between two samples; its value is 15. |
abstract double |
getMinimumSignificant()
|
Sample |
getMoving()
Returns the moving sample. |
abstract String |
getName()
Return a human-readable name for the crossdate. |
boolean |
isFinished()
Is the run finished? |
abstract boolean |
isSignificant(double score,
int overlap)
|
protected void |
preamble()
Crossdate preamble: any setup that needs to be done before the main loop to compute individual scores. |
void |
run()
Run the crossdate. |
float |
single()
Run a single crossdate on the (absolutely-dated) samples. |
String |
toString()
Return the cross as a String, in the format "Cross: SampleA versus SampleB". |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static ResourceBundle msg
public double[] data
protected Sample fixed
protected Sample moving
public List highScores
finished is set.| Constructor Detail |
protected Cross()
public Cross(Sample fixed,
Sample moving)
fixed - sample to hold fixedmoving - sample to compare against the fixed sample| Method Detail |
public Sample getFixed()
public Sample getMoving()
public boolean isFinished()
public static int getMinimumOverlap()
public abstract String getName()
public abstract String getFormat()
public final String toString()
toString in class Object
public abstract boolean isSignificant(double score,
int overlap)
public abstract double getMinimumSignificant()
protected void preamble()
public abstract double compute(int offset_fixed,
int offset_moving)
offset_fixed - index of the fixed data to start atoffset_moving - index of the moving data to start atpublic final void run()
run in interface Runnablepreamble(),
compute(int, int)public float single()
highScores remains empty, and
finished remains false. The offsets
are derived from the dates of the samples, which are assumed
to be absolutely dated.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||