01: /*
02: * Copyright (C) Chaperon. All rights reserved.
03: * -------------------------------------------------------------------------
04: * This software is published under the terms of the Apache Software License
05: * version 1.1, a copy of which has been included with this distribution in
06: * the LICENSE file.
07: */
08:
09: package net.sourceforge.chaperon.process.extended;
10:
11: import net.sourceforge.chaperon.common.Decoder;
12:
13: /**
14: * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
15: * @version CVS $Id: ShiftAction.java,v 1.1 2004/01/04 16:49:12 benedikta Exp $
16: */
17: public class ShiftAction {
18: public final char minimum;
19: public final char maximum;
20: public final State state;
21:
22: public ShiftAction(char minimum, char maximum, State state) {
23: this .minimum = minimum;
24: this .maximum = maximum;
25: this .state = state;
26: }
27:
28: public boolean contains(char c) {
29: return (minimum <= c) && (c <= maximum);
30: }
31:
32: public boolean equals(Object o) {
33: if (o instanceof ShiftAction) {
34: ShiftAction shiftAction = (ShiftAction) o;
35:
36: return (minimum == shiftAction.minimum)
37: && (maximum == shiftAction.maximum);
38: }
39:
40: return false;
41: }
42:
43: public String toString() {
44: return "shift " + Decoder.toClass(minimum, maximum);
45: }
46: }
|