Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.io.Serializable;
- public final class Phrase implements Serializable
- {
- public String text;
- public ArrayList<String> responseTo;
- public ArrayList<String> howToProceed;
- public Phrase(String text, String[] preceding)
- {
- responseTo = new ArrayList<String>();
- howToProceed = new ArrayList<String>();
- for(int i = 0; i < preceding.length ;i++)
- {
- responseTo.add(preceding[i]);
- }
- this.text = text;
- }
- public Phrase(String text, String[] preceding, String[] toProceed)
- {
- responseTo = new ArrayList<String>();
- howToProceed = new ArrayList<String>();
- for(int i = 0; i < preceding.length ;i++)
- {
- responseTo.add(preceding[i]);
- }
- for(int i = 0; i < toProceed.length ;i++)
- {
- howToProceed.add(toProceed[i]);
- }
- this.text = text;
- }
- public Phrase(String text)
- {
- responseTo = new ArrayList<String>();
- howToProceed = new ArrayList<String>();
- this.text = text;
- }
- public void newPreceding(String phrase)
- {
- responseTo.add(phrase);
- }
- public void addResponseTo(String phrase)
- {
- howToProceed.add(phrase);
- }
- public String getPhrase()
- {
- return text;
- }
- public ArrayList<String> getResponseTo()
- {
- return responseTo;
- }
- public ArrayList<String> getHowToProceed()
- {
- return howToProceed;
- }
- public String toString()
- {
- return text + " is for: " + responseTo + " how to proceed:" + howToProceed;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement