- Timestamp:
- 09/09/11 06:23:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDlistSymbols.java
r130 r171 10 10 import de.ugoe.cs.util.console.Console; 11 11 12 /** 13 * <p> 14 * Command to list all events (symbols) known to a usage profile (stochastic 15 * process). 16 * </p> 17 * 18 * @author Steffen Herbold 19 * @version 1.0 20 */ 12 21 public class CMDlistSymbols implements Command { 13 22 23 /* 24 * (non-Javadoc) 25 * 26 * @see de.ugoe.cs.util.console.Command#run(java.util.List) 27 */ 14 28 @Override 15 29 public void run(List<Object> parameters) { … … 18 32 try { 19 33 modelname = (String) parameters.get(0); 20 if ( parameters.size()==2) {34 if (parameters.size() == 2) { 21 35 sort = Boolean.parseBoolean((String) parameters.get(1)); 22 36 } … … 24 38 throw new InvalidParameterException(); 25 39 } 26 27 IStochasticProcess model = null; 28 Object dataObject = GlobalDataContainer.getInstance().getData(modelname); 29 if( dataObject==null ) { 40 41 IStochasticProcess model = null; 42 Object dataObject = GlobalDataContainer.getInstance() 43 .getData(modelname); 44 if (dataObject == null) { 30 45 Console.println("Model " + modelname + "not found in storage."); 31 } 32 else if( !(dataObject instanceof IStochasticProcess) ) {33 Console.println("Object " + modelname+ " is not a stochastic process!");46 } else if (!(dataObject instanceof IStochasticProcess)) { 47 Console.println("Object " + modelname 48 + " is not a stochastic process!"); 34 49 } else { 35 50 model = (IStochasticProcess) dataObject; 36 51 String[] stateStrings = model.getSymbolStrings(); 37 if ( sort) {52 if (sort) { 38 53 Arrays.sort(stateStrings); 39 54 } 40 for ( String stateString : stateStrings) {55 for (String stateString : stateStrings) { 41 56 Console.println(stateString); 42 57 } … … 44 59 } 45 60 61 /* 62 * (non-Javadoc) 63 * 64 * @see de.ugoe.cs.util.console.Command#help() 65 */ 46 66 @Override 47 67 public void help() {
Note: See TracChangeset
for help on using the changeset viewer.