- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 38 of file Statistics.java.
◆ aggregates()
static Aggregates org.turro.indicator.Statistics.aggregates |
( |
Dao |
dao, |
|
|
String |
table, |
|
|
String |
aggregateField, |
|
|
Consumer< WhereClause > |
onFilter |
|
) |
| |
|
static |
Definition at line 119 of file Statistics.java.
120 WhereClause wc =
new WhereClause();
121 wc.addClause(
"select new org.turro.indicator.Aggregates(");
122 wc.addClause(
"count(t),");
123 wc.addClause(
"min(t." + aggregateField +
"),");
124 wc.addClause(
"max(t." + aggregateField +
"),");
125 wc.addClause(
"avg(t." + aggregateField +
")");
127 wc.addClause(
"from " + table +
" t");
128 if(onFilter !=
null) onFilter.accept(wc);
129 Aggregates
aggregates = (Aggregates) dao.getSingleResultOrNull(wc);
131 wc =
new WhereClause();
132 wc.addClause(
"select t." + aggregateField +
" from " + table +
" t");
133 if(onFilter !=
null) onFilter.accept(wc);
134 wc.addClause(
"order by t." + aggregateField +
" asc");
141 if(values !=
null && !values.isEmpty()) {
142 if(values.size() == 1) {
144 }
else if(values.size() == 2) {
void setMedian(double median)
static Aggregates aggregates(Dao dao, String table, String aggregateField, Consumer< WhereClause > onFilter)
◆ allowMatching()
Statistics org.turro.indicator.Statistics.allowMatching |
( |
boolean |
allowMatching | ) |
|
Definition at line 72 of file Statistics.java.
73 this.allowMatching = allowMatching && !Strings.isBlank(matchingInstance);
◆ allowRanking()
Statistics org.turro.indicator.Statistics.allowRanking |
( |
boolean |
allowRanking | ) |
|
Definition at line 77 of file Statistics.java.
78 this.allowRanking = allowRanking && !Strings.isBlank(rankingInstance);
◆ doMatching()
Statistics org.turro.indicator.Statistics.doMatching |
( |
boolean |
doIt | ) |
|
◆ getClause()
WhereClause org.turro.indicator.Statistics.getClause |
( |
| ) |
|
Definition at line 97 of file Statistics.java.
98 if(missingValues())
throw new NullPointerException(
"Missing values!");
99 readDaoSearchValues();
101 if(allowMatching && contact !=
null && contact.
isValid() && doMatching) {
102 Matchings.addJoin(wc, matchingInstance, entityRoot, entityId, contact, sortOrder);
103 orderBy += Matchings.getOrdering() +
", ";
107 Rankings.addJoin(wc, rankingInstance, entityRoot, entityId, sortOrder);
108 orderBy += Rankings.getOrdering() +
", ";
110 if(onCriteria !=
null) onCriteria.accept(wc);
111 wc.
addClause(
"order by " + orderBy + defaultSorting);
void addClause(String clause)
◆ load()
Definition at line 115 of file Statistics.java.
116 return new Statistics(constructor, rankingInstance, matchingInstance, wc);
◆ onCriteria()
◆ setContact()
◆ setDefaultSorting()
Statistics org.turro.indicator.Statistics.setDefaultSorting |
( |
String |
sortOrder | ) |
|
◆ setEntityFields()
Statistics org.turro.indicator.Statistics.setEntityFields |
( |
String |
root, |
|
|
String |
id |
|
) |
| |
◆ setSortOrder()
Statistics org.turro.indicator.Statistics.setSortOrder |
( |
String |
sortOrder | ) |
|
◆ useDaoSearch()
Statistics org.turro.indicator.Statistics.useDaoSearch |
( |
boolean |
doIt | ) |
|
The documentation for this class was generated from the following file: