public class Section
extends java.lang.Object
See BookManager for more information.
Constructor and Description |
---|
Section(Chapter sectionChapter,
int sectionNbr,
java.lang.String sectionTitle)
Sole constructor for Section..
|
Modifier and Type | Method and Description |
---|---|
boolean |
assignChapterSectionNbrs(MObj mObj)
Assigns an MObj to a Chapter and Section and computes the MObj
SectionMObjNbr.
|
int |
getLastMObjNbr()
Returns the last MObj number within the section.
|
int |
getMaxMObjSeq() |
int |
getMinMObjSeq() |
int |
getSectionCategoryCd()
Returns the Section Category Code.
|
static int |
getSectionCategoryCd(int s)
Returns the Section Category Code for a Section number.
|
java.lang.String |
getSectionCategoryDisplayCaption()
Returns a string caption for the Section category code.
|
Chapter |
getSectionChapter()
Returns the Chapter to which the Section is assigned.
|
int |
getSectionNbr()
Returns the sectionNbr for the Section.
|
java.lang.String |
getSectionTitle()
Returns the sectionTitle for the Section.
|
void |
setMaxMObjSeq(int maxMObjSeq) |
void |
setMinMObjSeq(int minMObjSeq) |
void |
setSectionTitle(java.lang.String sectionTitle)
Sets the value of the sectionTitle for the Section.
|
java.lang.String |
toString()
Test code for creating diagnostics.
|
public Section(Chapter sectionChapter, int sectionNbr, java.lang.String sectionTitle)
sectionChapter
- the Chapter to which the Section belongs.sectionNbr
- is assigned by BookManager.sectionTitle
- is the extracted descriptive title from the input
Metamath database or the default title (must be at least an
empty String!)public boolean assignChapterSectionNbrs(MObj mObj)
This function is intended for use by LogicalSystem and it is this function which actually updates the MOBj with the computed SectionMOBjNbr.
Note: the MObj is assigned a new sectionMObjNbr only if MObj has not already been assigned one. The reason this is necessary even with updates performed during the initial load of the input .mm file is that a Metamath Var can be declared in multiple locations within the file. These multiple declarations occur within separate Metamath Scopes and outside of the scope the Var is considered to be "inactive", so subsequent re-declarations are considered to be re-activations. The bottom line is that only the first declaration is assigned a sectionMObjNbr.
mObj
- the MObj to be assigned to a Chapter and Section and updated
with SectionMObjNbr.public int getMinMObjSeq()
public int getMaxMObjSeq()
public void setMinMObjSeq(int minMObjSeq)
public void setMaxMObjSeq(int maxMObjSeq)
public Chapter getSectionChapter()
public int getSectionNbr()
public java.lang.String getSectionTitle()
public void setSectionTitle(java.lang.String sectionTitle)
The title must be, at least, an empty String.
sectionTitle
- Description or Title of the Section.public int getLastMObjNbr()
The highest MObj number is the same as the last because additions are made only at the end of a Section and new MObj numbers are generated from 1 by 1 within each Section.
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSectionCategoryDisplayCaption()
See LangConstants.SECTION_DISPLAY_CAPTION.
public int getSectionCategoryCd()
See LangConstants.SECTION_NBR_CATEGORIES.
public static int getSectionCategoryCd(int s)
See LangConstants.SECTION_NBR_CATEGORIES.
s
- section number