|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpulling.availability_predection.AvailabilityLogger
public class AvailabilityLogger
This class is responsible for maintaining the file that stores information about the availability history.
Constructor Summary | |
---|---|
AvailabilityLogger()
|
|
AvailabilityLogger(int timeResolution,
int pastReadingsCount)
|
Method Summary | |
---|---|
int |
getPastReadingsCount()
|
double |
getReading(int ageRank,
WeekDay wd,
TimeStamp ts)
This method reads a reading for a specific entry at specific age. |
int |
getTimeresolution()
|
void |
initHistoryFile()
This method initiates the history files |
void |
initHistoryFileWithRandomData()
This method initiates the history files with random data |
void |
insertNewReading(double reading,
WeekDay wd,
TimeStamp ts)
This method set a new reading for a specific entry and age the rest of the readings by 1 |
static void |
main(java.lang.String[] args)
|
void |
printHistoryFile(int fractionsDigits)
This method prints the history file |
java.lang.String |
readFixedLengthString(int n,
java.io.DataInput inStream)
This method simply read a fixed number of characters off a DataInputStream |
void |
setReadingQuick(double reading,
int ageRank,
WeekDay wd,
TimeStamp ts)
This method set a reading for a specific entry at specific age. |
void |
writeFixedLengthString(java.lang.String toBeWritten,
int n,
java.io.DataOutput outStream)
This method writes to output stream outStream the string toBeWritten. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AvailabilityLogger()
public AvailabilityLogger(int timeResolution, int pastReadingsCount)
Method Detail |
---|
public int getPastReadingsCount()
public int getTimeresolution()
public void initHistoryFile()
public void initHistoryFileWithRandomData()
public void printHistoryFile(int fractionsDigits)
public void setReadingQuick(double reading, int ageRank, WeekDay wd, TimeStamp ts) throws java.io.IOException
reading
- New value desired to be set.ageRank
- every time slot have N number of reading. 0 means the most
recent reading.wd
- is the weekday.ts
- is the time stamp. Together with wd, the specific time slot is
defined. example: if you had this line: SUNDAY_22_20: .85 .83
.87 .82 .80 and setReadingQuick(.90, 0, Weekday.Monday, new
TimeStam(22, 20) ) was invoked, that line will be:
SUNDAY_22_20: .90 .83 .87 .82 .80. Other lines aren't effected
java.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
args
-
java.io.IOException
public void insertNewReading(double reading, WeekDay wd, TimeStamp ts) throws java.io.IOException
reading
- New value desired to be set.wd
- is the weekday.ts
- is the time stamp. (e.g. 12_10)
java.io.IOException
public double getReading(int ageRank, WeekDay wd, TimeStamp ts)
ageRank
- every time slot have N number of reading. 1 means the most
recent reading.wd
- is the weekday.ts
- is the time stamp. Together with wd, the specific time slot is
defined. example: if you had this line: SUNDAY_22_20: .85 .83
.87 .82 .80 and setReadingQuick(.90, 0, Weekday.Monday, new
TimeStam(22, 20) ) was invoked, that line will be:
SUNDAY_22_20: .90 .83 .87 .82 .80. Other lines aren't effectedpublic java.lang.String readFixedLengthString(int n, java.io.DataInput inStream) throws java.io.IOException
n
- size of read StringinStream
- DataInput to read from (e.g RandomAccessFile Object)
java.io.IOException
public void writeFixedLengthString(java.lang.String toBeWritten, int n, java.io.DataOutput outStream) throws java.io.IOException
n
- size of written StringoutStream
- outStream to read from (e.g RandomAccessFile Object)
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |