diff options
author | jdesprez <jdesprez@google.com> | 2017-06-02 21:59:22 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-06-02 21:59:22 +0000 |
commit | 094b0818063d151d1a12dd5bf355b472ad176582 (patch) | |
tree | 13281a6c8b77e1e4c4fe2bdebef6eb2b2b874632 /src/com/android/loganalysis/item/DmesgStageInfoItem.java | |
parent | 48536711eb7f18605dede267f07421e0b0453f21 (diff) | |
parent | 6722a63f63ea406f42edb2c03b18bbb6fd8c24c6 (diff) | |
download | loganalysis-094b0818063d151d1a12dd5bf355b472ad176582.tar.gz |
DO NOT MERGE: Drop loganalysis master into oc-dev
am: 6722a63f63
Change-Id: I4cb47656f05e55845fb4d4a96887a87e432aa3d2
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() + "]"; } } |