| Modifier and Type | Field and Description |
|---|---|
static Pattern |
colon |
static Pattern |
comma |
static int |
DEFAULT_BUFFER_SIZE |
protected static String |
ENCODING |
protected File |
file |
protected BufferedReader |
in |
protected BufferedWriter |
out |
static boolean |
R |
static Pattern |
semicolon |
static Pattern |
space |
static Pattern |
tab |
static boolean |
W |
protected boolean |
writeable |
| Constructor and Description |
|---|
TextFile(File file,
boolean mode) |
TextFile(File file,
boolean mode,
int buffersize) |
TextFile(String file,
boolean mode) |
TextFile(String file,
boolean mode,
int buffersize) |
| Modifier and Type | Method and Description |
|---|---|
void |
append(char c) |
void |
append(CharSequence csq) |
void |
close() |
int |
countCols(Pattern p) |
int |
countLines() |
void |
flush() |
String |
getFileName() |
Iterator<String> |
iterator() |
void |
open() |
String[] |
readAsArray() |
String[] |
readAsArray(int col,
Pattern p) |
ArrayList<String> |
readAsArrayList() |
ArrayList<String> |
readAsArrayList(int col,
Pattern p) |
Map<String,String> |
readAsHashMap(int col1,
int col2) |
Map<String,String> |
readAsHashMap(int col1,
int[] col2,
String seperator) |
Map<String,String> |
readAsHashMap(int col1,
int col2,
Pattern p) |
HashSet<Pair<String,String>> |
readAsPairs(int A,
int B) |
Set<String> |
readAsSet(int col,
Pattern p) |
HashSet<Triple<String,String,String>> |
readAsTriple(int A,
int B,
int C) |
String |
readLine() |
String[] |
readLineElems(Pattern p)
This method is a wrapper for readLineElemsReturnReference: this method
returns default substrings delimited by Pattern p.
|
Iterable<String[]> |
readLineElemsIterable(Pattern p) |
String[] |
readLineElemsReturnObjects(Pattern p)
This method returns a new object for each of the splitted elements,
instead of the default action, in which each substring is backed by the
original full-length String.
|
String[] |
readLineElemsReturnReference(Pattern p)
This method returns default substrings delimited by Pattern p.
|
void |
write(String line) |
void |
writeList(List l) |
void |
writeln() |
void |
writeln(CharSequence csq) |
void |
writeln(String line) |
void |
writelnDelimited(Object[] vals,
Pattern p) |
void |
writelnsynced(String str) |
void |
writelnTabDelimited(Object[] vals) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static final int DEFAULT_BUFFER_SIZE
public static final Pattern tab
public static final Pattern space
public static final Pattern colon
public static final Pattern semicolon
public static final Pattern comma
protected BufferedReader in
protected File file
public static final boolean W
public static final boolean R
protected BufferedWriter out
protected boolean writeable
protected static final String ENCODING
public TextFile(String file, boolean mode) throws IOException
IOExceptionpublic TextFile(File file, boolean mode) throws IOException
IOExceptionpublic TextFile(File file, boolean mode, int buffersize) throws IOException
IOExceptionpublic TextFile(String file, boolean mode, int buffersize) throws IOException
IOExceptionpublic final void open()
throws IOException
IOExceptionpublic String readLine() throws IOException
IOExceptionpublic void write(String line) throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic String[] readLineElems(Pattern p) throws IOException
p - The Pattern object to split with (e.g. TextFile.tab or
Strings.comma)IOExceptionpublic String[] readLineElemsReturnReference(Pattern p) throws IOException
p - The Pattern object to split with (e.g. TextFile.tab or
Strings.comma)IOExceptionpublic String[] readLineElemsReturnObjects(Pattern p) throws IOException
p - The Pattern object to split with (e.g. TextFile.tab or
Strings.comma)IOExceptionpublic int countLines()
throws IOException
IOExceptionpublic int countCols(Pattern p) throws IOException
IOExceptionpublic String[] readAsArray() throws IOException
IOExceptionpublic String[] readAsArray(int col, Pattern p) throws IOException
IOExceptionpublic ArrayList<String> readAsArrayList() throws IOException
IOExceptionpublic ArrayList<String> readAsArrayList(int col, Pattern p) throws IOException
IOExceptionpublic void writeln(CharSequence csq) throws IOException
IOExceptionpublic void writeln(String line) throws IOException
IOExceptionpublic void writeln()
throws IOException
IOExceptionpublic void append(char c)
throws IOException
IOExceptionpublic void append(CharSequence csq) throws IOException
IOExceptionpublic void writelnsynced(String str) throws IOException
IOExceptionpublic void writelnTabDelimited(Object[] vals) throws IOException
IOExceptionpublic void writelnDelimited(Object[] vals, Pattern p) throws IOException
IOExceptionpublic Map<String,String> readAsHashMap(int col1, int col2) throws IOException
IOExceptionpublic Map<String,String> readAsHashMap(int col1, int[] col2, String seperator) throws IOException
IOExceptionpublic Map<String,String> readAsHashMap(int col1, int col2, Pattern p) throws IOException
IOExceptionpublic Set<String> readAsSet(int col, Pattern p) throws IOException
IOExceptionpublic void writeList(List l) throws IOException
IOExceptionpublic String getFileName()
public HashSet<Pair<String,String>> readAsPairs(int A, int B) throws IOException
IOExceptionpublic void flush()
throws IOException
IOExceptionpublic HashSet<Triple<String,String,String>> readAsTriple(int A, int B, int C) throws IOException
IOExceptionCopyright © 2015. All Rights Reserved.