01: // Copyright (c) 2001 Per M.A. Bothner and Brainfood Inc.
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.mapping;
05:
06: import gnu.lists.*;
07:
08: public class ValueStack extends TreeList implements Sequence {
09: int oindex;
10:
11: protected int find(Object arg1) {
12: if (oindex == objects.length)
13: resizeObjects();
14: objects[oindex] = arg1;
15: return oindex++;
16: }
17:
18: protected int find(Object arg1, Object arg2) {
19: int i = oindex;
20: int i2 = i + 2;
21: if (i2 > objects.length)
22: resizeObjects();
23: objects[i] = arg1;
24: objects[i + 1] = arg1;
25: oindex = i2;
26: return i;
27: }
28: }
|