org.jostraca.section
Class BasicSection

java.lang.Object
  extended byorg.jostraca.section.BasicSection
All Implemented Interfaces:
Section

public class BasicSection
extends java.lang.Object
implements Section

Basic implementation of Section interface.


Field Summary
static java.lang.String CN
           
static int TEXT_BUFFER_INIT_SIZE
           
 
Fields inherited from interface org.jostraca.section.Section
DEFAULT_NAME, MN_append, MN_prepend, NAME_body, NAME_declare, NAME_documentation, NAME_init
 
Constructor Summary
BasicSection(java.lang.String pName)
          Construction requires name.
 
Method Summary
 void append(java.lang.String pText)
          Append content to a section.
 void clear()
          Clear section content.
 boolean equals(java.lang.Object pObject)
          Test for equality
 java.lang.String getContent()
          Get section content.
 java.lang.String getName()
          Get name of section.
 boolean isEmpty()
          True if Section content is empty String.
 void prepend(java.lang.String pText)
          prepend content to a section.
 void setContent(java.lang.String pContent)
          Set content of section.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CN

public static final java.lang.String CN

TEXT_BUFFER_INIT_SIZE

public static final int TEXT_BUFFER_INIT_SIZE
See Also:
Constant Field Values
Constructor Detail

BasicSection

public BasicSection(java.lang.String pName)
Construction requires name.

Parameters:
pName - Name of section. If null or "", use DEFAULT_NAME.
Method Detail

append

public void append(java.lang.String pText)
Description copied from interface: Section
Append content to a section.

Specified by:
append in interface Section
Parameters:
pText - content to append (if null, then "")
See Also:
Section

prepend

public void prepend(java.lang.String pText)
Description copied from interface: Section
prepend content to a section.

Specified by:
prepend in interface Section
Parameters:
pText - content to prepend (if null, then "")
See Also:
Section

clear

public void clear()
Description copied from interface: Section
Clear section content.

Specified by:
clear in interface Section
See Also:
Section

getContent

public java.lang.String getContent()
Description copied from interface: Section
Get section content. Contract: Always returns a String even if empty.

Specified by:
getContent in interface Section
See Also:
Section

setContent

public void setContent(java.lang.String pContent)
Description copied from interface: Section
Set content of section.

Specified by:
setContent in interface Section
Parameters:
pContent - full content (if null, then "")
See Also:
Section

getName

public java.lang.String getName()
Description copied from interface: Section
Get name of section. Contract: Name =~ /^[0-9a-zA-Z_-]+$/

Specified by:
getName in interface Section
See Also:
Section

isEmpty

public boolean isEmpty()
Description copied from interface: Section
True if Section content is empty String.

Specified by:
isEmpty in interface Section
See Also:
Section

equals

public boolean equals(java.lang.Object pObject)
Description copied from interface: Section
Test for equality

Specified by:
equals in interface Section
See Also:
Section

toString

public java.lang.String toString()


Copyright © 2000-2002 Richard Rodger