|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@InterfaceAudience.Private @InterfaceStability.Unstable public interface CellScanner
An interface for iterating through a sequence of cells. Similar to Java's Iterator, but without the hasNext() or remove() methods. The hasNext() method is problematic because it may require actually loading the next object, which in turn requires storing the previous object somewhere.
The core data block decoder should be as fast as possible, so we push the complexity and performance expense of concurrently tracking multiple cells to layers above the CellScanner.
The current()
method will return a reference to a Cell implementation. This reference
may or may not point to a reusable cell implementation, so users of the CellScanner should not,
for example, accumulate a List of Cells. All of the references may point to the same object,
which would be the latest state of the underlying Cell. In short, the Cell is mutable.
while (scanner.advance()) { Cell cell = scanner.current(); // do something }
Often used reading Cell
s written by
CellOutputStream
.
Method Summary | |
---|---|
boolean |
advance()
Advance the scanner 1 cell. |
Cell |
current()
|
Method Detail |
---|
Cell current()
boolean advance() throws IOException
current()
will return a valid Cell
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |