org.objectweb.telosys.dal.tools
Class Joker

java.lang.Object
  extended byorg.objectweb.telosys.dal.tools.Joker

public class Joker
extends java.lang.Object


Field Summary
static int REPLACE_ALL
           
static int REPLACE_FIRST
           
static int REPLACE_LAST
           
 
Constructor Summary
Joker(char userJoker)
          Defines a user joker character ( it will be replaced by '%' ) The replace mode is REPLACE_ALL by default
Joker(char userJoker, char sqlJoker)
          Defines a user joker character with a specific replacement character The replace mode is REPLACE_ALL by default
Joker(char userJoker, char sqlJoker, int replaceMode)
          Defines a user joker character with a specific replacement character and a specific replace mode
Joker(char userJoker, int replaceMode)
          Defines a user joker character ( it will be replaced by '%' ) with a specific replace mode
 
Method Summary
 java.lang.String replace(java.lang.String s)
          Replaces the user joker(s) by the standard or specific joker character It replaces all, first or last user joker according with the "replace mode"
 java.lang.String replaceAll(java.lang.String s)
          Replaces all the user jokers by the standard or specific joker character
 java.lang.String replaceFirst(java.lang.String s)
          Replaces the first character of the given string if it's a user joker
 java.lang.String replaceLast(java.lang.String s)
          Replaces the last character of the given string if it's a user joker
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REPLACE_ALL

public static final int REPLACE_ALL
See Also:
Constant Field Values

REPLACE_FIRST

public static final int REPLACE_FIRST
See Also:
Constant Field Values

REPLACE_LAST

public static final int REPLACE_LAST
See Also:
Constant Field Values
Constructor Detail

Joker

public Joker(char userJoker)
Defines a user joker character ( it will be replaced by '%' ) The replace mode is REPLACE_ALL by default

Parameters:
userJoker -

Joker

public Joker(char userJoker,
             int replaceMode)
Defines a user joker character ( it will be replaced by '%' ) with a specific replace mode

Parameters:
userJoker -
replaceMode - : REPLACE_ALL or REPLACE_FIRST or REPLACE_LAST

Joker

public Joker(char userJoker,
             char sqlJoker)
Defines a user joker character with a specific replacement character The replace mode is REPLACE_ALL by default

Parameters:
userJoker -
sqlJoker -

Joker

public Joker(char userJoker,
             char sqlJoker,
             int replaceMode)
Defines a user joker character with a specific replacement character and a specific replace mode

Parameters:
userJoker -
sqlJoker -
replaceMode - : REPLACE_ALL or REPLACE_FIRST or REPLACE_LAST
Method Detail

replace

public java.lang.String replace(java.lang.String s)
Replaces the user joker(s) by the standard or specific joker character It replaces all, first or last user joker according with the "replace mode"

Parameters:
s -
Returns:

replaceAll

public java.lang.String replaceAll(java.lang.String s)
Replaces all the user jokers by the standard or specific joker character

Parameters:
s -
Returns:

replaceLast

public java.lang.String replaceLast(java.lang.String s)
Replaces the last character of the given string if it's a user joker

Parameters:
s -
Returns:

replaceFirst

public java.lang.String replaceFirst(java.lang.String s)
Replaces the first character of the given string if it's a user joker

Parameters:
s -
Returns:

toString

public java.lang.String toString()