org.datanucleus.jdo.query
Class StringExpressionImpl

java.lang.Object
  extended by org.datanucleus.jdo.query.ExpressionImpl<T>
      extended by org.datanucleus.jdo.query.ComparableExpressionImpl<java.lang.String>
          extended by org.datanucleus.jdo.query.StringExpressionImpl
All Implemented Interfaces:
ComparableExpression<java.lang.String>, Expression<java.lang.String>, StringExpression

public class StringExpressionImpl
extends ComparableExpressionImpl<java.lang.String>
implements StringExpression

Implementation of a StringExpression


Constructor Summary
StringExpressionImpl(java.lang.Class<java.lang.String> cls, java.lang.String name, ExpressionType type)
           
StringExpressionImpl(Expression queryExpr)
           
StringExpressionImpl(PersistableExpression parent, java.lang.String name)
           
 
Method Summary
 StringExpression add(Expression expr)
          Method to return an expression for this expression added to the passed expression (String concatenation).
 CharacterExpression charAt(int pos)
          Method to return an expression for the character at a position of this string expression.
 CharacterExpression charAt(NumericExpression pos)
          Method to return an expression for the character at a position of this string expression.
 BooleanExpression endsWith(java.lang.String str)
          Method returning an expression for whether this string expression ends with the passed string expression.
 BooleanExpression endsWith(StringExpression expr)
          Method returning an expression for whether this string expression ends with the passed string expression.
 BooleanExpression equalsIgnoreCase(java.lang.String str)
          Method returning an expression for whether this string expression is equal to (ignoring case) the passed string.
 BooleanExpression equalsIgnoreCase(StringExpression expr)
          Method returning an expression for whether this string expression is equal to (ignoring case) the passed string expression.
 NumericExpression indexOf(java.lang.String str)
          Method to return an expression for the position of the passed string in this string.
 NumericExpression indexOf(StringExpression expr)
          Method to return an expression for the position of the passed string in this string.
 NumericExpression indexOf(StringExpression expr, int pos)
          Method to return an expression for the position of the passed string in this string after a position.
 NumericExpression indexOf(StringExpression expr, NumericExpression pos)
          Method to return an expression for the position of the passed string in this string after a position.
 NumericExpression indexOf(java.lang.String str, int pos)
          Method to return an expression for the position of the passed string in this string after a position.
 NumericExpression indexOf(java.lang.String str, NumericExpression pos)
          Method to return an expression for the position of the passed string in this string after a position.
 NumericExpression length()
          Method returning a expression for the length of this string.
 BooleanExpression startsWith(java.lang.String str)
          Method returning an expression for whether this string expression starts with the passed string.
 BooleanExpression startsWith(StringExpression expr)
          Method returning an expression for whether this string expression starts with the passed string expression.
 StringExpression substring(int pos)
          Method to return an expression for the substring of this string expression.
 StringExpression substring(int startPos, int endPos)
          Method to return an expression for the substring of this string expression.
 StringExpression substring(NumericExpression pos)
          Method to return an expression for the substring of this string expression.
 StringExpression substring(NumericExpression startPos, NumericExpression endPos)
          Method to return an expression for the substring of this string expression.
 StringExpression toLowerCase()
          Method to return a StringExpression representing this string expression in lower case.
 StringExpression toUpperCase()
          Method to return a StringExpression representing this string expression in upper case.
 StringExpression trim()
          Method returning a string expression with whitespace trimmed from start and end.
 
Methods inherited from class org.datanucleus.jdo.query.ComparableExpressionImpl
asc, desc, gt, gt, gteq, gteq, lt, lt, lteq, lteq, max, min
 
Methods inherited from class org.datanucleus.jdo.query.ExpressionImpl
cast, count, countDistinct, eq, eq, getQueryExpression, instanceOf, isParameter, isVariable, ne, ne
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.datanucleus.query.typesafe.ComparableExpression
asc, desc, gt, gt, gteq, gteq, lt, lt, lteq, lteq, max, min
 
Methods inherited from interface org.datanucleus.query.typesafe.Expression
cast, count, countDistinct, eq, eq, instanceOf, ne, ne
 

Constructor Detail

StringExpressionImpl

public StringExpressionImpl(PersistableExpression parent,
                            java.lang.String name)

StringExpressionImpl

public StringExpressionImpl(Expression queryExpr)

StringExpressionImpl

public StringExpressionImpl(java.lang.Class<java.lang.String> cls,
                            java.lang.String name,
                            ExpressionType type)
Method Detail

add

public StringExpression add(Expression expr)
Method to return an expression for this expression added to the passed expression (String concatenation).

Specified by:
add in interface StringExpression
Parameters:
expr - The other expression
Returns:
The summation

charAt

public CharacterExpression charAt(int pos)
Description copied from interface: StringExpression
Method to return an expression for the character at a position of this string expression.

Specified by:
charAt in interface StringExpression
Parameters:
pos - The position
Returns:
Expression for the character

charAt

public CharacterExpression charAt(NumericExpression pos)
Description copied from interface: StringExpression
Method to return an expression for the character at a position of this string expression.

Specified by:
charAt in interface StringExpression
Parameters:
pos - The position
Returns:
Expression for the character

endsWith

public BooleanExpression endsWith(java.lang.String str)
Description copied from interface: StringExpression
Method returning an expression for whether this string expression ends with the passed string expression.

Specified by:
endsWith in interface StringExpression
Parameters:
str - The string that it ends with.
Returns:
Whether it ends with the other string

endsWith

