public class RMGroup extends java.util.ArrayList implements RMKey.ValueForKey, RMKey.ValueForKeyChain
Modifier and Type | Class and Description |
---|---|
static class |
RMGroup.Running
This RMGroup subclass/inner-class represents a subset of a group up to the given endGroup.
|
Constructor and Description |
---|
RMGroup()
Creates an empty group.
|
RMGroup(java.util.List aList)
Creates a group with the (assumed) list of groups.
|
RMGroup(java.util.List aList,
RMGrouper aGrouper)
Creates a group by grouping the objects in the given list by the groupings in the given grouper.
|
RMGroup(java.lang.Object obj,
RMGroup aGroup)
Creates a leaf group for the given object and parent group.
|
Modifier and Type | Method and Description |
---|---|
void |
addStubGroupsAtLevel(int aLevel,
java.util.List[] allValues,
boolean includeNulls)
Make sure allValues are represented at aLevel (add empty value-group for missing values)
Currently assumes that children are sorted by allValues.
|
boolean |
childrenAreLeafs()
Returns whether children of this group are leafs.
|
boolean |
equals(java.lang.Object o) |
java.util.List[] |
getAllDistinctValuesAtLevel(int aLevel,
java.lang.Object nullValue,
java.util.List[] allValues)
Returns two lists - (1) all distinct values at a given group level and (2) a sample group for each value.
|
RMGroup |
getGroup(int anIndex)
Returns the sub-group at the given index.
|
RMGroup |
getGroupLast()
Returns the last sub-group.
|
java.lang.String |
getKey()
Returns the key associated with this group.
|
static java.lang.String |
getKey(java.util.List l)
Returns the key for the given List if it is an RMGroup instance.
|
RMGroup |
getMaster()
Returns the master for this group (generally a leaf from another RMGroup hierarchy).
|
RMGroup |
getNextPeer()
Returns the next group which is a peer to this one.
|
RMGroup |
getParent()
Returns the parent for this group.
|
int |
getParentCount()
Returns the number of parents that this group has.
|
RMGroup |
getParentOrMaster()
Returns the parent or master for this group.
|
RMTable |
getTable()
Returns the table associated with this group.
|
int |
index()
Returns the index of this group in its parent.
|
boolean |
isLeaf()
Returns whether this group is a leaf group.
|
static boolean |
isLeaf(java.util.List l)
Returns whether the given List is an RMGroup instance that also isLeaf.
|
boolean |
isTopNOthers()
Returns whether this group is made up of the remainders from a TopN sort.
|
void |
setMaster(RMGroup aGroup)
Sets the master for this group.
|
void |
setTable(RMTable aTable)
Sets the table associated with this group.
|
void |
setTopNOthers(boolean aFlag)
Sets whether this group is made up of the remainders from a TopN sort.
|
void |
sortBySortsInGrouper(RMGrouper aGrouper)
Sorts the group byte the sorts listed in the grouper (recursively).
|
RMGroup |
subgroup(int start,
int end)
Returns a subset of this group from start index, inclusive, to end index, exclusive.
|
RMGroup |
subgroup(RMGroup startGroup,
RMGroup endGroup)
Returns a subset of this group, running deep, which only includes the subset of the tree starting at startGroup
and ending at (but not including) endGroup.
|
void |
topN(int count,
RMSort aSort,
boolean includeOthers)
Performs top N sort on group for an individual sort.
|
void |
topNWithGrouper(RMGrouper aGrouper)
Performs Top N sort on group for a grouper.
|
void |
turnObjectsIntoLeafs()
Turns all list objects into leaf groups.
|
java.lang.Object |
valueForKey(java.lang.String aKey)
Custom implementation of valueForKey to handle group heritage keys.
|
java.lang.Object |
valueForKeyChain(java.lang.Object aKeyChain)
Custom implementation of valueForKeyChain to handle top N groups.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public RMGroup()
public RMGroup(java.util.List aList)
public RMGroup(java.lang.Object obj, RMGroup aGroup)
public RMGroup(java.util.List aList, RMGrouper aGrouper)
public java.lang.String getKey()
public static java.lang.String getKey(java.util.List l)
public RMGroup getParent()
public int getParentCount()
public RMGroup getMaster()
public void setMaster(RMGroup aGroup)
public RMGroup getParentOrMaster()
public RMTable getTable()
public void setTable(RMTable aTable)
public boolean isLeaf()
public static boolean isLeaf(java.util.List l)
public boolean isTopNOthers()
public void setTopNOthers(boolean aFlag)
public int index()
public RMGroup getGroup(int anIndex)
public RMGroup getGroupLast()
public RMGroup getNextPeer()
public boolean childrenAreLeafs()
public RMGroup subgroup(int start, int end)
public RMGroup subgroup(RMGroup startGroup, RMGroup endGroup)
public void topNWithGrouper(RMGrouper aGrouper)
public void topN(int count, RMSort aSort, boolean includeOthers)
public void sortBySortsInGrouper(RMGrouper aGrouper)
public void addStubGroupsAtLevel(int aLevel, java.util.List[] allValues, boolean includeNulls)
public java.util.List[] getAllDistinctValuesAtLevel(int aLevel, java.lang.Object nullValue, java.util.List[] allValues)
public void turnObjectsIntoLeafs()
public java.lang.Object valueForKey(java.lang.String aKey)
valueForKey
in interface RMKey.ValueForKey
public java.lang.Object valueForKeyChain(java.lang.Object aKeyChain)
valueForKeyChain
in interface RMKey.ValueForKeyChain
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection
equals
in interface java.util.List
equals
in class java.util.AbstractList