|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujoframework.criterion.CriteriaTool<UJO>
public class CriteriaTool<UJO extends Ujo>
The Criteria class is a simple tool to search UJO objects in the list. This class takes full advantage of architecture UJO objects. See the next sample.
Person child = new Person("Pavel", 140.0); Person mother = new Person("Mary", 150.0); Person father = new Person("John", 160.0); child.set(MOTHER, mother); child.set(FATHER, father); List<Person> persons = Arrays.asList(child, mother, father); Criterion<Person> exp = Criterion.where(NAME, "John"); UjoComparator<Person> sort = UjoComparator.create(HIGH, NAME); List<Person> result = CriteriaTool.where().select(persons, exp, sort);
| Constructor Summary | |
|---|---|
CriteriaTool()
|
|
| Method Summary | ||
|---|---|---|
UJO |
findFirst(java.util.List<UJO> list,
Criterion<UJO> criterion)
Find the first UJO by an criterion or return NULL if any object was not found. |
|
static
|
newInstance()
Create a new instance |
|
java.util.List<UJO> |
select(java.util.List<UJO> list,
Criterion<UJO> criterion)
Create a sublist of a list by an Ujo criterion. |
|
java.util.List<UJO> |
select(java.util.List<UJO> list,
Criterion<UJO> criterion,
UjoComparator sorting)
Create a sublist of a list by an Ujo criterion. |
|
java.util.List<UJO> |
select(java.util.List<UJO> list,
UjoComparator comparator)
Create a copy of the list and sort it. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CriteriaTool()
| Method Detail |
|---|
public UJO findFirst(java.util.List<UJO> list,
Criterion<UJO> criterion)
public java.util.List<UJO> select(java.util.List<UJO> list,
UjoComparator comparator)
public java.util.List<UJO> select(java.util.List<UJO> list,
Criterion<UJO> criterion)
public java.util.List<UJO> select(java.util.List<UJO> list,
Criterion<UJO> criterion,
UjoComparator sorting)
public static <UJO extends Ujo> CriteriaTool<UJO> newInstance()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||