Package com.storedobject.office
Class ODT.TextElement
java.lang.Object
com.storedobject.office.ODT.Element
com.storedobject.office.ODT.TextElement
- Direct Known Subclasses:
ODT.Document,ODT.Section,ODT.TableCell
Represents a text element that can contain one or more sections and tables.
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptiongetImage(int index) Retrieves anImagefrom the list of images present in this instance at the specified index.Retrieves an image by its name from the list of images associated with this instance.intRetrieves the total number of images associated with this instance.getSection(int index) Retrieves a section under this at the specified index.getSection(String name) Retrieves a section under this by its name.intGet the number of sections under this.getTable(int index) Retrieves a table under this by its index.Retrieves aTableunder this with the specified name.intRetrieves the total number of tables present under this instance.booleanremove()Removes this element from the output.Methods inherited from class com.storedobject.office.ODT.Element
getCell, getDocument, getName, getParent, getParentCell, getParentRow, getParentSection, getParentTable
-
Method Details
-
getImagesCount
public int getImagesCount()Retrieves the total number of images associated with this instance. If the image list has not been initialized, it will be built prior to retrieval.- Returns:
- The number of images available. Returns 0 if there are no images.
-
getImage
Retrieves anImagefrom the list of images present in this instance at the specified index. If the image list has not been initialized, it will be built before accessing the image.- Parameters:
index- The zero-based index of theImageto retrieve. Must be within the range of existing images (0 to the number of images - 1).- Returns:
- The
Imageat the specified index, ornullif the index is out of bounds or the image cannot be retrieved.
-
getImage
Retrieves an image by its name from the list of images associated with this instance. If the image list is not initialized, it will be built prior to the retrieval operation.- Parameters:
name- The name of the image to retrieve. Must not be null.- Returns:
- The
Imageobject with the specified name, ornullif no image with the given name exists.
-
getSectionCount
public int getSectionCount()Get the number of sections under this.- Returns:
- Number of sections.
-
getSection
Retrieves a section under this at the specified index.- Parameters:
index- The index of the section to be retrieved. Must be a zero-based index.- Returns:
- The
Sectionat the specified index, ornullif the index is invalid or the section list is empty.
-
getSection
Retrieves a section under this by its name.- Parameters:
name- The name of the section to retrieve.- Returns:
- The
Sectionwith the specified name, ornullif no matching section is found.
-
getTableCount
public int getTableCount()Retrieves the total number of tables present under this instance.- Returns:
- The number of tables available. If there are no tables, it returns 0.
-
getTable
Retrieves a table under this by its index.- Parameters:
index- The zero-based index of the table to retrieve. Must be within the range of existing tables (0 to the number of tables - 1).- Returns:
- The
ODT.Tableat the specified index, ornullif the index is out of bounds or the table cannot be retrieved.
-
getTable
-
remove
public boolean remove()Description copied from class:ODT.ElementRemoves this element from the output.- Overrides:
removein classODT.Element- Returns:
- Returns
trueunless the element was already removed.
-