|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.crunch.contrib.text.Tokenizer
public class Tokenizer
Manages a Scanner
instance and provides support for returning only a subset
of the fields returned by the underlying Scanner
.
Constructor Summary | |
---|---|
Tokenizer(Scanner scanner,
Set<Integer> indices,
boolean keep)
Create a new Tokenizer instance. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if the underlying Scanner has any tokens remaining. |
String |
next()
Advance this Tokenizer and return the next String from the Scanner . |
Boolean |
nextBoolean()
Advance this Tokenizer and return the next Boolean from the Scanner . |
Double |
nextDouble()
Advance this Tokenizer and return the next Double from the Scanner . |
Float |
nextFloat()
Advance this Tokenizer and return the next Float from the Scanner . |
Integer |
nextInt()
Advance this Tokenizer and return the next Integer from the Scanner . |
Long |
nextLong()
Advance this Tokenizer and return the next Long from the Scanner . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Tokenizer(Scanner scanner, Set<Integer> indices, boolean keep)
Tokenizer
instance.
scanner
- The scanner to manageindices
- The indices to keep/dropkeep
- Whether the indices should be kept (true) or dropped (false)Method Detail |
---|
public boolean hasNext()
Scanner
has any tokens remaining.
public String next()
Tokenizer
and return the next String from the Scanner
.
Scanner
public Long nextLong()
Tokenizer
and return the next Long from the Scanner
.
Scanner
public Boolean nextBoolean()
Tokenizer
and return the next Boolean from the Scanner
.
Scanner
public Double nextDouble()
Tokenizer
and return the next Double from the Scanner
.
Scanner
public Float nextFloat()
Tokenizer
and return the next Float from the Scanner
.
Scanner
public Integer nextInt()
Tokenizer
and return the next Integer from the Scanner
.
Scanner
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |