| java.lang.Object de.mcs.jmeasurement.example.UserDataStore
UserDataStore | public class UserDataStore implements IUserData(Code) | | This is a Object to store all measured data into an ArrayList. The data will
be stored with the date, currentMilliSecond and the accrued fields. Then, if
you want, you can store the data automatically every x data into a file. The
file will be opend first time when writing data and can be closed any time
you want. After measuring the file must be closed (with
UserDataStore.close()). You can also read the measuring with the
UserDataStore.getData()
author: w.klaas |
Inner Class :static class Item | |
Constructor Summary | |
public | UserDataStore(int aWritingCount, String aFileName) Constructor for this object.
Parameters: aWritingCount - if the are writingCount data items in the list, the data willbe stored to the file. |
Method Summary | |
final public void | addData(long accrued) Adding data with the actual datetime. | final public void | addData(long accrued, Date date) Adding data with defined date. | final public Object | clone() cloning this userdata object. | final public void | closeFile() Writing the last datas and close the file. | final public String[] | getData() Getting all data as String array (like the file, but without the header). | final public char | getSepChar() | final public void | setSepChar(char aSepChar) | final public void | writeToStream(OutputStream stream) writeing all data to the stream and resetting the internal array. |
UserDataStore | public UserDataStore(int aWritingCount, String aFileName)(Code) | | Constructor for this object.
Parameters: aWritingCount - if the are writingCount data items in the list, the data willbe stored to the file. Set this to -1 no data will be storedautomatically. But you can store the data manually with thewriteToStream methode. Parameters: aFileName - name of the file to write to (incl. path) |
addData | final public void addData(long accrued)(Code) | | Adding data with the actual datetime.
Parameters: accrued - the data to add |
addData | final public void addData(long accrued, Date date)(Code) | | Adding data with defined date.
Parameters: accrued - data to add Parameters: date - date when to add |
clone | final public Object clone()(Code) | | cloning this userdata object.
Object |
closeFile | final public void closeFile()(Code) | | Writing the last datas and close the file.
|
getData | final public String[] getData()(Code) | | Getting all data as String array (like the file, but without the header).
String[] |
getSepChar | final public char getSepChar()(Code) | | Returns the sepChar. |
setSepChar | final public void setSepChar(char aSepChar)(Code) | | Parameters: aSepChar - The sepChar to set. |
writeToStream | final public void writeToStream(OutputStream stream)(Code) | | writeing all data to the stream and resetting the internal array.
Parameters: stream - Stream to write |
|
|