- All Superinterfaces:
- java.util.Collection, org.jdaemon.era.Cube, java.lang.Iterable, JavaCube
- All Known Implementing Classes:
- AbstractIndexedJavaCube
- public interface IndexedJavaCube
- extends JavaCube
A JavaCube which is indexed on a single attribute
An IndexedJavaCube maintains data objects arranged into groups according to the value of a
particular 'key' attribute. Each group contains objects which have the same value
of the key attribute. These groups can be rapidly accessed with the 'getGroup' method,
and a 'groups' iterator is provided which allows each group to be visited in turn.
|
Method Summary |
org.jdaemon.era.Cube |
constrainByKey(java.lang.Object key)
Get a Cube containing only objects with a given key value
If 'subcube' is a value returned by this function, 'name' is a value returned by
getKeyAttributeName(), and obj is a value returned by subcube.iterator(),
we require:
subcube.getAttribute(name, obj) == key
for all obj |
java.lang.String |
getKeyAttributeName()
Get the name of the attribute which is used as the key |
java.util.SortedSet |
getKeySet()
Get the set of different values of the key attribute. |
java.util.Iterator |
groupByKey()
Get an iterator over a set of cubes containing elements with the same key value
This method should be equivalent to cube.groupBy(cube.getAttributeName()). |
| Methods inherited from interface org.jdaemon.era.Cube |
addAll, constrain, constrain, getAttribute, getAttributeSet, getDescriptor, getMax, getMin, getSum, groupBy, iterator, union |
| Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray |
getKeyAttributeName
public java.lang.String getKeyAttributeName()
- Get the name of the attribute which is used as the key
constrainByKey
public org.jdaemon.era.Cube constrainByKey(java.lang.Object key)
- Get a Cube containing only objects with a given key value
If 'subcube' is a value returned by this function, 'name' is a value returned by
getKeyAttributeName(), and obj is a value returned by subcube.iterator(),
we require:
subcube.getAttribute(name, obj) == key
for all obj
groupByKey
public java.util.Iterator groupByKey()
- Get an iterator over a set of cubes containing elements with the same key value
This method should be equivalent to cube.groupBy(cube.getAttributeName()).
getKeySet
public java.util.SortedSet getKeySet()
- Get the set of different values of the key attribute.
This method should be equivalent to cube.getAttributeSet(cube.getAttributeName())