|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--sos.reports.ArrayBreakWeightRecorder
An implementation of BreakWeightRecorder that uses an array
to record weights.
The final break position is determined as follows:
| Field Summary |
| Fields inherited from interface sos.reports.BreakWeightRecorder |
BAD_BREAK_WEIGHT, EXCELLENT_BREAK_WEIGHT, FORCED_BREAK_WEIGHT, GOOD_BREAK_WEIGHT, UNDEFINED_BREAK_WEIGHT |
| Constructor Summary | |
ArrayBreakWeightRecorder(int length)
Creates an ArrayBreakWeightRecorder with the specified length. |
|
| Method Summary | |
BreakWeightRecorder |
createView(int index,
int length)
Returns a view of this recorder. |
void |
fill(int weight)
Fills the entire clip range with the specified weight. |
void |
fill(int index,
int length,
int weight)
Fills the specified range with the specified weight. |
void |
fillEnd(int index,
int weight)
Fills the end portion with the specified weight. |
int |
getBestWeight()
Returns the best, or highest, break weight in the clip range. |
int |
getBreakIndex()
Returns the best place to break within the clip range, or -1 if such a place does not exist. |
int |
getFirstIndexOfWeight(int weight)
Returns the index of the first bit in the clip range with the specified weight. |
int |
getFirstIndexOfWeightAtLeast(int weight)
Returns the index of the first bit in the clip range with a weight greater than or equal to the specified weight. |
int |
getLastIndexOfWeight(int weight)
Returns the index of the last bit in the clip range with the specified weight. |
int |
getLastIndexOfWeightAtLeast(int weight)
Returns the index of the last bit in the clip range with a weight greater than or equal to the specified weight. |
int |
getRangeLength()
Returns the length of the clip range. |
int |
getRangeStart()
Returns the starting index of the clip range. |
int |
getWeight(int index)
Returns the weight at the specified index. |
void |
setRange(int index,
int length)
Sets this recorder's clip range. |
void |
setWeight(int index,
int weight)
Sets the weight at the specified index. |
java.lang.String |
toString()
Returns a string representation of this object. |
java.lang.String |
toString(int index,
int length)
Returns a string representation of this recorder over the specified range. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ArrayBreakWeightRecorder(int length)
ArrayBreakWeightRecorder with the specified length.
length - total number of bits| Method Detail |
public BreakWeightRecorder createView(int index,
int length)
BreakWeightRecorderlength - 1. Index 0 in the view corresponds to
index in this recorder,
and index length - 1 corresponds to index + length - 1.
Operations on the view within its range propagate to this recorder.The specified index and length are bound by this recorder's current range. That is, they are adjusted so that the view cannot operate outside this recorder's range.
createView in interface BreakWeightRecorderindex - index of this recorder to get mapped to index 0 of the returned viewlength - number of indices to be in the view
length indices and
translated by indexpublic void fill(int weight)
BreakWeightRecorder
fill in interface BreakWeightRecorderweight - maximum weight that each bit in the clip range should have
public void fill(int index,
int length,
int weight)
BreakWeightRecorderThe range is bound by this recorder's current clip range. That is, bits outside the clip range are ignored.
fill in interface BreakWeightRecorderindex - start index at which to set the weightlength - number of bits for which to set the wieghtweight - maximum weight that each bit in the specified range should haveBreakWeightRecorder.fill(int),
BreakWeightRecorder.fillEnd(int, int)
public void fillEnd(int index,
int weight)
BreakWeightRecorderThe range is bound by this recorder's current clip range. That is, bits outside the clip range are ignored.
fillEnd in interface BreakWeightRecorderindex - start index at which to set the weightweight - maximum weight that each bit in the specified range should havepublic int getBestWeight()
BreakWeightRecorder
getBestWeight in interface BreakWeightRecorderpublic int getBreakIndex()
BreakWeightRecorderBAD_BREAK_WEIGHT.
getBreakIndex in interface BreakWeightRecorderpublic int getFirstIndexOfWeight(int weight)
BreakWeightRecorder
getFirstIndexOfWeight in interface BreakWeightRecorderweight - weight to seek
public int getFirstIndexOfWeightAtLeast(int weight)
BreakWeightRecorder
getFirstIndexOfWeightAtLeast in interface BreakWeightRecorderweight - minimum weight to seek
public int getLastIndexOfWeight(int weight)
BreakWeightRecorder
getLastIndexOfWeight in interface BreakWeightRecorderweight - weight to seek
public int getLastIndexOfWeightAtLeast(int weight)
BreakWeightRecorder
getLastIndexOfWeightAtLeast in interface BreakWeightRecorderweight - minimum weight to seek
public int getRangeLength()
BreakWeightRecorder
getRangeLength in interface BreakWeightRecorderBreakWeightRecorder.getRangeStart(),
BreakWeightRecorder.setRange(int, int)public int getRangeStart()
BreakWeightRecorder
getRangeStart in interface BreakWeightRecorderBreakWeightRecorder.getRangeLength(),
BreakWeightRecorder.setRange(int, int)public int getWeight(int index)
BreakWeightRecorder
getWeight in interface BreakWeightRecorderindex - index at which to fetch the weight
index
public void setRange(int index,
int length)
BreakWeightRecorderThe range is bound by this recorder's current clip range. That is, bits outside the clip range are ignored.
setRange in interface BreakWeightRecorderindex - start index of range to cliplength - length of range to clip
public void setWeight(int index,
int weight)
BreakWeightRecorderindex is the minimum of the current weight and the
specified weight.
setWeight in interface BreakWeightRecorderindex - index at which to set the weightweight - weight of a potential break at indexpublic java.lang.String toString()
toString in class java.lang.Object
public java.lang.String toString(int index,
int length)
index - index at which to start generating the stringlength - number of bits to include in the string
java.lang.IllegalArgumentException - if length < 0
java.lang.IndexOutOfBoundsException - if index < 0
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||