content: package com.amzi.prolog.debug.core.model;
  
  import org.eclipse.core.runtime.PlatformObject;
  import org.eclipse.debug.core.DebugException;
  import org.eclipse.debug.core.ILaunch;
  import org.eclipse.debug.core.model.IDebugElement;
  import org.eclipse.debug.core.model.IDebugTarget;
  import org.eclipse.debug.core.model.IValue;
  import org.eclipse.debug.core.model.IVariable;
  
  /*
   * Copyright (c) 2002-2005 Amzi! inc. All Rights Reserved.
   */
  
  public class PrologValue extends PlatformObject implements IDebugElement, IValue {
  	private String value;
  	private PrologDebugTarget debugTarget;
  
  	/**
  	 * Constructor for PrologValue.
  	 */
  	public PrologValue(PrologDebugTarget target, String value) {
  		super();
  		this.debugTarget = target;
  		this.value = value;
  	}
  
  	/**
  	 * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
  	 */
  	public String getReferenceTypeName() throws DebugException {
  		return null;
  	}
  
  	/**
  	 * @see org.eclipse.debug.core.model.IValue#getValueString()
  	 */
  	public String getValueString() throws DebugException {
  		return value;
  	}
  
  	/**
  	 * @see org.eclipse.debug.core.model.IValue#isAllocated()
  	 */
  	public boolean isAllocated() throws DebugException {
  		return true;
  	}
  
  	/**
  	 * @see org.eclipse.debug.core.model.IValue#getVariables()
  	 */
  	public IVariable[] getVariables() throws DebugException {
  		return new IVariable[0];
  	}
  
  	/**
  	 * @see org.eclipse.debug.core.model.IValue#hasVariables()
  	 */
  	public boolean hasVariables() throws DebugException {
  		return false;
  	}
  
  	/**
  	 * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
  	 */
  	public String getModelIdentifier() {
  		return debugTarget.getModelIdentifier();
  	}
  
  	/**
  	 * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
  	 */
  	public IDebugTarget getDebugTarget() {
  		return debugTarget;
  	}
  
  	/**
  	 * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
  	 */
  	public ILaunch getLaunch() {
  		return debugTarget.getLaunch();
  	}
  
  	/**
  	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
  	 */
  	public <T> T getAdapter(Class<T> adapter) {
  //		if (adapter == IValue.class) {
  //			return this;
  //		}
  //		return debugTarget.getAdapter(adapter);
  		if (adapter == IDebugElement.class) {
  			return adapter.cast(this);
  		}
  		return super.getAdapter(adapter);
  	}
  
  }
  