diff options
Diffstat (limited to 'src/com/android/loganalysis/item/DmesgStageInfoItem.java')
-rw-r--r-- | src/com/android/loganalysis/item/DmesgStageInfoItem.java | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/com/android/loganalysis/item/DmesgStageInfoItem.java b/src/com/android/loganalysis/item/DmesgStageInfoItem.java index a5bfd39..a446090 100644 --- a/src/com/android/loganalysis/item/DmesgStageInfoItem.java +++ b/src/com/android/loganalysis/item/DmesgStageInfoItem.java @@ -30,9 +30,11 @@ public class DmesgStageInfoItem extends GenericItem { public static final String STAGE_NAME = "STAGE_NAME"; /** Constant for JSON output */ public static final String STAGE_START_TIME = "STAGE_START_TIME"; + /** Constant for JSON output */ + public static final String STAGE_DURATION = "STAGE_DURATION"; private static final Set<String> ATTRIBUTES = new HashSet<String>(Arrays.asList( - STAGE_NAME, STAGE_START_TIME)); + STAGE_NAME, STAGE_START_TIME, STAGE_DURATION)); /** * The constructor for {@link DmesgStageInfoItem}. @@ -44,10 +46,11 @@ public class DmesgStageInfoItem extends GenericItem { /** * The constructor for {@link DmesgStageInfoItem}. */ - public DmesgStageInfoItem(String name, Long startTime) { + public DmesgStageInfoItem(String name, Long startTime, Long duration) { super(ATTRIBUTES); setAttribute(STAGE_NAME, name); setAttribute(STAGE_START_TIME, startTime); + setAttribute(STAGE_DURATION, duration); } /** @@ -78,10 +81,24 @@ public class DmesgStageInfoItem extends GenericItem { setAttribute(STAGE_START_TIME, startTime); } + /** + * Get the duration in msecs + */ + public Long getDuration() { + return (Long) getAttribute(STAGE_DURATION); + } + + /** + * Set the duration in msecs + */ + public void setDuration(Long duration) { + setAttribute(STAGE_DURATION, duration); + } + @Override public String toString() { return "StageInfoItem [getStageName()=" + getStageName() + ", getStartTime()=" - + getStartTime() + "]"; + + getStartTime() + ", getDuration()=" + getDuration() + "]"; } } |