|
mwalk Platform 0.3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mwalk.core.PeriodTable
A class representing the cummulative activity for a link.
Field Summary | |
java.util.Hashtable |
data
Temporary data that can be stored in table |
protected java.util.Vector |
entries
List of period entries |
(package private) static long |
serialVersionUID
Serialize version ID |
Constructor Summary | |
PeriodTable()
Default constructor. |
Method Summary | |
long |
add(long start,
long stop)
Add a new time period into the table, without merging adjacent entries. |
long |
bound(long stop)
Bound the period table with an explicit stop time. |
void |
bound(PeriodTable bounder)
Bound all entries by those from another table (child's table). |
boolean |
check(long time)
Check whether a specific time falls within the table periods. |
void |
clearData()
Clear temporary data for table and each entry |
long |
getDuration(long bound)
Retrieve the total active time in the period table. |
long |
getEarliest()
Retrieve the earliest time in the period table. |
long |
getLatest()
Retrieve the latest time in the period table. |
void |
load(java.io.BufferedReader br)
Load a period table from a file. |
long |
merge()
Merge the activity table with no specific bound on the final stop time. |
long |
merge(long maxStop)
Merge the activity table with a specific bound on the final stop time. |
void |
merge(PeriodTable merger)
Merge periods from another table into this one. |
static PeriodTable |
merge(PeriodTable[] tables)
Create a new table that contains the total activity of all component tables. |
void |
print()
Print the contents of the period table. |
private void |
readObject(java.io.ObjectInputStream in)
Initialize transient variables after reading the object in. |
void |
setEarliest(long time)
Set the earliest time in the period table if not already earlier. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final long serialVersionUID
protected java.util.Vector entries
public transient java.util.Hashtable data
Constructor Detail |
public PeriodTable()
Method Detail |
public long getEarliest()
long
earliest time in the table or Long.MAX_VALUE if no earliest time availablepublic void setEarliest(long time)
long
- earliest time to setpublic long getLatest()
long
latest time in the table or Long.MAX_VALUE if no latest time availablepublic long getDuration(long bound)
bound
- maximum stop time consideredlong
total active timepublic boolean check(long time)
long
- time to check forboolean
whether the time fell withing the tables periodspublic long add(long start, long stop)
long
- start time of periodlong
- stop time of periodlong
actual stop time, possibly reduced due to earlier explicit start timespublic long bound(long stop)
long
- explicit stop timelong
next explicit start time beyond this stoppublic void bound(PeriodTable bounder)
public long merge()
long
actual final stop timepublic long merge(long maxStop)
long
- bound on final stop timelong
actual final stop timepublic void merge(PeriodTable merger)
PeriodTable
- table to merge into this onepublic static PeriodTable merge(PeriodTable[] tables)
PeriodTable[]
- list of component tables to mergePeriodTable
new table with total activitypublic void load(java.io.BufferedReader br) throws BuildException
BufferedReader
- reader to use to parse filepublic void print()
public void clearData()
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
ObjectInputStream
- input streamIOException
- if object not read correctly
|
mwalk Platform 0.3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |