1 2 package org.state4j.sm; 3 4 import java.util.Map; 5 public interface SmContext<T extends SmTarget> extends Cloneable { 6 public Object clone() throws CloneNotSupportedException; 7 void entryInState(SmState state); 8 9 void exitFromState(SmState state); 10 11 SmEvent getCurrentEvent(); 12 13 void setCurrentEvent(SmEvent event); 14 15 boolean hasCurrentEvent(); 16 17 SmState getCurrentState(); 18 19 void setCurrentState(SmState state); 20 21 boolean hasCurrentState(); 22 23 T getTarget(); 24 25 void setTarget(T target); 26 27 boolean hasTarget(); 28 29 void setAttribute(String key, String value); 30 31 String getAttribute(String key); 32 33 boolean hasAttribute(String key); 34 35 void addAttributes(Map<String, String> attributes); 36 37 }