|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.navigation.charting.Grid
public class Grid
This class represents a grid (or multidimensional array) that is built from Endeca analytics data. The data is stored in a way that is convenient for building graphs, charts, or tables.
A Grid
returns values based on one or more
"axes". For example, suppose you have cross-tab data in the following form:
{ Name: Smith, Quarter: 1Q06, Sales: 3000 }
{ Name: Smith, Quarter: 2Q06, Sales: 4200 }
{ Name: Smith, Quarter: 3Q06, Sales: 4500 }
{ Name: Jones, Quarter: 1Q06, Sales: 1200 }
{ Name: Jones, Quarter: 2Q06, Sales: 1600 }
In this case, you create a Grid
with 2 axisNames ("Name" and "Quarter") and with
a valueName "Sales". The items in each axis (e.g., "Smith" and "3Q06") are called Labels,
and are typically used as labels for the axes of a graph or table.
These Labels are also used to look up each value to display using
the getValue
method. In the example above, using
getValue
for the Labels "Smith" and "3Q06" would return "4500".
Constructor Summary | |
---|---|
Grid(Iterator analytics,
String valueName,
List axisNames)
Constructs a Grid from the specified Endeca analytics data. |
|
Grid(Iterator analytics,
String valueName,
String axis)
Convenience constructor for a one-axis Grid - same as passing in a List containing the strings. |
|
Grid(Iterator analytics,
String valueName,
String axisOne,
String axisTwo)
Convenience constructor for a two-axis Grid - same as passing in a List containing the two strings. |
Method Summary | |
---|---|
List |
getLabels(int axis)
Returns the List of Labels for the specified axis. |
int |
getNumAxes()
Returns the number of "axes" (that is, the number of labels) in the grid. |
Cell |
getValue(Label label)
Convenience method - same as passing in a List containing the Label. |
Cell |
getValue(Label labelOne,
Label labelTwo)
Convenience method - same as passing in a List containing the two Labels. |
Cell |
getValue(List labels)
Returns the value at the location indicated by the labels. |
void |
sortLabels(int axis,
Comparator comparator)
Causes the labels in the specified axis to be sorted by the specified comparator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Grid(Iterator analytics, String valueName, String axis)
public Grid(Iterator analytics, String valueName, String axisOne, String axisTwo)
public Grid(Iterator analytics, String valueName, List axisNames)
analytics
- The analytics results to use.valueName
- The name of the property or dimension that holds the value to chart.axisNames
- The names of the properties or dimensions that hold the labels of
each "axis" of the grid.Method Detail |
---|
public void sortLabels(int axis, Comparator comparator)
public int getNumAxes()
public List getLabels(int axis)
public Cell getValue(Label label)
public Cell getValue(Label labelOne, Label labelTwo)
public Cell getValue(List labels)
labels
- A List of Label objects.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |