|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.yosokumo.core.Block com.yosokumo.core.PredictorBlock
class PredictorBlock
Represents a block of Predictors
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.yosokumo.core.Block |
---|
Block.Type |
Field Summary | |
---|---|
private java.util.List<Predictor> |
predictorSequence
A sequence of Predictors . |
Constructor Summary | |
---|---|
PredictorBlock()
Initializes a newly created PredictorBlock object with default
attributes. |
|
PredictorBlock(java.util.Collection<Predictor> predictorCollection)
Initializes a newly created PredictorBlock object with the
predictor sequence specified by the input parameter. |
|
PredictorBlock(java.lang.String id)
Initializes a newly created PredictorBlock object with a study
identifier. |
|
PredictorBlock(java.lang.String id,
java.util.Collection<Predictor> predictorCollection)
Initializes a newly created PredictorBlock object with the
study identifier and the predictor sequence specified by the input
parameters. |
Method Summary | |
---|---|
(package private) void |
addPredictor(Predictor predictor)
Add a Predictor to the block. |
(package private) boolean |
addPredictors(java.util.Collection<Predictor> predictors)
Add a collection of Predictors to the block. |
(package private) void |
clearPredictors()
Remove all predictors from the block. |
(package private) Predictor |
getPredictor(int index)
Return a predictor from the block. |
(package private) java.util.List<Predictor> |
getPredictorSequence()
Return all predictors in the block as a List<Predictor> . |
(package private) Block.Type |
getType()
Return the predictor block type. |
(package private) boolean |
isEmpty()
Return true if the block contains no predictors. |
(package private) boolean |
removePredictors(int numPredictorsToRemove)
Remove predictors from the end of the block. |
(package private) int |
size()
Return the number of predictors in the block. |
java.lang.String |
toString()
Return a string representation of this PredictorBlock . |
Methods inherited from class com.yosokumo.core.Block |
---|
getStudyIdentifier, setStudyIdentifier |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.List<Predictor> predictorSequence
Predictors
.
Constructor Detail |
---|
PredictorBlock()
PredictorBlock
object with default
attributes.
PredictorBlock(java.lang.String id)
PredictorBlock
object with a study
identifier.
id
- a study identifier for the block.PredictorBlock(java.util.Collection<Predictor> predictorCollection)
PredictorBlock
object with the
predictor sequence specified by the input parameter.
predictorCollection
- the predictor sequence of the specimen.PredictorBlock(java.lang.String id, java.util.Collection<Predictor> predictorCollection)
PredictorBlock
object with the
study identifier and the predictor sequence specified by the input
parameters.
id
- a study identifier for the block.predictorCollection
- the predictor sequence of the specimen.Method Detail |
---|
Block.Type getType()
getType
in class Block
void addPredictor(Predictor predictor)
Predictor
to the block. The predictor parameter is
appended to the end of the predictor sequence.
predictor
- the Predictor
to add to the block.boolean addPredictors(java.util.Collection<Predictor> predictors)
Predictors
to the block. The
Predictors
in the collection specified by the parameter are
appended to the end of the predictor sequence. The order the
predictors are appended is the order in which the collection's
Iterator
returns the predictors.
predictors
- the collection of Predictors
to add to the
block.
boolean removePredictors(int numPredictorsToRemove)
numPredictorsToRemove
- is the number of predictors to remove
from the end of the block. If this value is zero or negative,
no predictors are removed. If this value exceeds the number
of predictors in the block, then all predictors are removed.
Predictor getPredictor(int index)
for (int i = 0; i < predictorSequence.size(); ++i) { Predictor c = predictorSequence.getPredictor(i) process predictor c }Caution: It is better to iterate over all predictors by using getPredictorSequence as shown below because that approach is efficient no matter what kind of List is used to implement the sequence. Iterating as shown just above is extremely expensive if the LinkedList implementation is used.
index
- specifying the predictor of the 0-based block.
Predictor
at the location specified by the index.java.util.List<Predictor> getPredictorSequence()
List<Predictor>
.
This makes it possible to iterate over all predictors in the block
like this:
for (Predictor c : predictorSequence.getPredictorSequence()) { process predictor c }
void clearPredictors()
int size()
boolean isEmpty()
true
if the block contains no predictors.
true
if the block contains no predictors.
false
otherwise.public java.lang.String toString()
PredictorBlock
.
toString
in class Block
PredictorBlock
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |