1 /* 2 * Copyright (C) 2011 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.ide.eclipse.gltrace.state; 18 19 20 /** 21 * Abstract implementation of {@link IGLProperty}. This provides the basics that can be 22 * used by leaf level properties. 23 */ 24 public abstract class GLAbstractAtomicProperty implements IGLProperty { 25 private final GLStateType mType; 26 private IGLProperty mParent; 27 28 public GLAbstractAtomicProperty(GLStateType type) { 29 mType = type; 30 } 31 32 @Override 33 public GLStateType getType() { 34 return mType; 35 } 36 37 @Override 38 public IGLProperty getParent() { 39 return mParent; 40 } 41 42 @Override 43 public void setParent(IGLProperty parent) { 44 mParent = parent; 45 } 46 47 @Override 48 public boolean isComposite() { 49 return false; 50 } 51 52 @Override 53 public IGLProperty clone() { 54 try { 55 return (IGLProperty) super.clone(); 56 } catch (CloneNotSupportedException e) { 57 return null; 58 } 59 } 60 61 @Override 62 public void prettyPrint(StatePrettyPrinter pp) { 63 pp.prettyPrint(mType, getStringValue()); 64 } 65 } 66