ca.site.elkb
Class Section

java.lang.Object
  extended by ca.site.elkb.Section

public class Section
extends java.lang.Object

Represents a Roget's Thesaurus Section. A Section is defined by the following attributes:

A Section can contain Head or HeadInfo objects, depending on the use.

Version:
1.4 2013
Author:
Mario Jarmasz and Alistsair Kennedy

Constructor Summary
Section()
          Default constructor.
Section(int number, java.lang.String name)
          Constructor which sets the Section number and name.
Section(int number, java.lang.String name, int start, int end)
          Constructor which sets the Section number and name, as well as the number of the first and last Head.
Section(int number, java.lang.String strNum, java.lang.String strName)
          Constructor which sets the Section number, name, and Section number in string format and Class name, while parsing the strings for the Section number and name.
 
Method Summary
 void addHeadInfo(HeadInfo head)
          Adds a HeadInfo object to this Section.
 int getHeadEnd()
          Returns the number of the last Head of this Section.
 java.util.ArrayList<HeadInfo> getHeadInfoList()
          Returns the array of HeadInfo objects of this Section.
 int getHeadStart()
          Returns the number of the first Head of this Section.
 java.lang.String getSectionName()
          Returns the name of this Section.
 int getSectionNum()
          Returns the number of this Section.
 java.lang.String getStrSectionNum()
          Returns the number of this Section in string format.
 int headCount()
          Returns the number of Heads in this Section.
 void print()
          Prints the content of this Section to the standard output.
 void printHeadInfo()
          Prints the information regarding the Heads contained in this Section to the standard output.
 void setHeadEnd(int end)
          Sets the number of the last Head of this Section.
 void setHeadStart(int start)
          Sets the number of the first Head of this Section.
 void setSectionName(java.lang.String name)
          Sets the number of this Section in string format.
 void setSectionNum(int num)
          Sets the number of this Section.
 void setStrSectionNum(java.lang.String snum)
          Sets the number of this Section in string format.
 java.lang.String toString()
          Converts to a string representation the Section object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Section

public Section()
Default constructor.


Section

public Section(int number,
               java.lang.String name)
Constructor which sets the Section number and name.

Parameters:
number -
name -

Section

public Section(int number,
               java.lang.String name,
               int start,
               int end)
Constructor which sets the Section number and name, as well as the number of the first and last Head.

Parameters:
number -
name -
start -
end -

Section

public Section(int number,
               java.lang.String strNum,
               java.lang.String strName)
Constructor which sets the Section number, name, and Section number in string format and Class name, while parsing the strings for the Section number and name. Examples of the strings to be parsed are:
^sectionNumber>#Section one #^/sectionNumber>
^sectionTitle>#^size=-1>#^b>#Existence #^/b>#^/size>#^/sectionTitle>

Parameters:
number -
strNum -
strName -
Method Detail

getSectionNum

public int getSectionNum()
Returns the number of this Section.

Returns:
section number

setSectionNum

public void setSectionNum(int num)
Sets the number of this Section.

Parameters:
num -

getStrSectionNum

public java.lang.String getStrSectionNum()
Returns the number of this Section in string format.

Returns:
section number as string

setStrSectionNum

public void setStrSectionNum(java.lang.String snum)
Sets the number of this Section in string format.

Parameters:
snum -

getSectionName

public java.lang.String getSectionName()
Returns the name of this Section.

Returns:
section name

setSectionName

public void setSectionName(java.lang.String name)
Sets the number of this Section in string format.

Parameters:
name -

getHeadStart

public int getHeadStart()
Returns the number of the first Head of this Section.

Returns:
head start number

setHeadStart

public void setHeadStart(int start)
Sets the number of the first Head of this Section.

Parameters:
start -

getHeadEnd

public int getHeadEnd()
Returns the number of the last Head of this Section.

Returns:
head end number

setHeadEnd

public void setHeadEnd(int end)
Sets the number of the last Head of this Section.

Parameters:
end -

addHeadInfo

public void addHeadInfo(HeadInfo head)
Adds a HeadInfo object to this Section.

Parameters:
head -

getHeadInfoList

public java.util.ArrayList<HeadInfo> getHeadInfoList()
Returns the array of HeadInfo objects of this Section.

Returns:
ArrayList of head info

headCount

public int headCount()
Returns the number of Heads in this Section.

Returns:
number of heads

toString

public java.lang.String toString()
Converts to a string representation the Section object.

Overrides:
toString in class java.lang.Object

print

public void print()
Prints the content of this Section to the standard output.


printHeadInfo

public void printHeadInfo()
Prints the information regarding the Heads contained in this Section to the standard output.