|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.lang.Thread
|
+--lane.sente.Battery
This is a simple thread that simply refills itself constantly. It is designed to ensure that robots can not do too much at one time.
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
Battery()
This is the default constructor |
|
Battery(int maxEnergy,
int refillRate)
This is the constructor |
|
| Method Summary | |
int |
getEnergy()
the method used to determine the amount of energy in the battery |
int |
getMaxEnergy()
the method used to determine the capacity of the battery |
int |
getRefillRate()
the method used to determine the refill rate of the battery |
void |
removeEnergy(int i)
the method used to remove energy from the battery |
void |
run()
The run method inherited from Thread |
void |
setEnergy(int i)
the method used to set the energy level in the barry |
void |
setMaxEnergy(int i)
the method used to set the maximum amount of energy the battery may contain |
void |
setRefillRate(int i)
the method used to set the refil rate of the battery |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Battery()
public Battery(int maxEnergy,
int refillRate)
maxEnergy - the maximum amount of energy the battery can containrefilRate - the rate at which the battery refils| Method Detail |
public void run()
run in class java.lang.Threadpublic int getEnergy()
public int getMaxEnergy()
public int getRefillRate()
public void setEnergy(int i)
i - the level to set the battery topublic void removeEnergy(int i)
i - the amount of energy to removepublic void setMaxEnergy(int i)
i - the amount to set the max energy contained in this batterypublic void setRefillRate(int i)
i - the rate to set the refill rate to
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||