|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fsmvis.data.CSVLoader
Field Summary | |
static java.util.Map |
CSV_TYPES
|
protected java.io.BufferedReader |
csvFile
|
protected DataItemCollection |
dataItemColl
|
static java.lang.String |
DATE_FORMAT
|
static java.lang.String |
DATE_NAME
|
protected java.text.SimpleDateFormat |
dateF
|
static java.lang.String |
DEFAULT_DATE
|
static java.lang.String |
DEFAULT_DATE_FORMAT
|
static java.lang.String |
DEFAULT_DELIMITER
|
static java.lang.String |
DEFAULT_DOUBLE
|
static java.lang.String |
DEFAULT_INTEGER
|
static java.lang.String |
DEFAULT_STRING
|
static java.lang.String |
DEFAULT_UNDEFINED
|
protected java.lang.String |
delim
|
static java.lang.String |
DELIMITER_FORMAT
|
static java.lang.String |
DOUBLE_NAME
|
protected java.util.ArrayList |
fields
|
protected java.lang.String |
fileName
|
static java.lang.String |
INTEGER_NAME
|
protected int |
numDataItems
|
protected Viewer |
parent
|
protected int |
progress
|
protected PropertiesHandler |
properties
|
static java.lang.String |
STRING_NAME
|
protected double[] |
sumOfSquares
|
protected double[] |
sumOfVals
|
protected int |
taskLength
|
protected java.util.ArrayList |
types
|
protected java.lang.String |
undef
|
static java.lang.String |
UNDEFINED_FORMAT
|
Constructor Summary | |
CSVLoader(Viewer parent,
java.lang.String fileName)
Constructor for CSVLoader, takes a csv filename as param |
Method Summary | |
void |
doneWork()
A method that is called when ever an item of work has been completed |
void |
doneWork(int units)
A method that is called when ever a number of work items have been completed |
DataItemCollection |
getDataItemCollection()
Returns a DataItemCollection object containing the data in the csv file |
java.util.ArrayList |
getFields()
gets the field names in the csv file |
int |
getLengthOfTask()
Returns the length of this current task, this is defined to be some kind of abstract work unit. |
int |
getProgress()
Returns the current progress through this task. |
java.util.ArrayList |
getTypes()
Gets the types that correspond to the field names, |
protected void |
initProperties()
initialises the properties associated with this loader |
boolean |
isFinished()
Returns whether or not the current task has been completed |
DataItem |
parseDataItem(java.lang.String line)
Method to parse a data item, turns the String of fields in the data item into a dataItem object. |
void |
readData()
Reads from the data source and parses its contents to create a DataItemCollection |
void |
readFields()
Reads the field names from the first line of the csv file Assumes the input pointer is ready at the start of the file |
void |
readTypes()
Reads the corresponding types from the second line of csv file Assumes the input pointer is at the start of the second line of the csv file. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static java.util.Map CSV_TYPES
protected Viewer parent
protected DataItemCollection dataItemColl
protected int numDataItems
protected java.lang.String fileName
protected PropertiesHandler properties
protected java.util.ArrayList fields
protected java.util.ArrayList types
protected java.io.BufferedReader csvFile
protected double[] sumOfVals
protected double[] sumOfSquares
protected java.text.SimpleDateFormat dateF
protected java.lang.String delim
protected java.lang.String undef
protected int taskLength
protected int progress
public static final java.lang.String DOUBLE_NAME
public static final java.lang.String INTEGER_NAME
public static final java.lang.String STRING_NAME
public static final java.lang.String DATE_NAME
public static final java.lang.String DATE_FORMAT
public static final java.lang.String UNDEFINED_FORMAT
public static final java.lang.String DELIMITER_FORMAT
public static final java.lang.String DEFAULT_DOUBLE
public static final java.lang.String DEFAULT_INTEGER
public static final java.lang.String DEFAULT_STRING
public static final java.lang.String DEFAULT_DATE
public static final java.lang.String DEFAULT_UNDEFINED
public static final java.lang.String DEFAULT_DELIMITER
public static final java.lang.String DEFAULT_DATE_FORMAT
Constructor Detail |
public CSVLoader(Viewer parent, java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOException
fileName
- The csv file to be loadedMethod Detail |
protected void initProperties()
public void readFields() throws java.io.IOException
public void readTypes() throws java.io.IOException, java.text.ParseException
public void readData() throws java.io.IOException, java.text.ParseException
public DataItem parseDataItem(java.lang.String line) throws java.text.ParseException
line
- The line containing the data for this itempublic DataItemCollection getDataItemCollection()
public java.util.ArrayList getFields()
public java.util.ArrayList getTypes()
public int getLengthOfTask()
public int getProgress()
public boolean isFinished()
public void doneWork()
public void doneWork(int units)
units
- The number of work units that where comleted
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |