Package com.inductiveautomation.rm.base
Class RMGroup
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList
com.inductiveautomation.rm.base.RMGroup
- All Implemented Interfaces:
RMKey.Get
,RMKeyChain.Get
,Serializable
,Cloneable
,Iterable
,Collection
,List
,RandomAccess
- Direct Known Subclasses:
RMGroup.Running
This class is a smart List subclass used to hold objects from an original list broken down by grouping keys.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This RMGroup subclass/inner-class represents a subset of a group up to the given endGroup. -
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Standard clone implementation.Clone deep implementation - clones this group and any child groups.Clone deep implementation - clones this group and any child groups.boolean
Standard equals.getAllValues
(String aKey) Returns all values for a given grouping in this group hierarchy.getGroup
(int anIndex) Returns the sub-group at the given index.Returns the last sub-group.getKey()
Returns the key associated with this group.static String
Returns the key for the given List if it is an RMGroup instance.getKeyChainValue
(Object aRoot, RMKeyChain aKeyChain) Custom implementation of valueForKeyChain to handle top N groups.getKeyValue
(String aKey) Custom implementation of valueForKey to handle group heritage keys.Returns the next group which is a peer to this one.Returns the child group for the most recent page end.Returns the child group for the most recent page start.Returns the parent for this group.int
Returns the number of parents that this group has.getValue()
Returns the value associated with this group.void
Groups this group by the groupings in the given grouper.void
groupBy
(RMGrouping aGrouping) Groups this group by given grouping.void
groupBy
(RMGrouping aGrouping, List aValuesList) Groups this group by given grouping.void
groupByKey
(String aKey, List aValuesList) Groups a new group by given keys list.void
groupByLeafKey
(String aKey) Turns all list objects into leaf groups.int
index()
Returns the index of this group in its parent.boolean
isAncestor
(RMGroup aGroup) Returns whether given group is an ancestor group.boolean
isLeaf()
Returns whether this group is a leaf group.static boolean
Returns whether the given List is an RMGroup instance that also isLeaf.boolean
Returns whether this group is made up of the remainders from a TopN sort.void
setPageEndGroup
(RMGroup aGroup) Sets the child group for the most recent page end.void
setPageStartGroup
(RMGroup aGroup) Sets the child group for the most recent page start.void
Sets the parent for this group.void
setTopNOthers
(boolean aFlag) Sets whether this group is made up of the remainders from a TopN sort.void
sortBy
(RMGrouping aGrouping) Sorts by sorts in given grouping.void
Sorts the group by the sorts in the given list.subgroup
(int start, int end) Returns a subset of this group from start index, inclusive, to end index, exclusive.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
topNSortBy
(RMTopNSort aSort) Performs top N sort on group for an individual sort.toString()
Returns a string representation of this group.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, contains, ensureCapacity, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
RMGroup
public RMGroup()Creates an empty group. -
RMGroup
Creates a group with the (assumed) list of groups.
-
-
Method Details
-
getKey
Returns the key associated with this group. -
getValue
Returns the value associated with this group. -
getParent
Returns the parent for this group. -
setParent
Sets the parent for this group. -
getParentCount
public int getParentCount()Returns the number of parents that this group has. -
isAncestor
Returns whether given group is an ancestor group. -
isLeaf
public boolean isLeaf()Returns whether this group is a leaf group. -
isTopNOthers
public boolean isTopNOthers()Returns whether this group is made up of the remainders from a TopN sort. -
setTopNOthers
public void setTopNOthers(boolean aFlag) Sets whether this group is made up of the remainders from a TopN sort. -
getPageStartGroup
Returns the child group for the most recent page start. -
setPageStartGroup
Sets the child group for the most recent page start. -
getPageEndGroup
Returns the child group for the most recent page end. -
setPageEndGroup
Sets the child group for the most recent page end. -
index
public int index()Returns the index of this group in its parent. -
getGroup
Returns the sub-group at the given index. -
getGroupLast
Returns the last sub-group. -
groupBy
Groups this group by the groupings in the given grouper. -
groupBy
Groups this group by given grouping. -
groupBy
Groups this group by given grouping. -
groupByKey
Groups a new group by given keys list. -
groupByLeafKey
Turns all list objects into leaf groups. -
topNSortBy
Performs top N sort on group for an individual sort. -
sortBy
Sorts by sorts in given grouping. -
sortBy
Sorts the group by the sorts in the given list. -
getAllValues
Returns all values for a given grouping in this group hierarchy. -
subgroup
Returns a subset of this group from start index, inclusive, to end index, exclusive. -
subgroup
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. -
getKey
Returns the key for the given List if it is an RMGroup instance. -
isLeaf
Returns whether the given List is an RMGroup instance that also isLeaf. -
getKeyValue
Custom implementation of valueForKey to handle group heritage keys.- Specified by:
getKeyValue
in interfaceRMKey.Get
-
getKeyChainValue
Custom implementation of valueForKeyChain to handle top N groups.- Specified by:
getKeyChainValue
in interfaceRMKeyChain.Get
-
getNextPeer
Returns the next group which is a peer to this one. -
equals
Standard equals. Just check identity because leaf objects might be interconnected (and can stack overflow). -
clone
Standard clone implementation. -
cloneDeep
Clone deep implementation - clones this group and any child groups. -
cloneEmpty
Clone deep implementation - clones this group and any child groups. -
toString
Returns a string representation of this group.- Overrides:
toString
in classAbstractCollection
-