org.enableit.db
Class DBFilter

java.lang.Object
  |
  +--org.enableit.db.DBFilter

public class DBFilter
extends java.lang.Object

Provides an encapsulated means to extend a SQL statement's WHERE clause

Version:
v1.2
Author:
chris.pettifer@enableit.org

Field Summary
static java.lang.String about
          CVS info about this class and its current version
static int EXACT_MATCH
          A valid match type
static int GREATER_THAN_MATCH
          A valid match type
static int LESS_THAN_MATCH
          A valid match type
private  int match
          The type of match required
private  java.lang.String name
          The column to filter on
private  java.lang.String value
          The value of column to filter on
 
Constructor Summary
DBFilter()
          Default Constructor
DBFilter(java.lang.String name, java.lang.String value)
          Convenience Constructor setting name and value as object created
DBFilter(java.lang.String name, java.lang.String value, int match)
          Convenience constructor setting name, value and match as object created
 
Method Summary
 java.lang.String getMatch()
          Return a string representaion of the match
 int getMatchType()
          Returns the type of match required as an int
 java.lang.String getName()
          Returns the column to filter on
 java.lang.String getValue()
          Returns the value of column to filter on
 void setMatch(int match)
          The type of match required
 void setName(java.lang.String name)
          The column to filter on
 void setValue(java.lang.String value)
          The value of column to filter on
 java.lang.String toString()
          Returns a string representation of the filter
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

name

private java.lang.String name
The column to filter on

value

private java.lang.String value
The value of column to filter on

match

private int match
The type of match required

EXACT_MATCH

public static final int EXACT_MATCH
A valid match type

LESS_THAN_MATCH

public static final int LESS_THAN_MATCH
A valid match type

GREATER_THAN_MATCH

public static final int GREATER_THAN_MATCH
A valid match type

about

public static final java.lang.String about
CVS info about this class and its current version
Constructor Detail

DBFilter

public DBFilter()
Default Constructor

DBFilter

public DBFilter(java.lang.String name,
                java.lang.String value)
Convenience Constructor setting name and value as object created

DBFilter

public DBFilter(java.lang.String name,
                java.lang.String value,
                int match)
Convenience constructor setting name, value and match as object created
Method Detail

setName

public void setName(java.lang.String name)
The column to filter on

setValue

public void setValue(java.lang.String value)
The value of column to filter on

setMatch

public void setMatch(int match)
The type of match required

getName

public java.lang.String getName()
Returns the column to filter on

getValue

public java.lang.String getValue()
Returns the value of column to filter on

getMatchType

public int getMatchType()
Returns the type of match required as an int
Returns:
matchType one of the matches enumerated in this class as XXX_MATCH properties

getMatch

public java.lang.String getMatch()
Return a string representaion of the match

toString

public java.lang.String toString()
Returns a string representation of the filter
Overrides:
toString in class java.lang.Object


Copyright © enableIT.org 1999,2000,2001,2002 All Rights Reserved.