01: /*
02: * FindElemResult.java --
03: *
04: * Result returned by Util.findElement().
05: *
06: * Copyright (c) 1997 Cornell University.
07: * Copyright (c) 1997 Sun Microsystems, Inc.
08: *
09: * See the file "license.terms" for information on usage and
10: * redistribution of this file, and for a DISCLAIMER OF ALL
11: * WARRANTIES.
12: *
13: * RCS: @(#) $Id: FindElemResult.java,v 1.4 2005/11/22 22:10:02 mdejong Exp $
14: *
15: */
16:
17: package tcl.lang;
18:
19: // Result returned by Util.findElement().
20:
21: class FindElemResult {
22:
23: // The start index of the element in the original string -- the index of the
24: // first character in the element.
25:
26: int elemStart;
27:
28: // The end index of the element in the original string -- the index of the
29: // character immediately behind the element.
30:
31: int elemEnd;
32:
33: // The number of characters parsed from the original string, this can be
34: // different than the length of the elem string when two characters
35: // are collapsed into one in the case of a backslash.
36:
37: int size;
38:
39: // The element itself.
40:
41: String elem;
42:
43: /*
44: *----------------------------------------------------------------------
45: *
46: * update --
47: *
48: * Update a FindElemResult, this method is used only in
49: * the Util.findElement() API.
50: *
51: * Results:
52: * None.
53: *
54: * Side effects:
55: * The member fields are updated.
56: *
57: *----------------------------------------------------------------------
58: */
59:
60: void update(int start, // Initial value for elemStart.
61: int end, // Initial value for elemEnd.
62: String elem, // Initial value for elem.
63: int size) // Initial value for size.
64: {
65: this .elemStart = start;
66: this .elemEnd = end;
67: this .elem = elem;
68: this .size = size;
69: }
70:
71: } // end FindElemResult
|