1 8 9 package net.sourceforge.chaperon.process.extended; 10 11 import net.sourceforge.chaperon.common.Decoder; 12 13 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 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 toString() 48 { 49 return "shift "+Decoder.toClass(minimum, maximum); 50 } 51 } 52 | Popular Tags |