JET

edu.utep.cs.jet.rat.val
Class PrimitiveValue

java.lang.Object
  extended by edu.utep.cs.jet.rat.val.PrimitiveValue
All Implemented Interfaces:
Denotable
Direct Known Subclasses:
BooleanValue, ByteValue, CharValue, DoubleValue, FloatValue, IntValue, LongValue, ShortValue, StringValue

public abstract class PrimitiveValue
extends Object
implements Denotable

An abstract class to denote various primitive values.

Version:
$Revision: 1.7 $
Author:
Yoonsik Cheon

Field Summary
protected  Object value
          The value that this object represents.
 
Constructor Summary
protected PrimitiveValue(Object value)
          Creates a new value containing the given (wrapper) object, value.
 
Method Summary
 String code()
          Returns Java code which, if evaluated, produces the represented value of this object.
 boolean isEquivalentTo(Denotable another)
          Returns true if the represented value is equal (==) to the argument's represented value.
 boolean isNull()
          Returns true if this value represents null.
 String toString()
          Returns the string representation of this value.
abstract  Class<?> type()
          Returns the type of this value.
 Object value()
          Returns the contained value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected Object value
The value that this object represents.

Constructor Detail

PrimitiveValue

protected PrimitiveValue(Object value)
Creates a new value containing the given (wrapper) object, value.

Method Detail

type

public abstract Class<?> type()
Returns the type of this value.

Specified by:
type in interface Denotable

isNull

public boolean isNull()
Returns true if this value represents null. This method always returns false.

Specified by:
isNull in interface Denotable

value

public Object value()
Returns the contained value.

Specified by:
value in interface Denotable

toString

public String toString()
Returns the string representation of this value.

Specified by:
toString in interface Denotable
Overrides:
toString in class Object

code

public String code()
Returns Java code which, if evaluated, produces the represented value of this object.

Specified by:
code in interface Denotable

isEquivalentTo

public boolean isEquivalentTo(Denotable another)
Returns true if the represented value is equal (==) to the argument's represented value.

Specified by:
isEquivalentTo in interface Denotable

JET

JET is Copyright (C) 2005-2008 by The University of Texas at El Paso and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.