org.outerj.xreporter.datatype.operator
Class Like

java.lang.Object
  extended byorg.outerj.xreporter.datatype.operator.Like
All Implemented Interfaces:
Operator

public class Like
extends java.lang.Object
implements Operator

LIKE SQL operator.


Field Summary
protected static Like instance
           
 
Constructor Summary
Like()
           
 
Method Summary
 void generateNaturalDescription(java.lang.StringBuffer description, java.lang.String title, java.lang.String[] values, ResourceHandle resourceHandle)
          Generates a human readable representation of this operator applied to some values.
 void generateSql(java.lang.StringBuffer statement, java.lang.String fieldName, int argumentCount)
          Generates a piece of SQL for this operator.
 int getArgumentCount()
          Get the number of arguments that this operator can take.
 java.lang.String getDescription(ResourceHandle resourceHandle)
          Something that can be shown to an end-user to identify this operator.
 java.lang.String getId()
          An ID for this operator.
static Operator getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static Like instance
Constructor Detail

Like

public Like()
Method Detail

getId

public java.lang.String getId()
Description copied from interface: Operator
An ID for this operator. This should be a simple, short, spaceless string.

Specified by:
getId in interface Operator

getDescription

public java.lang.String getDescription(ResourceHandle resourceHandle)
Description copied from interface: Operator
Something that can be shown to an end-user to identify this operator.

Specified by:
getDescription in interface Operator

getInstance

public static Operator getInstance()

getArgumentCount

public int getArgumentCount()
Description copied from interface: Operator
Get the number of arguments that this operator can take. For a variable (unlimitted) number of arguments this returns -1.

Specified by:
getArgumentCount in interface Operator

generateSql

public void generateSql(java.lang.StringBuffer statement,
                        java.lang.String fieldName,
                        int argumentCount)
Description copied from interface: Operator
Generates a piece of SQL for this operator. This should be in PreparedStatement-style. Values must hence by represented by question marks.

Specified by:
generateSql in interface Operator
Parameters:
statement - A StringBuffer to which the generated SQL should be appended.

generateNaturalDescription

public void generateNaturalDescription(java.lang.StringBuffer description,
                                       java.lang.String title,
                                       java.lang.String[] values,
                                       ResourceHandle resourceHandle)
Description copied from interface: Operator
Generates a human readable representation of this operator applied to some values.

Specified by:
generateNaturalDescription in interface Operator
Parameters:
description - stringbuffer to which the description will be appended
title - can be null
values - for operators with a fixed number of arguments, this array should have the same size