KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > chaperon > process > extended > ShiftAction


1 /*
2  * Copyright (C) Chaperon. All rights reserved.
3  * -------------------------------------------------------------------------
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE file.
7  */

8
9 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 {
19   public final char minimum;
20   public final char maximum;
21   public final State state;
22
23   public ShiftAction(char minimum, char maximum, State state)
24   {
25     this.minimum = minimum;
26     this.maximum = maximum;
27     this.state = state;
28   }
29
30   public boolean contains(char c)
31   {
32     return (minimum<=c) && (c<=maximum);
33   }
34
35   public boolean equals(Object JavaDoc o)
36   {
37     if (o instanceof ShiftAction)
38     {
39       ShiftAction shiftAction = (ShiftAction)o;
40
41       return (minimum==shiftAction.minimum) && (maximum==shiftAction.maximum);
42     }
43
44     return false;
45   }
46
47   public String JavaDoc toString()
48   {
49     return "shift "+Decoder.toClass(minimum, maximum);
50   }
51 }
52
Popular Tags