net.sf.saffron.rex
Class RexLiteral

java.lang.Object
  |
  +--net.sf.saffron.rex.RexNode
        |
        +--net.sf.saffron.rex.RexLiteral

public class RexLiteral
extends RexNode

Constant value in a row-expression.

There are several methods for creating literals in RexBuilder: RexBuilder.makeLiteral(boolean) and so forth.

Since:
Nov 24, 2003
Version:
$Id: $
Author:
jhyde

Field Summary
private  SaffronType type
           
 Object value
           
 
Fields inherited from class net.sf.saffron.rex.RexNode
digest
 
Constructor Summary
(package private) RexLiteral(Object value, SaffronType type)
          Creates a SqlLiteral.
 
Method Summary
static boolean booleanValue(RexNode node)
           
 Object clone()
           
 boolean equals(Object obj)
           
private static boolean equals(Object o1, Object o2)
           
private static String format(Object value, SaffronType type)
           
 RexKind getKind()
          Returns the kind of node this is.
 SaffronType getType()
           
 Object getValue()
          Returns the value of this literal.
 int hashCode()
           
static int intValue(SqlNode node)
           
 void unparse(SqlWriter writer)
           
 
Methods inherited from class net.sf.saffron.rex.RexNode
isA, isAlwaysTrue, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public final Object value

type

private final SaffronType type
Constructor Detail

RexLiteral

RexLiteral(Object value,
           SaffronType type)
Creates a SqlLiteral.

Pre-condition:
value instanceof String || value instanceof BigInteger || value instanceof Boolean || value == null
Method Detail

format

private static String format(Object value,
                             SaffronType type)

getType

public SaffronType getType()
Specified by:
getType in class RexNode

getKind

public RexKind getKind()
Description copied from class: RexNode
Returns the kind of node this is.

Overrides:
getKind in class RexNode
Returns:
A RexKind value, never null

getValue

public Object getValue()
Returns the value of this literal.

Post-condition:
return instanceof String || return instanceof BigInteger || return instanceof Boolean || return == null

booleanValue

public static boolean booleanValue(RexNode node)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

intValue

public static int intValue(SqlNode node)

clone

public Object clone()
Specified by:
clone in class RexNode

unparse

public void unparse(SqlWriter writer)

equals

private static boolean equals(Object o1,
                              Object o2)

SourceForge.net_Logo