1 package com.android.loganalysis.item;
2 
3 import java.util.Arrays;
4 import java.util.HashSet;
5 import java.util.Set;
6 
7 /**
8  * An {@link IItem} used to LatencyInfo.
9  */
10 public class LatencyItem extends GenericItem {
11 
12     /** Constant for JSON output */
13     public static final String ACTION_ID = "ACTION_ID";
14     /** Constant for JSON output */
15     public static final String DELAY = "DELAY";
16     /** Constant for JSON output */
17 
18     private static final Set<String> ATTRIBUTES = new HashSet<String>(Arrays.asList(
19             ACTION_ID, DELAY));
20 
21     /**
22      * The constructor for {@link LatencyItem}.
23      */
LatencyItem()24     public LatencyItem() {
25         super(ATTRIBUTES);
26     }
27 
getActionId()28     public int getActionId() {
29         return (int) getAttribute(ACTION_ID);
30     }
31 
setActionId(int actionId)32     public void setActionId(int actionId) {
33         setAttribute(ACTION_ID, actionId);
34     }
35 
getDelay()36     public long getDelay() {
37         return (long) getAttribute(DELAY);
38     }
39 
setDelay(long delay)40     public void setDelay(long delay) {
41         setAttribute(DELAY, delay);
42     }
43 }
44