de.smartics.testdoc.report.index
Class StaticSection<T extends Serializable>

Package class diagram package StaticSection
java.lang.Object
  extended by de.smartics.testdoc.report.index.StaticSection<T>
Type Parameters:
T - the type of the items added to this section.
All Implemented Interfaces:
Section<T>, Serializable

@NotThreadSafe
public class StaticSection<T extends Serializable>
     
     
extends Object
implements Serializable, Section<T>

The implementation provides a static view on sections. The sections, once added, cannot be modified afterwards.

Author:
Robert Reiner
See Also:
Serialized Form

Constructor Summary
StaticSection(String name)
          Convenience constructor with an empty set of properties.
StaticSection(String name, Map<String,Serializable> properties)
          Default constructor.
 
Method Summary
 void addItem(T item)
          Adds the given item to this section.
 void addSubSection(Section<T> subSection)
          Adds the given sub section to this section.
 boolean containsSubSections()
          Checks if the given section contains sub sections.
 List<T> getItems()
          Returns the list of items associated with this section.
 String getName()
          Returns the name of this section.
 Map<String,? extends Serializable> getProperties()
          Returns the properties associated with this section.
 List<Section<T>> getSubSections()
          Returns the list of sub sections to this section.
 boolean isEmpty()
          Checks if this section or any sub sections contains at least one item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticSection

public StaticSection(String name)
Convenience constructor with an empty set of properties.

Parameters:
name - the name of this section.
Throws:
IllegalArgumentException - if name is blank.

StaticSection

public StaticSection(String name,
                     Map<String,Serializable> properties)
              throws IllegalArgumentException
Default constructor.

Parameters:
name - the name of this section.
properties - the properties associated with this section. May be null.
Throws:
IllegalArgumentException - if name is blank.
Method Detail

getName

public String getName()
Returns the name of this section.

Specified by:
getName in interface Section<T extends Serializable>
Returns:
the name of this section.
See Also:
Section.getName()

getProperties

public Map<String,? extends Serializable> getProperties()
Returns the properties associated with this section.

Specified by:
getProperties in interface Section<T extends Serializable>
Returns:
the properties associated with this section.
See Also:
Section.getProperties()

addSubSection

public void addSubSection(Section<T> subSection)
Adds the given sub section to this section.

Specified by:
addSubSection in interface Section<T extends Serializable>
Parameters:
subSection - the section to be added as sub section to this section.

getSubSections

public List<Section<T>> getSubSections()
Returns the list of sub sections to this section.

Specified by:
getSubSections in interface Section<T extends Serializable>
Returns:
the list of sub sections to this section. The returned value is never null.
See Also:
Section.getSubSections()

addItem

public void addItem(T item)
Adds the given item to this section.

Specified by:
addItem in interface Section<T extends Serializable>
Parameters:
item - the item to be added to this section.

getItems

public List<T> getItems()
Returns the list of items associated with this section.

Specified by:
getItems in interface Section<T extends Serializable>
Returns:
the list of items associated with this section. The returned value is never null.
See Also:
Section.getItems()

isEmpty

public boolean isEmpty()
Checks if this section or any sub sections contains at least one item.

Specified by:
isEmpty in interface Section<T extends Serializable>
Returns:
true if at least on item is contained, false if no item is contained.
See Also:
Section.isEmpty()

containsSubSections

public boolean containsSubSections()
Checks if the given section contains sub sections.

Specified by:
containsSubSections in interface Section<T extends Serializable>
Returns:
true if at least on sub section is contained, false otherwise.
See Also:
Section.containsSubSections()


Copyright © 2010-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.