com.jrefinery.report
Class GroupList

java.lang.Object
  |
  +--com.jrefinery.report.GroupList
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
UnmodifiableGroupList

public class GroupList
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

The group list is used to store groups in a ordered way. The less specific groups are guaranteed to be listed before any more specific subgroup.

Groups are ordered by comparing the declared fieldnames for the groups. A subgroup of an group must contain all fields from its parent plus at least one new field.

This implementation is not synchronized.

Author:
Thomas Morgner
See Also:
Serialized Form

Constructor Summary
GroupList()
          Constructs a new empty group list.
GroupList(GroupList list)
          Creates a new group list.
 
Method Summary
 void add(Group o)
          Adds a group to the list.
 void addAll(java.util.Collection c)
           
 void clear()
          Clears the list.
 java.lang.Object clone()
          Clones the list.
 Group get(int i)
          Returns the group at a position in the list.
 StyleSheetCollection getStyleSheetCollection()
           
 java.util.Iterator iterator()
          Returns an iterator for the list.
 boolean remove(Group o)
          Removes an object from the list.
 void setStyleSheetCollection(StyleSheetCollection styleSheetCollection)
           
 int size()
          Returns the number of groups in the list.
 java.lang.String toString()
          Returns a string representation of the list (useful for debugging).
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupList

public GroupList()
Constructs a new empty group list.


GroupList

public GroupList(GroupList list)
Creates a new group list.

Parameters:
list - groups to add to the list.
Method Detail

get

public Group get(int i)
Returns the group at a position in the list.

Parameters:
i - the position index (zero-based).
Returns:
the report group.

remove

public boolean remove(Group o)
Removes an object from the list.

Parameters:
o - the object.
Returns:
a boolean indicating whether or not the object was removed.

clear

public void clear()
Clears the list.


add

public void add(Group o)
Adds a group to the list.

Parameters:
o - the group object.

addAll

public void addAll(java.util.Collection c)

clone

public java.lang.Object clone()
Clones the list.

Overrides:
clone in class java.lang.Object
Returns:
a clone.

iterator

public java.util.Iterator iterator()
Returns an iterator for the list.

Returns:
An iterator for the list.

size

public int size()
Returns the number of groups in the list.

Returns:
The number of groups in the list.

toString

public java.lang.String toString()
Returns a string representation of the list (useful for debugging).

Overrides:
toString in class java.lang.Object
Returns:
A string.

getStyleSheetCollection

public StyleSheetCollection getStyleSheetCollection()

setStyleSheetCollection

public void setStyleSheetCollection(StyleSheetCollection styleSheetCollection)