ElegantJCharts Java API Specification v2.0

com.elegantj.data.comp.computedfield
Class MethodsClass

java.lang.Object
  |
  +--com.elegantj.data.comp.computedfield.MethodsClass

public class MethodsClass
extends java.lang.Object

The MethodsClass is used in the expression executor. It provides the the miscellaneous functions to execute database related expression.


Constructor Summary
MethodsClass(Computable computable)
          Creates a MethodsClass with specified ComputedField
 
Method Summary
 java.lang.Number avg(java.lang.String condition)
          Calculates the average.
 int count(java.lang.String condition)
          Calculates the total number of rows.
 java.lang.Number cumulativePercent(java.lang.String condition)
          Calculates the total value of the rows up to and including the current row in the as a percentage of the total (a running percentage).
 java.lang.Number cumulativeSum(java.lang.String condition)
          Calculates the total value of the rows up to and including the current row (a running total).
 java.lang.Object first(java.lang.String condition)
          Reports the value in the first row.
 java.lang.Object ifCase(java.lang.String condition, java.lang.String trueValue, java.lang.String falseValue)
          Evaluates a condition and returns a value based on that condition.
 java.lang.Object large(java.lang.String condition, int rank)
          Finds a large value at a specified ranking (for example, third- largest, fifth-largest) and returns the value of expression based on the result.
 java.lang.Object last(java.lang.String condition)
          Gets the value in the last row.
 java.lang.Object maximum(java.lang.String condition)
          Gets the maximum value.
 java.lang.Object median(java.lang.String condition)
          Calculates the median of the values.
 java.lang.Object minimum(java.lang.String condition)
          Gets the minimum value.
 java.lang.Object mode(java.lang.String condition)
          Calculates the mode of the values.
 java.lang.Number percent(java.lang.String condition)
          Gets the percentage that the current value is of the total of the values.
 java.lang.Object small(java.lang.String condition, int rank)
          Finds a small value at a specified ranking (for example, third-smallest, fifth-smallest) and returns the value of expression based on the result.
 java.lang.Number sum(java.lang.String condition)
          Calculates the sum of the values.
 java.lang.Object whenThen(java.lang.String condition)
          Tests the values of a expression and returns values based on the results of the test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodsClass

public MethodsClass(Computable computable)
Creates a MethodsClass with specified ComputedField

Parameters:
computable - the Computable is used for computation.
Method Detail

whenThen

public java.lang.Object whenThen(java.lang.String condition)
Tests the values of a expression and returns values based on the results of the test. Case ( expression WHEN { value1 } THEN { result1 } [ WHEN { value2 } THEN { result2 } [ ... ] ] [ ELSE { resultelse } ] )

Parameters:
condition - the when-then expression
Returns:
the result object

ifCase

public java.lang.Object ifCase(java.lang.String condition,
                               java.lang.String trueValue,
                               java.lang.String falseValue)
Evaluates a condition and returns a value based on that condition.

Parameters:
condition - the condition to be checked
trueValue - the true value
falseValue - the false value
Returns:
trueValue is condition satisfied, false otherwise

avg

public java.lang.Number avg(java.lang.String condition)
Calculates the average.

Parameters:
condition - the expression
Returns:
the average value

count

public int count(java.lang.String condition)
Calculates the total number of rows.

Returns:
the total number of rows

cumulativePercent

public java.lang.Number cumulativePercent(java.lang.String condition)
Calculates the total value of the rows up to and including the current row in the as a percentage of the total (a running percentage).

Returns:
the percentage value

cumulativeSum

public java.lang.Number cumulativeSum(java.lang.String condition)
Calculates the total value of the rows up to and including the current row (a running total).

Returns:
the sum of the values upto current row

first

public java.lang.Object first(java.lang.String condition)
Reports the value in the first row.

Returns:
the first value

large

public java.lang.Object large(java.lang.String condition,
                              int rank)
Finds a large value at a specified ranking (for example, third- largest, fifth-largest) and returns the value of expression based on the result.

Parameters:
rank - the largest value's rank
Returns:
the large value

last

public java.lang.Object last(java.lang.String condition)
Gets the value in the last row.

Returns:
the last value

maximum

public java.lang.Object maximum(java.lang.String condition)
Gets the maximum value.

Returns:
the maximum value

median

public java.lang.Object median(java.lang.String condition)
Calculates the median of the values. The median is the middle value in the set of values, for which there is an equal number of values greater and smaller than it.

Returns:
the medium value

minimum

public java.lang.Object minimum(java.lang.String condition)
Gets the minimum value.

Returns:
the minimum value

mode

public java.lang.Object mode(java.lang.String condition)
Calculates the mode of the values. The mode is the most frequently occurring value.

Returns:
the mode value

percent

public java.lang.Number percent(java.lang.String condition)
Gets the percentage that the current value is of the total of the values.

Returns:
the percentage value

small

public java.lang.Object small(java.lang.String condition,
                              int rank)
Finds a small value at a specified ranking (for example, third-smallest, fifth-smallest) and returns the value of expression based on the result.

Parameters:
rank - the smallest value's rank
Returns:
the smallest value

sum

public java.lang.Number sum(java.lang.String condition)
Calculates the sum of the values.

Returns:
the sum of the values

ElegantJCharts Java API Specification v2.0

For any feedback, suggestion, or query, please revert back to support@elegantcharts.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjcharts.com
All Rights Reserved.