jimm.datavision
Class SectionArea

java.lang.Object
  extended by jimm.datavision.SectionArea
All Implemented Interfaces:
Writeable

public class SectionArea
extends java.lang.Object
implements Writeable


Field Summary
(package private)  int area
          One of the REPORT_* constants.
protected static java.lang.String[] AREA_NAME_KEYS
          These are I18N lookup keys for REPORT_* constants.
static int DETAIL
           
static int GROUP_FOOTER
           
static int GROUP_HEADER
           
static int PAGE_FOOTER
           
static int PAGE_HEADER
           
static int REPORT_FOOTER
           
static int REPORT_HEADER
           
(package private)  java.util.List sections
           
 
Constructor Summary
SectionArea(int area)
          Constructor.
 
Method Summary
 void add(int index, Section s)
          Adds a section to our list and sets its name and other area-related information.
 void add(Section s)
          Adds a section to our list and sets its name and other area-related information.
 void clear()
           
 boolean contains(Section s)
          Returns true if s is one of our sections.
 Section first()
           
 Section get(int index)
           
 int getArea()
           
 java.lang.String getName()
          Returns the name of this area.
protected  void imprint(Section section)
          Modifies section so it knows that it's part of this area.
 int indexOf(Section s)
           
 Section insertAfter(Section section, Section afterThis)
          Adds a (possibly created) section after afterThis and returns the section.
 boolean isDetail()
          Returns true if this is a report detail section.
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
static java.lang.String nameFromArea(int area)
          Given the REPORT_* constant area, returns the section area name.
 void remove(Section s)
          Removes a section.
 java.util.List sections()
          Returns an unmodifiable version of our list of sections.
 int size()
           
 void withSectionsDo(SectionWalker s)
           
 void writeXML(XMLWriter out)
          Writes this object as an XML tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPORT_HEADER

public static final int REPORT_HEADER
See Also:
Constant Field Values

REPORT_FOOTER

public static final int REPORT_FOOTER
See Also:
Constant Field Values

PAGE_HEADER

public static final int PAGE_HEADER
See Also:
Constant Field Values

PAGE_FOOTER

public static final int PAGE_FOOTER
See Also:
Constant Field Values

DETAIL

public static final int DETAIL
See Also:
Constant Field Values

GROUP_HEADER

public static final int GROUP_HEADER
See Also:
Constant Field Values

GROUP_FOOTER

public static final int GROUP_FOOTER
See Also:
Constant Field Values

AREA_NAME_KEYS

protected static final java.lang.String[] AREA_NAME_KEYS
These are I18N lookup keys for REPORT_* constants. The order of these keys must match the values of those constants.


sections

java.util.List sections

area

int area
One of the REPORT_* constants.

Constructor Detail

SectionArea

public SectionArea(int area)
Constructor.

Parameters:
area - a REPORT_* constant
Method Detail

nameFromArea

public static java.lang.String nameFromArea(int area)
Given the REPORT_* constant area, returns the section area name.

Parameters:
area - a REPORT_* constant

getArea

public int getArea()

indexOf

public int indexOf(Section s)

get

public Section get(int index)

first

public Section first()

add

public void add(Section s)
Adds a section to our list and sets its name and other area-related information.

Parameters:
s - a section

add

public void add(int index,
                Section s)
Adds a section to our list and sets its name and other area-related information.

Parameters:
s - a section

insertAfter

public Section insertAfter(Section section,
                           Section afterThis)
Adds a (possibly created) section after afterThis and returns the section. If section is null, a new section will be created.

Parameters:
section - the section to insert; if null, a new section will be created
afterThis - the new section will be inserted after this one

imprint

protected void imprint(Section section)
Modifies section so it knows that it's part of this area.

Parameters:
section - a section

isDetail

public boolean isDetail()
Returns true if this is a report detail section.

Returns:
true if this is a report detail section

remove

public void remove(Section s)
Removes a section.

Parameters:
s - a report section

contains

public boolean contains(Section s)
Returns true if s is one of our sections.

Parameters:
s - a section
Returns:
true if s is one of our sections

getName

public java.lang.String getName()
Returns the name of this area.

Returns:
the name of this area

sections

public java.util.List sections()
Returns an unmodifiable version of our list of sections.

Returns:
an unmodifiable version of our list of sections.

iterator

public java.util.Iterator iterator()

size

public int size()

isEmpty

public boolean isEmpty()

clear

public void clear()

withSectionsDo

public void withSectionsDo(SectionWalker s)

writeXML

public void writeXML(XMLWriter out)
Description copied from interface: Writeable
Writes this object as an XML tag.

Specified by:
writeXML in interface Writeable
Parameters:
out - a writer that knows how to write XML