00001 package instruction.semanticObjects; 00002 00003 import java.util.ArrayList; 00004 import java.util.List; 00005 00006 public class Action extends SemanticObject { 00007 00008 Word action = new Word(); 00009 List<Word> adverb = new ArrayList<Word>(); 00010 boolean dont; 00011 00012 public Action () { 00013 00014 } 00015 00016 public Action ( Word a ) { 00017 00018 action = a; 00019 } 00020 00021 public Action ( Word a, List<Word> adv ) { 00022 00023 action = a; 00024 adverb = adv; 00025 } 00026 00027 public boolean dontDoIt() { 00028 00029 return dont; 00030 } 00031 00032 public void setDontDoIt( boolean dont ) { 00033 00034 this.dont = dont; 00035 } 00036 00037 public String toString() { 00038 00039 return ( dont ? "! " : "" ) + action.toString(); 00040 } 00041 00042 public void setAction( Word action ) { 00043 00044 this.action = action; 00045 } 00046 00047 public void setAdverbs( List<Word> adverb ) { 00048 00049 this.adverb = adverb; 00050 } 00051 00052 public Word getAction() { 00053 00054 return action; 00055 } 00056 00057 public List<Word> getAdverb() { 00058 00059 return adverb; 00060 } 00061 00062 public boolean equals( Object a ) { 00063 if (! (a instanceof Action)) 00064 return false; 00065 if ( ((Action) a).getAction().equals( action ) && ((Action) a).getAdverb().equals( adverb ) ) 00066 return true; 00067 00068 return false; 00069 } 00070 }