Package com.reportmill.base
Class RMGrouper
- java.lang.Object
-
- com.reportmill.base.RMObject
-
- com.reportmill.base.RMGrouper
-
- All Implemented Interfaces:
RMArchiver.Archiving,java.lang.Cloneable
public class RMGrouper extends RMObject
This class simply manages a list of groupings and has some nice convenience methods.
-
-
Constructor Summary
Constructors Constructor Description RMGrouper()Creates an empty grouper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGrouping(RMGrouping aGrouping, int anIndex)Adds a given grouping to grouper's list of groupings.RMGroupingaddGroupingForKey(java.lang.String aKey)Adds a new grouping with the given key.RMGroupingaddGroupingForKey(java.lang.String aKey, int anIndex)Adds a new grouping with the given key at the given index.voidaddGroupings(java.util.List aList)Adds a given list of groupings to grouper's list of groupings.java.lang.Objectclone()Standard clone implementation.voidcopy(java.lang.Object anObj)Copies attributes of given object.booleanequals(java.lang.Object anObj)Standard equals implementation.java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.RMGroupinggetGrouping(int anIndex)Returns the grouping at the given index.RMGroupinggetGrouping(java.lang.String aKey)Returns the grouping with the given key.intgetGroupingCount()Returns the number of groupings in this grouper.java.lang.StringgetGroupingKey(int anIndex)Return the key for the grouping at the given index.java.util.ListgetGroupingKeys()Returns a list of keys for the current groupings.RMGroupinggetGroupingLast()Returns the last grouping.RMGroupgroupObjects(java.util.List aList)Separates given objects into RMGroups defined by groupings.intindexOf(java.lang.String aKey)Returns the index for the grouping with the given key.java.lang.ObjectinitWithArchiver(RMArchiver anArchiver)Legacy unarchival.voidmoveGrouping(int fromIndex, int toIndex)Moves a grouping from given fromIndex to given toIndex.voidremoveGrouping(int anIndex)Removes the grouping at the given index.voidremoveGrouping(RMGrouping aGrouping)Removes the given grouping.voidremoveGroupingForKey(java.lang.String aKey)Removes the grouping with the given key.intsize()Returns the number of groupings in this grouper.RXElementtoXML(RXArchiver anArchiver)XML archival.-
Methods inherited from class com.reportmill.base.RMObject
didChange, didUndo, getAnimAttribute, getClassNameShort, undoClone, undoCopy, undoEquals
-
-
-
-
Method Detail
-
getGroupingCount
public int getGroupingCount()
Returns the number of groupings in this grouper.
-
size
public int size()
Returns the number of groupings in this grouper.
-
getGrouping
public RMGrouping getGrouping(int anIndex)
Returns the grouping at the given index.
-
getGrouping
public RMGrouping getGrouping(java.lang.String aKey)
Returns the grouping with the given key.
-
getGroupingLast
public RMGrouping getGroupingLast()
Returns the last grouping.
-
getGroupingKey
public java.lang.String getGroupingKey(int anIndex)
Return the key for the grouping at the given index.
-
indexOf
public int indexOf(java.lang.String aKey)
Returns the index for the grouping with the given key.
-
addGrouping
public void addGrouping(RMGrouping aGrouping, int anIndex)
Adds a given grouping to grouper's list of groupings.
-
addGroupings
public void addGroupings(java.util.List aList)
Adds a given list of groupings to grouper's list of groupings.
-
addGroupingForKey
public RMGrouping addGroupingForKey(java.lang.String aKey)
Adds a new grouping with the given key.
-
addGroupingForKey
public RMGrouping addGroupingForKey(java.lang.String aKey, int anIndex)
Adds a new grouping with the given key at the given index.
-
removeGrouping
public void removeGrouping(int anIndex)
Removes the grouping at the given index.
-
removeGrouping
public void removeGrouping(RMGrouping aGrouping)
Removes the given grouping.
-
removeGroupingForKey
public void removeGroupingForKey(java.lang.String aKey)
Removes the grouping with the given key.
-
moveGrouping
public void moveGrouping(int fromIndex, int toIndex)Moves a grouping from given fromIndex to given toIndex.
-
getGroupingKeys
public java.util.List getGroupingKeys()
Returns a list of keys for the current groupings.
-
groupObjects
public RMGroup groupObjects(java.util.List aList)
Separates given objects into RMGroups defined by groupings.
-
clone
public java.lang.Object clone()
Standard clone implementation.
-
copy
public void copy(java.lang.Object anObj)
Copies attributes of given object.
-
equals
public boolean equals(java.lang.Object anObj)
Standard equals implementation.- Overrides:
equalsin classjava.lang.Object
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.
-
initWithArchiver
public java.lang.Object initWithArchiver(RMArchiver anArchiver)
Legacy unarchival.- Specified by:
initWithArchiverin interfaceRMArchiver.Archiving- Overrides:
initWithArchiverin classRMObject
-
-