/** * Returns all the Spans of the Format type t in the Range of the Span s */ public List<Span> getFormatSpans(FormatType t, Span s){ List<Span> result = new ArrayList<Span>(); for( Span s2: getFormatSpans(t) ) if( s2.hits(s) )result.add( s2 ); 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)); }
private static void checkRange( ContentElement ce ){ List<SrcSpan> eil = new ArrayList<SrcSpan>(); for( Span s: ce.getFormatSpans( FormatType.BOLD ) ) eil.add( s.getSrcSpan() ); for( Span s: ce.getFormatSpans( FormatType.ITALIC ) ) eil.add( s.getSrcSpan() ); for( Span s: ce.getFormatSpans( FormatType.MATH ) ) eil.add( s.getSrcSpan() ); for( Span s: ce.getFormatSpans( FormatType.TAG ) ) eil.add( s.getSrcSpan() ); for( Span s: ce.getFormatSpans( FormatType.NOWIKI ) ) eil.add( s.getSrcSpan() ); for( Link l: ce.getLinks()) eil.add( l.getSrcSpan() ); for( Template t: ce.getTemplates() ) eil.add( t.getSrcSpan() ); ce.setSrcSpan( getEvalInfo( ce.getSrcSpan(), eil) ); }
"</td></tr>\n" ); String BoldWords = ce.getText( ce.getFormatSpans( FormatType.BOLD )); if( BoldWords.length() > 0 ) { result.append("<tr><td class=\""+cssClass+"\">BoldWords: "+convertTags(BoldWords)+"</td></tr>\n"); String ItalicWords = ce.getText( ce.getFormatSpans( FormatType.ITALIC )); if( ItalicWords.length() > 0 ) { result.append("<tr><td class=\""+cssClass+"\">italicWords: "+convertTags(ItalicWords)+"</td></tr>\n"); if( ce.getFormatSpans( FormatType.MATH ).size() != 0 ){ result.append("<tr><td class=\""+cssClass+"\">MathTags\n"); for( Span s: ce.getFormatSpans( FormatType.MATH ) ) { result.append( s.toString() +"\n"); if( ce.getFormatSpans( FormatType.TAG ).size()!=0 ){ result.append("<tr><td class=\""+cssClass+"\">Tags:\n"); for( Span s: ce.getFormatSpans( FormatType.TAG ) ) { result.append( s.toString() +"\n");