protected static class NodeSequence.SingleWidthBatch extends Object implements NodeSequence.Batch, NodeSequence.Restartable
Modifier and Type | Field and Description |
---|---|
protected List<CachedNode> |
nodes |
protected long |
rowCount |
protected int |
rowNumber |
protected List<Float> |
scores |
Modifier | Constructor and Description |
---|---|
protected |
SingleWidthBatch(NodeSequence.Batch batch) |
Modifier and Type | Method and Description |
---|---|
protected void |
addRow(NodeSequence.Batch batch) |
CachedNode |
getNode()
Get the first node in the current row.
|
CachedNode |
getNode(int index)
Get the node at the specified index in the current row.
|
float |
getScore()
Get the score for the first node in the current row.
|
float |
getScore(int index)
Get the score for the specified node in the current row.
|
String |
getWorkspaceName()
Get the name of the workspace in which exists all nodes in this batch.
|
boolean |
hasNext()
Determine if there are more rows in this batch.
|
boolean |
isEmpty()
Determine whether this batch is empty.
|
void |
nextRow()
Move to the next row in this batch.
|
protected int |
nodeIndex(int rowNumber,
int positionInRow) |
void |
restart() |
long |
rowCount()
Get the number of rows in the batch, if that information is available.
|
String |
toString() |
int |
width()
Get the number of nodes in each row.
|
protected final List<CachedNode> nodes
protected int rowNumber
protected final long rowCount
protected SingleWidthBatch(NodeSequence.Batch batch)
public void restart()
restart
in interface NodeSequence.Restartable
protected void addRow(NodeSequence.Batch batch)
public String getWorkspaceName()
NodeSequence.Batch
getWorkspaceName
in interface NodeSequence.Batch
public int width()
NodeSequence.RowAccessor
width
in interface NodeSequence.RowAccessor
public boolean isEmpty()
NodeSequence.Batch
isEmpty
in interface NodeSequence.Batch
public long rowCount()
NodeSequence.Batch
rowCount
in interface NodeSequence.Batch
public boolean hasNext()
NodeSequence.Batch
hasNext
in interface NodeSequence.Batch
public void nextRow()
NodeSequence.Batch
nextRow
in interface NodeSequence.Batch
public CachedNode getNode()
NodeSequence.RowAccessor
getNode(0)
.getNode
in interface NodeSequence.RowAccessor
public CachedNode getNode(int index)
NodeSequence.RowAccessor
getNode
in interface NodeSequence.RowAccessor
index
- the 0-based index for the node in the row; must be less than NodeSequence.RowAccessor.width()
.public float getScore()
NodeSequence.RowAccessor
getScore(0)
.getScore
in interface NodeSequence.RowAccessor
public float getScore(int index)
NodeSequence.RowAccessor
getScore
in interface NodeSequence.RowAccessor
index
- the 0-based index for the node in the row; must be less than NodeSequence.RowAccessor.width()
.protected int nodeIndex(int rowNumber, int positionInRow)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.