|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.ArrayList<T> com.oziexplorer.DataFile<T>
T
- type of object the data file holds - Waypoints, Track points etc.public abstract class DataFile<T>
Base class for OziExplorer datafile access classes - contains various utility routines that are common to all data file types.
Field Summary | |
---|---|
protected static Charset |
C
The character set used by the OziExplorer data files - assume the current Windows active code page is being used. |
protected static Locale |
L
The locale for the OziExploret data files (English). |
protected static Pattern |
SepRE
A pattern to match OziExplorer data file field separators. |
protected static TimeZone |
T
The timezone for the date/time values in the data files. |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
DataFile()
|
Method Summary | |
---|---|
protected double |
calendarToOziDate(Calendar cal)
Convert a Java Calendar to an OziExplorer format date. |
protected String |
escapeCommas(String str)
OziExplorer uses character 209(dec) to escape commas in data files. |
protected Calendar |
getDate(Scanner s)
Get a date, or a default value (the current date). |
protected double |
getDouble(Scanner s,
double defVal)
Get a double, or a default value. |
protected int |
getInt(Scanner s,
int defVal)
Get an integer, or a default value. |
protected String |
getString(Scanner s)
Get a string, or a default value (empty string). |
protected OziException |
newOziException(LineNumberReader in)
Create a new exception containing the current line number in the input file, if possible. |
protected OziException |
newOziException(LineNumberReader in,
Throwable e)
Create a new exception containing the current line number in the input file, if possible and an nested exception. |
protected Scanner |
newScanner(String line)
Trim any leading or trailing whitespace from the line and create a new Scanner to process it, assuming the standard OziExplorer comma
separator and an English locale. |
protected Calendar |
oziDateToCalendar(double oziDate)
Convert an OziExplorer format date into a Java Calendar object. |
protected void |
skipNext(Scanner s)
If the next field exists, skip it. |
protected String |
unescapeCommas(String str)
OziExplorer uses character 209(dec) to escape commas in data files. |
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Field Detail |
---|
protected static final Pattern SepRE
protected static final TimeZone T
protected static final Locale L
protected static final Charset C
Constructor Detail |
---|
public DataFile()
Method Detail |
---|
protected Scanner newScanner(String line)
Scanner
to process it, assuming the standard OziExplorer comma
separator and an English locale.
line
- the line to be scanned.
Scanner
to process the line.protected int getInt(Scanner s, int defVal)
s
- the scanner to read from.defVal
- the default value.
protected double getDouble(Scanner s, double defVal)
s
- the scanner to read from.defVal
-
protected String getString(Scanner s)
s
- the scanner to read from.
protected Calendar getDate(Scanner s)
s
- the scanner to read from.
protected void skipNext(Scanner s)
s
- the scanner to read from.protected String escapeCommas(String str)
str
- the string to escape.
protected String unescapeCommas(String str)
str
- the string to unescape.
protected Calendar oziDateToCalendar(double oziDate)
Calendar
object.
Ozi dates are expressed as fractional days since midnight of 31/12/1899.
oziDate
- the OziExplorer format date.
Calendar
.protected double calendarToOziDate(Calendar cal)
Calendar
to an OziExplorer format date. Ozi dates
are expressed as fractional days since midnight of 31/12/1899.
cal
- the Java Calendar
format date.
protected OziException newOziException(LineNumberReader in)
in
- the LineNumberReader
that is being used to read the
file. May be null.
protected OziException newOziException(LineNumberReader in, Throwable e)
in
- the LineNumberReader
that is being used to read the
file. May be null.e
- the nested exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |