/* copy object values into an existing XML Element */ private void copyTo(Element e) { // appending empty strings to create new objects for "clone" support e.addAttribute(NAME, name + ""); for (State state : states.values()) { state.addAsChildOf(e); } }
public Role(Element e) { name = e.attributeValue(NAME); for (Object o : e.elements(STATE)) { State state = new State((Element) o); states.put(state.getStatus(), state); } }
public void removeState(int stateId) { states.remove(stateId); for (State s : states.values()) { s.removeTransition(stateId); } }
public void add(State state) { states.put(state.getStatus(), state); }