00001 package instruction.semanticObjects; 00002 00003 import java.util.ArrayList; 00004 00005 public class Quantifier extends SemanticObject { 00006 00007 private ArrayList<Word> alternatives = new ArrayList<Word>(); 00008 private Word measure = new Word(); 00009 00010 public Quantifier () { 00011 00012 } 00013 00014 public void setMeasure(Word measure) { 00015 this.measure = measure; 00016 } 00017 00018 public Word getMeasure() { 00019 return measure; 00020 } 00021 00022 public ArrayList<Word> getAlternatives() { 00023 00024 return alternatives; 00025 } 00026 00027 public void setAlternatives(ArrayList<Word> alt) { 00028 alternatives = alt; 00029 } 00030 00031 public String toString() { 00032 String str = "({"; 00033 for (int i = 0; i < alternatives.size(); i++) { 00034 str += alternatives.get( i ); 00035 if (i < alternatives.size() - 1) 00036 str += ","; 00037 } 00038 str += "}," + measure + ")"; 00039 return str; 00040 } 00041 00042 public boolean equals( Object q ) { 00043 if (! (q instanceof Quantifier)) 00044 return false; 00045 return alternatives.equals( ((Quantifier) q).getAlternatives() ); 00046 } 00047 }