uk.ac.starlink.ttools.jel
Class FixedConstant

java.lang.Object
  extended by uk.ac.starlink.ttools.jel.FixedConstant
All Implemented Interfaces:
Constant

public class FixedConstant
extends Object
implements Constant

Constant implementation which always has the same value.

Since:
10 Dec 2007
Author:
Mark Taylor

Constructor Summary
FixedConstant(Object value)
          Constructs a constant with a given value.
FixedConstant(Object value, Class clazz)
          Constructs a constant with a given value and class.
 
Method Summary
 Class getContentClass()
          Returns a class of which this object's value will be an instance.
 Object getValue()
          Returns this object's value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedConstant

public FixedConstant(Object value,
                     Class clazz)
Constructs a constant with a given value and class.

Parameters:
clazz - content class
value - value

FixedConstant

public FixedConstant(Object value)
Constructs a constant with a given value. The class is the class of value.

Parameters:
value - value
Method Detail

getContentClass

public Class getContentClass()
Description copied from interface: Constant
Returns a class of which this object's value will be an instance.

Specified by:
getContentClass in interface Constant
Returns:
content class

getValue

public Object getValue()
Description copied from interface: Constant
Returns this object's value. Not necessarily always the same. Must be an instance of Constant.getContentClass() (or null).

Specified by:
getValue in interface Constant
Returns:
value


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.