KADABRA API

LARA API

LARA Common Language API

(.js)
laraImport("lara.iterators.LineIterator");

(.lara)
import lara.iterators.LineIterator;

LineIterator

Constructor

LineIterator

new LineIterator(contents)

(Extends LaraIterator)
Iterates over a sequence of lines.

Parameters

contents: string|J#java.io.File - The contents that will be iterated as lines.

Instance Members

close

close()

Closes the iterator. For instane, if the iterator is backed-up by a file, it needs to be closed before the file can be deleted.


getNumElements

getNumElements()

Returns

number - the total number of elements of the iterator, or undefined if it is not possible to calculate.

getNumValuesPerElement

getNumValuesPerElement()

Returns

any - The number of values returned by a call to next(). A value of one means one value, a value greater than one means an array with that amount of values.

getType

getType()

hasNext

hasNext()

Returns

boolean - true if it has another element to return.

next

next()

Returns

any - the next element.

reset

reset()

Resets the iterator.