Package com.mdimension.jchronic.utils

Examples of com.mdimension.jchronic.utils.Token


  }

  public void testHandlerClass6() {
    Handler handler = new Handler(new DummyHandler(), new TagPattern(Scalar.class), new TagPattern(Repeater.class), new TagPattern(Pointer.class));
    List<Token> tokens = new LinkedList<Token>();
    tokens.add(new Token("3"));
    tokens.add(new Token("years"));
    tokens.add(new Token("past"));
   
    tokens.get(0).tag(new Scalar(Integer.valueOf(3)));
    tokens.get(1).tag(new RepeaterYear());
    tokens.get(2).tag(new Pointer(Pointer.PointerType.PAST));
   
View Full Code Here


    super.setUp();
    _now = Time.construct(2006, 8, 16, 14, 0, 0, 0);
  }

  public void testToken() {
    Token token = new Token("foo");
    assertEquals(0, token.getTags().size());
    assertFalse(token.isTagged());
    token.tag(new StringTag("mytag"));
    assertEquals(1, token.getTags().size());
    assertTrue(token.isTagged());
    assertEquals(StringTag.class, token.getTag(StringTag.class).getClass());
    token.tag(new Scalar(Integer.valueOf(5)));
    assertEquals(2, token.getTags().size());
    token.untag(StringTag.class);
    assertEquals(1, token.getTags().size());
    assertEquals("foo", token.getWord());
  }
View Full Code Here

TOP

Related Classes of com.mdimension.jchronic.utils.Token

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.