CSVTokenizer (OpenMap API)
Date: 2016-12-09

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.util
Class CSVTokenizer

    java.lang.Object
      java.io.Reader
          java.io.FilterReader
              java.io.PushbackReader
                  com.bbn.openmap.util.Tokenizer
                      com.bbn.openmap.util.CSVTokenizer

All Implemented Interfaces:
  java.io.Closeable, java.lang.Readable

    public class CSVTokenizer

extends Tokenizer

Tokenizer for comma separated values files, at least as generated by excel.

token() returns the next token, which can be either:

- null, indicating an empty field.
- a Double, indicating a numeric field.
- a String, indicating an alphanumeric field.
- the NEWLINE object, indicating the end of a record.
- the EOF object, test with isEOF(), indicating the end of file.

Field Summary
`protected java.lang.Object` | `lastTokened`

Fields inherited from class com.bbn.openmap.util.Tokenizer
`EMPTY, EOF, NEWLINE`

Fields inherited from class java.io.FilterReader
`in`

Fields inherited from class java.io.Reader
`lock`

Constructor Summary
`CSVTokenizer(java.io.Reader in)`
`CSVTokenizer(java.io.Reader in, boolean numberReadAsString)` If you set numberReadAsString is true, then any number will be maintained as a String.

Method Summary
`static void` | `main(java.lang.String[] args)`
`java.lang.Object` | `token()`
`protected java.lang.Object` | `tokenAfterComma()` Return the next object read from the stream, called if a comma is found first in order to catch empty fields accurately.

Methods inherited from class com.bbn.openmap.util.Tokenizer
`bclear, bpush, error, isAlpha, isAlphanumeric, isAny, isDigit, isEOF, isNewline, next, putback`

Methods inherited from class java.io.PushbackReader
`close, mark, markSupported, read, read, ready, reset, skip, unread, unread, unread`

Methods inherited from class java.io.Reader
`read, read`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### lastTokened

    protected java.lang.Object lastTokened

Constructor Detail

### CSVTokenizer

    public CSVTokenizer(java.io.Reader in)

### CSVTokenizer

    public CSVTokenizer(java.io.Reader in,
                        boolean numberReadAsString)

  If you set numberReadAsString is true, then any number will be maintained as a String.

  Parameters:
    `in` - input Reader
    `numberReadAsString` - true if numbers should be interpreted to Strings

Method Detail

### token

    public java.lang.Object token()

  Returns:
    the next object read from the stream.

### tokenAfterComma

    protected java.lang.Object tokenAfterComma()

  Return the next object read from the stream, called if a comma is found first in order to catch empty fields accurately.

### main

    public static void main(java.lang.String[] args)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details