Ignore:
Timestamp:
09/09/11 06:23:36 (13 years ago)
Author:
sherbold
Message:
  • code documentation and formatting
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDlistSymbols.java

    r130 r171  
    1010import de.ugoe.cs.util.console.Console; 
    1111 
     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 */ 
    1221public class CMDlistSymbols implements Command { 
    1322 
     23        /* 
     24         * (non-Javadoc) 
     25         *  
     26         * @see de.ugoe.cs.util.console.Command#run(java.util.List) 
     27         */ 
    1428        @Override 
    1529        public void run(List<Object> parameters) { 
     
    1832                try { 
    1933                        modelname = (String) parameters.get(0); 
    20                         if( parameters.size()==2 ) { 
     34                        if (parameters.size() == 2) { 
    2135                                sort = Boolean.parseBoolean((String) parameters.get(1)); 
    2236                        } 
     
    2438                        throw new InvalidParameterException(); 
    2539                } 
    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) { 
    3045                        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!"); 
    3449                } else { 
    3550                        model = (IStochasticProcess) dataObject; 
    3651                        String[] stateStrings = model.getSymbolStrings(); 
    37                         if( sort ) { 
     52                        if (sort) { 
    3853                                Arrays.sort(stateStrings); 
    3954                        } 
    40                         for( String stateString : stateStrings ) { 
     55                        for (String stateString : stateStrings) { 
    4156                                Console.println(stateString); 
    4257                        } 
     
    4459        } 
    4560 
     61        /* 
     62         * (non-Javadoc) 
     63         *  
     64         * @see de.ugoe.cs.util.console.Command#help() 
     65         */ 
    4666        @Override 
    4767        public void help() { 
Note: See TracChangeset for help on using the changeset viewer.