|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.metaqtl.bio.util.TabulatedReader
public final class TabulatedReader
This class can be used to parse tabulated file in which the first line
contains the label of the tabulated fields. To use this class is very simple :
try { TabulatedFileReader reader = new TabulatedFileReader(new FileInputStream("mytabulatedfile.tab"));
ArrayList keys = tab.getKeys(); ... do something with keys while (tab.hasNext()) { // new line String value = tab.get("key"); ... } } catch (IOException) { ... } ...
Constructor Summary | |
---|---|
TabulatedReader(java.io.InputStream stream)
|
|
TabulatedReader(java.io.Reader reader)
|
Method Summary | |
---|---|
void |
close()
Closes the stream. |
boolean |
containsKey(java.lang.String string)
Returns true if the given string is a key of the tabulated file. |
java.lang.String |
get(java.lang.String key)
Returns the value of the field which belongs to the given key. |
java.util.Set |
getKeys()
Returns the set of the keys. |
java.lang.String |
getToken()
|
boolean |
hasNext()
Returns true if there is still a line to read. |
void |
setToken(java.lang.String token)
|
int |
size()
Returns the number of keys, i.e the number of columns in the file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TabulatedReader(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public TabulatedReader(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public boolean containsKey(java.lang.String string)
string
-
public int size()
public java.util.Set getKeys()
public boolean hasNext() throws java.io.IOException
java.io.IOException
public java.lang.String get(java.lang.String key)
key
-
public void close() throws java.io.IOException
java.io.IOException
public java.lang.String getToken()
public void setToken(java.lang.String token)
token
- The token to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |