KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > format > parser > TextEvent


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9
10 package org.jboss.portal.format.parser;
11
12
13 /**
14  * An event implementation that says there is some text to handle.
15  */

16 public class TextEvent implements ParseEvent
17 {
18
19    protected char[] chars = null;
20    protected int offset = -1;
21    protected int length = -1;
22
23    public void setText(char[] chars, int offset, int length)
24    {
25       this.chars = chars;
26       this.offset = offset;
27       this.length = length;
28    }
29
30    public char[] chars()
31    {
32       return chars;
33    }
34
35    public int offset()
36    {
37       return offset;
38    }
39
40    public int length()
41    {
42       return length;
43    }
44
45    public String JavaDoc toString()
46    {
47       return "text:" + new String JavaDoc(chars, offset, length);
48    }
49 }
50
Popular Tags