public BooleanExpression endsWith(StringExpression expr)
Description copied from interface: StringExpression
Method returning an expression for whether this string expression ends with the passed string expression.

Specified by:
endsWith in interface StringExpression
Parameters:
expr - The expression that it ends with.
Returns:
Whether it ends with the other string

equalsIgnoreCase

public BooleanExpression equalsIgnoreCase(java.lang.String str)
Description copied from interface: StringExpression
Method returning an expression for whether this string expression is equal to (ignoring case) the passed string.

Specified by:
equalsIgnoreCase in interface StringExpression
Parameters:
str - The string
Returns:
Whether they are equal

equalsIgnoreCase

public BooleanExpression equalsIgnoreCase(StringExpression expr)
Description copied from interface: StringExpression
Method returning an expression for whether this string expression is equal to (ignoring case) the passed string expression.

Specified by:
equalsIgnoreCase in interface StringExpression
Parameters:
expr - The expression
Returns:
Whether they are equal

indexOf

public NumericExpression indexOf(java.lang.String str,
                                 int pos)
Description copied from interface: StringExpression
Method to return an expression for the position of the passed string in this string after a position.

Specified by:
indexOf in interface StringExpression
Parameters:
str - The other string
pos - Start point of the search
Returns:
Expression for the position of the passed string

indexOf

public NumericExpression indexOf(java.lang.String str,
                                 NumericExpression pos)
Description copied from interface: StringExpression
Method to return an expression for the position of the passed string in this string after a position.

Specified by:
indexOf in interface StringExpression
Parameters:
str - The other string
pos - Start point of the search
Returns:
Expression for the position of the passed string

indexOf

public NumericExpression indexOf(java.lang.String str)
Description copied from interface: StringExpression
Method to return an expression for the position of the passed string in this string.

Specified by:
indexOf in interface StringExpression
Parameters:
str - The other string
Returns:
Expression for the position of the passed string

indexOf

public NumericExpression indexOf(StringExpression expr,
                                 int pos)
Description copied from interface: StringExpression
Method to return an expression for the position of the passed string in this string after a position.

Specified by:
indexOf in interface StringExpression
Parameters:
expr - The other string
pos - Start point of the search
Returns:
Expression for the position of the passed string

indexOf

public NumericExpression indexOf(StringExpression expr,
                                 NumericExpression pos)
Description copied from interface: StringExpression
Method to return an expression for the position of the passed string in this string after a position.

Specified by:
indexOf in interface StringExpression
Parameters:
expr - The other string
pos - Start point of the search
Returns:
Expression for the position of the passed string

indexOf

public NumericExpression indexOf(StringExpression expr)
Description copied from interface: StringExpression
Method to return an expression for the position of the passed string in this string.

Specified by:
indexOf in interface StringExpression
Parameters:
expr - The other string
Returns:
Expression for the position of the passed string

length

public NumericExpression length()
Description copied from interface: StringExpression
Method returning a expression for the length of this string.

Specified by:
length in interface StringExpression
Returns:
Expression for the length

startsWith

public BooleanExpression startsWith(java.lang.String str)
Description copied from interface: StringExpression
Method returning an expression for whether this string expression starts with the passed string.

Specified by:
startsWith in interface StringExpression
Parameters:
str - The string that it starts with.
Returns:
Whether it starts with the other string

startsWith

public BooleanExpression startsWith(StringExpression expr)
Description copied from interface: StringExpression
Method returning an expression for whether this string expression starts with the passed string expression.

Specified by:
startsWith in interface StringExpression
Parameters:
expr - The expression that it starts with.
Returns:
Whether it starts with the other string

substring

public StringExpression substring(int startPos,
                                  int endPos)
Description copied from interface: StringExpression
Method to return an expression for the substring of this string expression.

Specified by:
substring in interface StringExpression
Parameters:
startPos - The position of the start point of the substring (inclusive, origin 0)
endPos - The position of the end point of the substring (exclusive, origin 0)
Returns:
Expression for the substring

substring

public StringExpression substring(int pos)
Description copied from interface: StringExpression
Method to return an expression for the substring of this string expression.

Specified by:
substring in interface StringExpression
Parameters:
pos - The position of the start point of the substring
Returns:
Expression for the substring

substring

public StringExpression substring(NumericExpression startPos,
                                  NumericExpression endPos)
Description copied from interface: StringExpression
Method to return an expression for the substring of this string expression.

Specified by:
substring in interface StringExpression
Parameters:
startPos - The position of the start point of the substring (inclusive, origin 0)
endPos - The position of the end point of the substring (exclusive, origin 0)
Returns:
Expression for the substring

substring

public StringExpression substring(NumericExpression pos)
Description copied from interface: StringExpression
Method to return an expression for the substring of this string expression.

Specified by:
substring in interface StringExpression
Parameters:
pos - The position of the start point of the substring
Returns:
Expression for the substring

toLowerCase

public StringExpression toLowerCase()
Description copied from interface: StringExpression
Method to return a StringExpression representing this string expression in lower case.

Specified by:
toLowerCase in interface StringExpression
Returns:
The lower case expression

toUpperCase

public StringExpression toUpperCase()
Description copied from interface: StringExpression
Method to return a StringExpression representing this string expression in upper case.

Specified by:
toUpperCase in interface StringExpression
Returns:
The upper case expression

trim

public StringExpression trim()
Description copied from interface: StringExpression
Method returning a string expression with whitespace trimmed from start and end.

Specified by:
trim in interface StringExpression
Returns:
String expression with whitespace trimmed


Copyright © 2011. All Rights Reserved.