net.sf.saffron.sql
Class SqlLiteral

java.lang.Object
  |
  +--net.sf.saffron.sql.SqlNode
        |
        +--net.sf.saffron.sql.SqlLiteral

public class SqlLiteral
extends SqlNode

A SqlLiteral is a constant. It is, appropriately, immutable.


Nested Class Summary
 
Nested classes inherited from class net.sf.saffron.sql.SqlNode
SqlNode.DatabaseMetaDataInvocationHandler
 
Field Summary
static SqlLiteral False
          Constant for Boolean.FALSE.
static SqlLiteral Null
          Constant for the SQL NULL value.
static SqlLiteral One
          Constant for the Integer value 1.
static SqlLiteral True
          Constant for Boolean.TRUE.
 Object value
           
static SqlLiteral Zero
          Constant for the Integer value 0.
 
Constructor Summary
private SqlLiteral()
          Creates the SqlLiteral representing the NULL value.
  SqlLiteral(Object value)
          Creates a SqlLiteral.
 
Method Summary
static boolean booleanValue(SqlNode node)
           
 Object clone()
           
static SqlLiteral create(boolean b)
          Creates a boolean literal.
static SqlLiteral create(Date date)
           
static SqlLiteral create(int i)
           
static SqlLiteral create(Object o)
           
static SqlLiteral create(Time time)
           
static SqlLiteral create(Timestamp timestamp)
           
 boolean equals(Object obj)
           
private static boolean equals(Object o1, Object o2)
           
 SqlKind getKind()
          Returns the type of node this is, or SqlKind.Other if it's nothing special.
 Object getValue()
          Returns the value of this literal.
 int hashCode()
           
static int intValue(SqlNode node)
           
 void unparse(SqlWriter writer, int leftPrec, int rightPrec)
          Writes a SQL representation of this node to a writer.
 
Methods inherited from class net.sf.saffron.sql.SqlNode
cloneArray, isA, toString, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

Null

public static final SqlLiteral Null
Constant for the SQL NULL value.


True

public static final SqlLiteral True
Constant for Boolean.TRUE.


False

public static final SqlLiteral False
Constant for Boolean.FALSE.


Zero

public static final SqlLiteral Zero
Constant for the Integer value 0.


One

public static final SqlLiteral One
Constant for the Integer value 1.


value

public final Object value
Constructor Detail

SqlLiteral

public SqlLiteral(Object value)
Creates a SqlLiteral.


SqlLiteral

private SqlLiteral()
Creates the SqlLiteral representing the NULL value.

Method Detail

getKind

public SqlKind getKind()
Description copied from class: SqlNode
Returns the type of node this is, or SqlKind.Other if it's nothing special.

Overrides:
getKind in class SqlNode
Returns:
a SqlKind value, never null

getValue

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


booleanValue

public static boolean booleanValue(SqlNode node)

create

public static SqlLiteral create(boolean b)
Creates a boolean literal.


create

public static SqlLiteral create(int i)

create

public static SqlLiteral create(Date date)

create

public static SqlLiteral create(Time time)

create

public static SqlLiteral create(Timestamp timestamp)

create

public static SqlLiteral create(Object o)

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 SqlNode

unparse

public void unparse(SqlWriter writer,
                    int leftPrec,
                    int rightPrec)
Description copied from class: SqlNode
Writes a SQL representation of this node to a writer.

Specified by:
unparse in class SqlNode

equals

private static boolean equals(Object o1,
                              Object o2)

SourceForge.net_Logo