/* (non-Javadoc) * @see nl.adaptivity.process.processModel.ProcessModel#getNode(java.lang.String) */ @Override public final T getNode(final Identifiable nodeId) { if (nodeId instanceof ProcessNode) { return (T) nodeId; } return mProcessNodes.get(nodeId); }
public boolean addNode(T node) { if (mProcessNodes.add(node)) { node.setOwnerModel(this.asM()); return true; } return false; }
public T setNode(final int pos, final T newValue) { final T oldValue = mProcessNodes.set(pos, newValue); newValue.setOwnerModel(asM()); oldValue.setSuccessors(Collections.<Identifiable>emptySet()); oldValue.setPredecessors(Collections.<Identifiable>emptySet()); oldValue.setOwnerModel(null); newValue.resolveRefs(); for (Identifiable pred : newValue.getPredecessors()) { getNode(pred).addSuccessor(newValue); } for (Identifiable suc : newValue.getSuccessors()) { getNode(suc).addPredecessor(newValue); } return oldValue; }
public ProcessModelBase(final Collection<? extends T> processNodes) { mProcessNodes = IdentifyableSet.processNodeSet(processNodes); }
public T getNode(final int pos) { return mProcessNodes.get(pos); }
public boolean removeNode(T node) { return mProcessNodes.remove(node); }
/** * Set the process nodes for the model. This will actually just retrieve the {@link EndNodeImpl}s * and sets the model accordingly. This does mean that only passing {@link EndNodeImpl}s will have * the same result, and the other nodes will be pulled in. * * @param processNodes The process nodes to base the model on. */ public void setModelNodes(@NotNull final Collection<? extends T> processNodes) { mProcessNodes = IdentifyableSet.processNodeSet(processNodes); }
public T removeNode(final int nodePos) { return mProcessNodes.remove(nodePos); }