org.eclipse.emf.query.conditions.strings
Class StringLength
java.lang.Object
org.eclipse.emf.query.conditions.Condition
org.eclipse.emf.query.conditions.DataTypeCondition<String>
org.eclipse.emf.query.conditions.strings.StringCondition
org.eclipse.emf.query.conditions.strings.StringLength
public class StringLength
- extends StringCondition
A Condition object that tests for
String length values. The arguments being evaluated
are adapted to a String first using a StringAdapter
and then the length of the
string will be compared with the initialization numeric values to see if it is
equal/in-range.
Constructor Summary |
StringLength(int length)
A simple constructor that takes one int argument to test strings' length
against It evaluates to true when the evaluated
String length equals the length
initialization argument. |
StringLength(int length,
IDataTypeAdapter<String> adapter)
A constructor that takes one int argument to test strings' length against
and a StringAdapter . |
StringLength(int lowerBound,
int upperBound)
A constructor that takes two int arguments representing a range to test
strings' length against. |
StringLength(int lowerBound,
int upperBound,
IDataTypeAdapter<String> adapter)
A constructor that takes two int arguments representing a range to test
strings' length against. |
StringLength(int lowerBound,
int upperBound,
StringAdapter adapter)
A constructor that takes two int arguments representing a range to test
strings' length against. |
StringLength(int length,
StringAdapter adapter)
A constructor that takes one int argument to test strings' length against
and a StringAdapter . |
Method Summary |
boolean |
isSatisfied(String str)
An abstract method that answers whether the argument string satisfies
this StringCondition |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringLength
public StringLength(int length)
- A simple constructor that takes one int argument to test strings' length
against It evaluates to
true
when the evaluated
String length equals the length
initialization argument. It defaults to using the StringAdapter.DEFAULT
for adapting the evaluated object to string before getting their length.
- Parameters:
length
- The int value that the evaluated string length must match
StringLength
public StringLength(int length,
StringAdapter adapter)
- A constructor that takes one int argument to test strings' length against
and a
StringAdapter
. It evaluates to true
when the evaluated String length equals the length
initialization argument. It uses the argument StringAdapter
for adapting the evaluated object to string before getting their length.
- Parameters:
length
- The int value that the evaluated string length must matchadapter
- The StringAdapter
to use to get a String out of evaluated Objects
StringLength
public StringLength(int length,
IDataTypeAdapter<String> adapter)
- A constructor that takes one int argument to test strings' length against
and a
StringAdapter
. It evaluates to true
when the evaluated String length equals the length
initialization argument. It uses the argument StringAdapter
for adapting the evaluated object to string before getting their length.
- Parameters:
length
- The int value that the evaluated string length must matchadapter
- a generic string adapter to use to get a String out of evaluated Objects- Since:
- 1.2
StringLength
public StringLength(int lowerBound,
int upperBound)
- A constructor that takes two int arguments representing a range to test
strings' length against. It evaluates to
true
when the
evaluated String length is equal to any
these two int values passed or fall in between.
It defaults to using the StringAdapter.DEFAULT
for adapting the evaluated object to string before getting their length.
- Parameters:
lowerBound
- the int value representing the lower-bound in range testingupperBound
- the int value representing the upper-bound in range testing
StringLength
public StringLength(int lowerBound,
int upperBound,
StringAdapter adapter)
- A constructor that takes two int arguments representing a range to test
strings' length against. It evaluates to
true
when the
evaluated String length is equal to any
these two int values passed or fall in between. It uses the argument StringAdapter
for adapting the evaluated object to string before getting their length.
- Parameters:
lowerBound
- the int value representing the lower-bound in range testingupperBound
- the int value representing the upper-bound in range testingadapter
- The StringAdapter
to use to get a String out of evaluated Objects
StringLength
public StringLength(int lowerBound,
int upperBound,
IDataTypeAdapter<String> adapter)
- A constructor that takes two int arguments representing a range to test
strings' length against. It evaluates to
true
when the
evaluated String length is equal to any
these two int values passed or fall in between. It uses the argument StringAdapter
for adapting the evaluated object to string before getting their length.
- Parameters:
lowerBound
- the int value representing the lower-bound in range testingupperBound
- the int value representing the upper-bound in range testingadapter
- a generic string adapter to use to get a String out of evaluated Objects
isSatisfied
public boolean isSatisfied(String str)
- Description copied from class:
StringCondition
- An abstract method that answers whether the argument string satisfies
this
StringCondition
- Specified by:
isSatisfied
in class StringCondition
- Parameters:
str
- The String to evaluate
- Returns:
- boolean
true
if the argument string satisfies this StringCondition
, false
otherwise