Home | History | Annotate | Download | only in utils
      1 /*
      2  * Copyright (C) 2008 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.layoutlib.utils;
     18 
     19 import com.android.layoutlib.api.IResourceValue;
     20 
     21 public class ResourceValue implements IResourceValue {
     22     private final String mType;
     23     private final String mName;
     24     private String mValue = null;
     25     private final boolean mIsFramwork;
     26 
     27     public ResourceValue(String type, String name, boolean isFramwork) {
     28         mType = type;
     29         mName = name;
     30         mIsFramwork = isFramwork;
     31     }
     32 
     33     public ResourceValue(String type, String name, String value, boolean isFramework) {
     34         mType = type;
     35         mName = name;
     36         mValue = value;
     37         mIsFramwork = isFramework;
     38     }
     39 
     40     public String getType() {
     41         return mType;
     42     }
     43 
     44     public final String getName() {
     45         return mName;
     46     }
     47 
     48     public final String getValue() {
     49         return mValue;
     50     }
     51 
     52     public final void setValue(String value) {
     53         mValue = value;
     54     }
     55 
     56     public void replaceWith(ResourceValue value) {
     57         mValue = value.mValue;
     58     }
     59 
     60     public boolean isFramework() {
     61         return mIsFramwork;
     62     }
     63 }
     64