/******************************************************************************* * Copyright (c) 2009 Elliott Baron * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Elliott Baron - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.codan.extension; import java.util.Collections; import java.util.HashSet; import java.util.Set; public class SymbolicState { private Set propertyStates; private ExecutionState executionState; public SymbolicState(Set propertyStates, ExecutionState executionState) { this.propertyStates = propertyStates; this.executionState = executionState; } public ExecutionState getExecutionState() { return executionState; } public void setExecutionState(ExecutionState es) { executionState = es; } public Set getPropertyStates() { return Collections.unmodifiableSet(propertyStates); } public void setPropertyStates(Set ps) { propertyStates = ps; } public SymbolicState copy() { Set ps = new HashSet(propertyStates); ExecutionState es = new ExecutionState(); for (ExecutionStateClause cl : executionState.getClauses()) { es.addClause(cl); } return new SymbolicState(ps, es); } @Override public String toString() { StringBuffer buf = new StringBuffer(); buf.append("["); buf.append(propertyStates); buf.append(", "); buf.append(executionState); buf.append("]"); return buf.toString(); } }