JET

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

java.lang.Object
  extended by edu.utep.cs.jet.rat.val.CompositeValue
All Implemented Interfaces:
Denotable
Direct Known Subclasses:
ArrayValue, ConstructorCall, MethodCall

public abstract class CompositeValue
extends Object
implements Denotable

A class to represent an array value. An array value is represented as a tuple of a type, (Class) and the elements (an array of Denotables). An element may be another array value. If the type is null, the array is assumed to be an element of another array.

Version:
$Revision: 1.9 $
Author:
Yoonsik Cheon

Nested Class Summary
protected static class CompositeValue.SimpleVarGenerator
           
 
Constructor Summary
CompositeValue(Class<?> type, Denotable[] elems)
          Creates a composite value of the given type and elements.
 
Method Summary
abstract  String[] code(VarGenerator varGen)
          Returns Java code that generates this value.
 Denotable[] elems()
          Returns the component values.
protected  boolean hasEquals()
          Returns true if the type of the represented value has its own equals method defined.
 boolean isEquivalentTo(Denotable other)
          Returns true if the represented value is equivalent to the argument's represented value.
 boolean isNull()
          Returns true if this value represents null.
 Class<?> type()
          Returns the type of this composite value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.utep.cs.jet.rat.Denotable
code, toString, value
 

Constructor Detail

CompositeValue

public CompositeValue(Class<?> type,
                      Denotable[] elems)
Creates a composite value of the given type and elements.

Method Detail

type

public Class<?> type()
Returns the type of this composite 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

isEquivalentTo

public boolean isEquivalentTo(Denotable other)
Returns true if the represented value is equivalent to the argument's represented value.

Specified by:
isEquivalentTo in interface Denotable

hasEquals

protected boolean hasEquals()
Returns true if the type of the represented value has its own equals method defined.


elems

public Denotable[] elems()
Returns the component values.


code

public abstract String[] code(VarGenerator varGen)
Returns Java code that generates this value.


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.