/** * Returns the Formats wich are used in this ContentElement, in the Range from start to end, in a List. */ public List<FormatType> getFormats(int start, int end){ return getFormats(new Span(start, end)); }
/** * Returns a List of the Templates of this ContentElement in the Range from start to end */ public List<Template> getTemplates(int start, int end){ return getTemplates( new Span(start, end) ); }
/** * Removes all empty Structures from a DefinitionList and all substructures. */ public static DefinitionList eliminateEmptyStructures( DefinitionList dl ){ ContentElement dt = dl.getDefinedTerm(); if( dt!=null && dt.empty() ) dl.setDefinedTerm( null ); for(int i=dl.nrOfDefinitions()-1; i>=0; i-- ){ ContentElement ce = dl.getDefinition(i); if( ce.empty() )dl.removeDefinition( ce ); } return dl; } }
public int nrOfParagraphs(){ int result = 0; for( Section s: sections ) result+= s.nrOfParagraphs(); return result; }
/** * Returns all the Spans of the Format type t in the Range of start to end */ public List<Span> getFormatSpans(FormatType t, int start, int end ){ return getFormatSpans( t, new Span(start, end)); }
public List<Span> getFormatSpans(FormatType t, int start, int end ){ return getFormatSpans(t, new Span( start, end ) ); }
public List<FormatType> getFormats(int start, int end){ return getFormats(new Span(start, end) ); }
public List<Template> getTemplates(int start, int end){ return getTemplates( new Span(start, end )); }
/** * Returns getTitleElement().getText() without NullPointerException */ public String getTitle(){ if( title!=null ) return title.getText(); else return null; }
public NestedList getNestedList(int i){ int nr = 0; int offset = 0; for( TableElement td: tableElements ){ nr = td.nrOfNestedLists(); if( nr+offset > i )return td.getNestedList(i-offset); offset += nr; } return null; }
/** * Returns the number of tables. * @return The number of tables. */ public int nrOfTables(){ return superSection.nrOfTables(); }
/** * Returns a list of tables. * @return A list of tables. */ public List<Table> getTables(){ return superSection.getTables(); }
/** * Returns a list of templates that are used in the page. * @return A list of templates that are used in the page. */ public List<Template> getTemplates(){ return superSection.getTemplates(); }
public int nrOfTables(){ int result = 0; for( TableElement td: tableElements ) result+= td.nrOfTables(); return result; }
/** * Returns a list of language Link objects. * This is a shortcut for writing getLanguagesElement().getLinks(); */ public List<Link> getLanguages(){ return languages.getLinks(); }
/** * Returns the number of nested lists. * @return The number of nested lists. */ public int nrOfNestedLists(){ return superSection.nrOfNestedLists(); }
/** * Returns the definition list indicated by the parameter i. * @param i The number of the definition list to return. * @return The definition list with number i. */ public DefinitionList getDefinitionList(int i){ return superSection.getDefinitionList(i); }