Home | History | Annotate | Download | only in traceview
      1 /*
      2  * Copyright (C) 2006 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.traceview;
     18 
     19 public class Selection {
     20 
     21     private Action mAction;
     22     private String mName;
     23     private Object mValue;
     24 
     25     public Selection(Action action, String name, Object value) {
     26         mAction = action;
     27         mName = name;
     28         mValue = value;
     29     }
     30 
     31     public static Selection highlight(String name, Object value) {
     32         return new Selection(Action.Highlight, name, value);
     33     }
     34 
     35     public static Selection include(String name, Object value) {
     36         return new Selection(Action.Include, name, value);
     37     }
     38 
     39     public static Selection exclude(String name, Object value) {
     40         return new Selection(Action.Exclude, name, value);
     41     }
     42 
     43     public void setName(String name) {
     44         mName = name;
     45     }
     46 
     47     public String getName() {
     48         return mName;
     49     }
     50 
     51     public void setValue(Object value) {
     52         mValue = value;
     53     }
     54 
     55     public Object getValue() {
     56         return mValue;
     57     }
     58 
     59     public void setAction(Action action) {
     60         mAction = action;
     61     }
     62 
     63     public Action getAction() {
     64         return mAction;
     65     }
     66 
     67     public static enum Action {
     68         Highlight, Include, Exclude, Aggregate
     69     };
     70 }
     71