|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.perfectjpattern.core.behavioral.observer.data.StatusData org.perfectjpattern.core.behavioral.observer.data.ProgressData
public class ProgressData
Immutable Observer event data intended to be used in notifying progress information.
Field Summary | |
---|---|
static ProgressData |
COMPLETED
Reusable ProgressData instance corresponding to a
Completed event. |
static ProgressData |
FAILED
Reusable ProgressData instance corresponding to a
Failed event. |
static ProgressData |
STARTED
Reusable ProgressData instance corresponding to a
Started event. |
Constructor Summary | |
---|---|
ProgressData(ProgressData aProgressData)
Copy constructor. |
|
ProgressData(Status aStatus,
String aMessage,
int aProgress)
Creates a progress information with precalculated task percentage completed. |
|
ProgressData(Status aStatus,
String aMessage,
int aTotal,
int aCurrent)
Creates a progress information with total and current progress values, this variation of the constructor calculates the percentage based on the two values. |
Method Summary | |
---|---|
boolean |
equals(Object anObject)
|
int |
getProgress()
Returns the progress information as an Integer with value between 0 and 100. |
int |
hashCode()
|
String |
toString()
|
Methods inherited from class org.perfectjpattern.core.behavioral.observer.data.StatusData |
---|
getMessage, getStatus |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ProgressData STARTED
ProgressData
instance corresponding to a
Started event.
public static final ProgressData FAILED
ProgressData
instance corresponding to a
Failed event.
public static final ProgressData COMPLETED
ProgressData
instance corresponding to a
Completed event.
Constructor Detail |
---|
public ProgressData(Status aStatus, String aMessage, int aProgress)
aStatus
- Status of the taskaMessage
- Description of the current statusaProgress
- Percentage of completion of the task [0 .. 100]
IllegalArgumentException
- "'aStatus' must not be null"
IllegalArgumentException
- "'aMessage' must not be null"public ProgressData(Status aStatus, String aMessage, int aTotal, int aCurrent)
aStatus
- Status of the taskaMessage
- Description of the current statusaTotal
- Numeric total of the taskaCurrent
- Current value of the task in reference to the totalpublic ProgressData(ProgressData aProgressData)
aProgressData
- Existing ProgressDataMethod Detail |
---|
public int getProgress()
public boolean equals(Object anObject)
equals
in class StatusData
public int hashCode()
hashCode
in class StatusData
public String toString()
toString
in class StatusData
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |