BrightSide Workbench Full Report + Source Code
org.turro.indicator.Indicators Class Reference

Static Public Member Functions

static boolean hasDirectProcess (List< IndicatorVariable > variables)
 
static List< IndicatorVariablegetRankingVariables (String root)
 
static List< IndicatorVariablegetMatchingVariables (String root)
 
static List< IndicatorVariablegetRankingVariablesFinal (String root)
 
static List< IndicatorVariablegetMatchingVariablesFinal (String root)
 
static IndicatorVariable getVariable (String root, String name)
 
static IElephantIndicator getIndicator (String root)
 
static IElephantIndicator getIndicator (IndicatorVariable variable)
 
static double getValue (Object entity, IndicatorVariable variable)
 
static double getValue (Object entity, String relatedPath, IndicatorVariable variable)
 
static IndicatorResult readIndicator (String indicator)
 
static IndicatorResult readIndicator (String jpaClass, String indicatorClass, String entityPath, String relatedPath, String indicator)
 
static List< IndicatorVariablegetVariables (String indicatorClass)
 
static List< IElephantIndicatorgetIndicators ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 34 of file Indicators.java.

Member Function Documentation

◆ getIndicator() [1/2]

static IElephantIndicator org.turro.indicator.Indicators.getIndicator ( IndicatorVariable  variable)
static

Definition at line 78 of file Indicators.java.

78  {
79  for(IElephantIndicator iIndicator : getIndicators()) {
80  if(iIndicator.itsMine(variable)) {
81  return iIndicator;
82  }
83  }
84  return null;
85  }
static List< IElephantIndicator > getIndicators()
Here is the call graph for this function:

◆ getIndicator() [2/2]

static IElephantIndicator org.turro.indicator.Indicators.getIndicator ( String  root)
static

Definition at line 69 of file Indicators.java.

69  {
70  for(IElephantIndicator iIndicator : getIndicators()) {
71  if(iIndicator.itsMine(root)) {
72  return iIndicator;
73  }
74  }
75  return null;
76  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIndicators()

static List<IElephantIndicator> org.turro.indicator.Indicators.getIndicators ( )
static

Definition at line 138 of file Indicators.java.

138  {
139  if(_indicators == null) {
140  indicatorLock.lock();
141  try {
142  if(_indicators == null) {
143  _indicators = Instances.cached().byAnnotation(ElephantIndicator.class, IElephantIndicator.class);
144  _indicators.stream().forEach(i -> i.initIndicator());
145  _indicators.stream().forEach(i -> i.prepareIndicator());
146  }
147  } finally {
148  indicatorLock.unlock();
149  }
150  }
151  return _indicators;
152  }
Here is the caller graph for this function:

◆ getMatchingVariables()

static List<IndicatorVariable> org.turro.indicator.Indicators.getMatchingVariables ( String  root)
static

Definition at line 47 of file Indicators.java.

47  {
48  IElephantIndicator ei = getIndicator(root);
49  return ei != null ? ei.getAllMatchingVariables(root): Collections.EMPTY_LIST;
50  }
static IElephantIndicator getIndicator(String root)
Definition: Indicators.java:69
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMatchingVariablesFinal()

static List<IndicatorVariable> org.turro.indicator.Indicators.getMatchingVariablesFinal ( String  root)
static

Definition at line 58 of file Indicators.java.

58  {
59  List<IndicatorVariable> variables = getMatchingVariables(root);
60  variables.add(0, IndicatorVariable.result(root, VariableType.MATCHING_VARIABLE));
61  return variables;
62  }
static List< IndicatorVariable > getMatchingVariables(String root)
Definition: Indicators.java:47
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRankingVariables()

static List<IndicatorVariable> org.turro.indicator.Indicators.getRankingVariables ( String  root)
static

Definition at line 42 of file Indicators.java.

42  {
43  IElephantIndicator ei = getIndicator(root);
44  return ei != null ? ei.getAllRankingVariables(root): Collections.EMPTY_LIST;
45  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRankingVariablesFinal()

static List<IndicatorVariable> org.turro.indicator.Indicators.getRankingVariablesFinal ( String  root)
static

Definition at line 52 of file Indicators.java.

52  {
53  List<IndicatorVariable> variables = getRankingVariables(root);
54  variables.add(0, IndicatorVariable.result(root, VariableType.RANKING_VARIABLE));
55  return variables;
56  }
static List< IndicatorVariable > getRankingVariables(String root)
Definition: Indicators.java:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getValue() [1/2]

static double org.turro.indicator.Indicators.getValue ( Object  entity,
IndicatorVariable  variable 
)
static

Definition at line 87 of file Indicators.java.

87  {
88  IElephantIndicator ei = getIndicator(variable);
89  return ei != null ? ei.getValue(variable, entity) : 0.0;
90  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getValue() [2/2]

static double org.turro.indicator.Indicators.getValue ( Object  entity,
String  relatedPath,
IndicatorVariable  variable 
)
static

Definition at line 92 of file Indicators.java.

92  {
93  IElephantIndicator ei = getIndicator(variable);
94  return ei != null ? ei.getValue(variable, entity, relatedPath) : 0.0;
95  }
Here is the call graph for this function:

◆ getVariable()

static IndicatorVariable org.turro.indicator.Indicators.getVariable ( String  root,
String  name 
)
static

Definition at line 64 of file Indicators.java.

64  {
65  IElephantIndicator ei = getIndicator(root);
66  return ei != null ? ei.getVariable(name) : null;
67  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVariables()

static List<IndicatorVariable> org.turro.indicator.Indicators.getVariables ( String  indicatorClass)
static

Definition at line 124 of file Indicators.java.

124  {
125  for(IElephantIndicator iIndicator : getIndicators()) {
126  if(iIndicator.getClass().getSimpleName().equals(indicatorClass)) {
127  return iIndicator.getAllVariables();
128  }
129  }
130  return Collections.EMPTY_LIST;
131  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasDirectProcess()

static boolean org.turro.indicator.Indicators.hasDirectProcess ( List< IndicatorVariable variables)
static

Definition at line 38 of file Indicators.java.

38  {
39  return variables.stream().anyMatch(v -> !v.isPreprocess());
40  }
Here is the caller graph for this function:

◆ readIndicator() [1/2]

static IndicatorResult org.turro.indicator.Indicators.readIndicator ( String  indicator)
static

Definition at line 99 of file Indicators.java.

99  {
100  if(!Strings.isBlank(indicator) && indicator.contains(":")) {
101  String v[] = indicator.split("\\s*:\\s*");
102  if(!Strings.isBlank(v[0]) && !Strings.isBlank(v[1]) && !Strings.isBlank(v[2])) {
103  for(IElephantIndicator iIndicator : getIndicators()) {
104  if(iIndicator.getClass().getSimpleName().equals(v[1])) {
105  return iIndicator.readIndicator(v[0], v[2]);
106  }
107  }
108  }
109  }
110  return new IndicatorResult(0, 0);
111  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readIndicator() [2/2]

static IndicatorResult org.turro.indicator.Indicators.readIndicator ( String  jpaClass,
String  indicatorClass,
String  entityPath,
String  relatedPath,
String  indicator 
)
static

Definition at line 113 of file Indicators.java.

114  {
115  for(IElephantIndicator iIndicator : getIndicators()) {
116  if(iIndicator.getClass().getSimpleName().equals(indicatorClass)) {
117  return iIndicator.readIndicator(jpaClass,
118  Words.instance(".", entityPath, relatedPath, indicator).toString());
119  }
120  }
121  return new IndicatorResult(0, 0);
122  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: