|
|||||||||
| Home >> All >> org >> jdaemon >> [ era overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.jdaemon.era
Class AbstractCube

java.lang.Objectjava.util.AbstractCollection
org.jdaemon.era.AbstractCube
- All Implemented Interfaces:
- java.util.Collection, Cube, java.lang.Iterable
- Direct Known Subclasses:
- FilteredCube
- public abstract class AbstractCube
- extends java.util.AbstractCollection
- implements Cube
- extends java.util.AbstractCollection
Provides a base implementation of many methods in Cube.
| Nested Class Summary | |
private class |
AbstractCube.Equal
Default implementation for StandardFilter with type EQUAL |
private class |
AbstractCube.Greater
Default implementation for StandardFilter with type GREATER |
private class |
AbstractCube.GreaterOrEqual
Default implementation for StandardFilter with type GREATER_OR_EQUAL |
private class |
AbstractCube.Less
Default implementation for StandardFilter with type LESS |
private class |
AbstractCube.LessOrEqual
Default implementation for StandardFilter with type LESS_OR_EQUAL |
private class |
AbstractCube.StandardFilter
Base class for standard Filter implementations |
| Field Summary | |
private static java.util.Comparator |
DEFAULT_COMPARATOR
Default comparator which assumes objects to be compared implement the Comparable interface |
| Fields inherited from interface org.jdaemon.era.Cube |
EQUAL, GREATER, GREATER_OR_EQUAL, LAST_OPERAND, LESS, LESS_OR_EQUAL |
| Constructor Summary | |
AbstractCube()
|
|
| Method Summary | |
void |
addAll(Cube cube)
Add all the data items in the given Cube OPTIONAL OPERATION Adds many objects to this cube |
Cube |
constrain(Filter filter)
Create a new cube containing some subset of the contents of this cube The constrain(filter) method provides a way to generate subsets of the data contained in the cube. |
Cube |
constrain(java.lang.String attribute,
int constraint_type,
java.lang.Object value)
Create a new cube containing some subset of the contents of this cube The constrain(attribute, operator, operand) method provides a way to generate standardised subsets of the data contained in the cube. |
abstract java.lang.Object |
getAttribute(java.lang.String attribute,
java.lang.Object object)
Get the value of an individual attribute of an object contained by this cube |
java.util.SortedSet |
getAttributeSet(java.lang.String attribute)
Return a set of all the values of a given attribute across all contained objects |
java.util.Comparator |
getComparator(java.lang.String attribute)
Get a comparator object which orders an attribute of this cube The default implementation returns a default comparator which assumes the attribute is of a type that implements Comparable. |
abstract CubeDescriptor |
getDescriptor()
Get metadata describing this cube |
java.lang.Object |
getMax(java.lang.String dimension)
Get the maximum value over all contained objects of some attribute Cube implementations will generally have their own way to specify the comparison operation used to create this minimum. |
java.lang.Object |
getMin(java.lang.String dimension)
Get the minimum value over all contained objects of some attribute Cube implementations will generally have their own way to specify the comparison operation used to create this minimum. |
double |
getSum(java.lang.String attribute)
Get the sum over all contained objects of some attribute This method is should be equivalent to summing: ((Number)getAttribute(attribute, object)).doubleValue() for all values returned by the Cube's iterator. |
java.util.Iterator |
groupBy(java.lang.String attribute)
Group data by a given attribute Returns an iterator of a collection of Cubes. |
abstract java.util.Iterator |
iterator()
Get an interator over all data items contained by this cube |
int |
size()
Get the number of data items contained by this cube |
Cube |
union(Cube other)
Create a cube containing the union of data in this cube and some other cube. |
| Methods inherited from class java.util.AbstractCollection |
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Field Detail |
DEFAULT_COMPARATOR
private static final java.util.Comparator DEFAULT_COMPARATOR
- Default comparator which assumes objects to be compared implement the Comparable interface
| Constructor Detail |
AbstractCube
public AbstractCube()
| Method Detail |
addAll
public void addAll(Cube cube)
- Add all the data items in the given Cube
OPTIONAL OPERATION
Adds many objects to this cube
constrain
public Cube constrain(Filter filter)
- Create a new cube containing some subset of the contents of this cube
The constrain(filter) method provides a way to generate subsets of the data contained in
the cube. The subset generated is the set of objects for which filter.test(object)
returns true. Users are therefore free to generate their own custom filter objects.
However, the getFilter() method returns standardised filter objects the implementation
of which can be significantly optimised by the cube implementation. The filters returned
by getFilter() should therefore be used in preference to custom generated filters wherever
possible.
getComparator
public java.util.Comparator getComparator(java.lang.String attribute)
- Get a comparator object which orders an attribute of this cube
The default implementation returns a default comparator which assumes the attribute
is of a type that implements Comparable.
getAttributeSet
public java.util.SortedSet getAttributeSet(java.lang.String attribute)
- Return a set of all the values of a given attribute across all contained objects
- Specified by:
getAttributeSetin interfaceCube
constrain
public Cube constrain(java.lang.String attribute, int constraint_type, java.lang.Object value)
- Create a new cube containing some subset of the contents of this cube
The constrain(attribute, operator, operand) method provides a way to generate standardised subsets
of the data contained in the cube. The subset is formed by comparing the named attribute in all
contained obects with the given operand. The comparison method is defined by operator, which should
be one of the symbolic constants defined above: LESS, GREATER, EQUAL, LESS_OR_EQUAL, GREATER_OR_EQUAL
getMax
public java.lang.Object getMax(java.lang.String dimension)
- Get the maximum value over all contained objects of some attribute
Cube implementations will generally have their own way to specify the
comparison operation used to create this minimum.
getMin
public java.lang.Object getMin(java.lang.String dimension)
- Get the minimum value over all contained objects of some attribute
Cube implementations will generally have their own way to specify the
comparison operation used to create this minimum.
getSum
public double getSum(java.lang.String attribute)
- Get the sum over all contained objects of some attribute
This method is should be equivalent to summing:
((Number)getAttribute(attribute, object)).doubleValue()
for all values returned by the Cube's iterator. However, certain cube implementations
may cache or otherwise optimise the getSum() operation.
groupBy
public java.util.Iterator groupBy(java.lang.String attribute)
- Group data by a given attribute
Returns an iterator of a collection of Cubes. Each cube will contain only elements
with the same value of the given attribute.
size
public int size()
- Get the number of data items contained by this cube
- Specified by:
sizein interfacejava.util.Collection
iterator
public abstract java.util.Iterator iterator()
getDescriptor
public abstract CubeDescriptor getDescriptor()
- Get metadata describing this cube
- Specified by:
getDescriptorin interfaceCube
getAttribute
public abstract java.lang.Object getAttribute(java.lang.String attribute, java.lang.Object object)
- Get the value of an individual attribute of an object contained by this cube
- Specified by:
getAttributein interfaceCube
union
public Cube union(Cube other)
- Create a cube containing the union of data in this cube and some other cube.
NOT IMPLEMENTED YET
|
|||||||||
| Home >> All >> org >> jdaemon >> [ era overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC