Package javolution.util

Examples of javolution.util.FastCollection$Text


     */
    public void setEntitiesMapping(Map entityToReplacementText) {
        // Sets the maximum length for replacement text.
        Collection values = entityToReplacementText.values();
        if (values instanceof FastCollection) { // Avoids allocating iterators.
             FastCollection fc = (FastCollection) values;
             for (Record r=fc.head(), t=fc.tail(); (r = r.getNext())!= t;) {
                 CharSequence value = (CharSequence) fc.valueOf(r);
                 if (_maxLength < value.length()) {
                     _maxLength = value.length();
                 }
             }
        } else {
View Full Code Here


    private void print( Object element ) throws IOException, JDOMException
    {
        if( element instanceof Text )
        {
            Text t = (Text)element;
            String s = t.getText();
            if( m_preStack.isPreMode() )
            {
                m_out.print( s );
            }
            else
View Full Code Here

  }
 

  @Test
  public void testTextEmpty() {
    Text content = new Text("");
    assertEquals("", outputString(fraw,     content));
    assertEquals("", outputString(fcompact, content));
    assertEquals("", outputString(fpretty,  content));
    assertEquals("", outputString(ftso,     content));
    assertEquals("", outputString(ftfw,     content));
View Full Code Here

    assertEquals("", outputString(ftfw,     content));
  }
 
  @Test
  public void testTextWhitespace() {
    Text content = new Text(" \r \n \t ");
    assertEquals(expect(" \r \n \t "),
        outputString(fraw,     content));
    assertEquals("",
        outputString(fcompact, content));
    assertEquals("",
View Full Code Here

        outputString(ftfw,     content));
  }

  @Test
  public void testTextWithText() {
    Text content = new Text(" \r & \n \t ");
    assertEquals(expect(" \r &amp; \n \t "),
        outputString(fraw,     content));
    assertEquals(expect("&amp;"),
        outputString(fcompact, content));
    assertEquals(expect("&amp;"),
View Full Code Here

 
  @Test
  public void testMultiWhiteText() {
    Element root = new Element("root");
    root.addContent(new CDATA(" "));
    root.addContent(new Text(" "));
    root.addContent(new Text("    "));
    root.addContent(new Text(""));
    root.addContent(new Text(" "));
    root.addContent(new Text("  \n \n "));
    root.addContent(new Text("  \t "));
    root.addContent(new Text("  "));
    assertEquals(expect("<root><![CDATA[ ]]>        \n \n   \t   </root>"),
        outputString(fraw,     root));
    assertEquals(expect("<root/>"),
        outputString(fcompact, root));
    assertEquals(expect("<root/>"),
View Full Code Here

 
  @Test
  public void testMultiText() {
    Element root = new Element("root");
    root.addContent(new CDATA(" "));
    root.addContent(new Text(" "));
    root.addContent(new Text("    "));
    root.addContent(new Text(""));
    root.addContent(new Text("X"));
    root.addContent(new Text("  \n \n "));
    root.addContent(new Text("  \t "));
    root.addContent(new Text("  "));
    assertEquals(expect("<root><![CDATA[ ]]>     X  \n \n   \t   </root>"),
        outputString(fraw,     root));
    assertEquals(expect("<root>X</root>"),
        outputString(fcompact, root));
    assertEquals(expect("<root>X</root>"),
View Full Code Here

 
 
 
  @Test
  public void testXXX() {
    Text content = new Text("");
    assertEquals("",
        outputString(fraw,     content));
    assertEquals("",
        outputString(fcompact, content));
    assertEquals("",
View Full Code Here

 
 
 
  @Test
  public void testOutputText() {
    checkOutput(new Text(" hello  there  "), " hello  there  ", "hello there", "hello  there", "hello  there", " hello  there  ");
  }
View Full Code Here

  @Test
  public void testOutputElementMultiText() {
    Element root = new Element("root");
    root.addContent(new CDATA(" "));
    root.addContent(new Text(" xx "));
    root.addContent(new Text("yy"));
    root.addContent(new Text("    "));
    root.addContent(new Text("zz"));
    root.addContent(new Text("  ww"));
    root.addContent(new EntityRef("amp"));
    root.addContent(new Text("vv"));
    root.addContent(new Text("  "));
    checkOutput(root,
        "<root><![CDATA[ ]]> xx yy    zz  ww&amp;vv  </root>",
        "<root>xx yy zz ww&amp;vv</root>",
        "<root>xx yy    zz  ww&amp;vv</root>",
        "<root>xx yy    zz  ww&amp;vv</root>",
View Full Code Here

TOP

Related Classes of javolution.util.FastCollection$Text

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.