Changeset 203
- Timestamp:
- 09/27/11 20:09:17 (13 years ago)
- Location:
- trunk/EventBenchConsole/src/de/ugoe/cs/eventbench
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/ReplayGenerator.java
r171 r203 5 5 import java.io.IOException; 6 6 import java.io.OutputStreamWriter; 7 import java.util.Collection; 7 8 import java.util.List; 8 9 … … 50 51 */ 51 52 public void createLogfileMultipleSessions( 52 List<List<ReplayableEvent<?>>> sequences, String filename) {53 Collection<List<ReplayableEvent<?>>> sequences, String filename) { 53 54 OutputStreamWriter writer = openReplayFile(filename); 54 55 if (writer != null) { 55 56 try { 56 decorator = sequences. get(0).get(0).getReplayDecorator();57 decorator = sequences.iterator().next().get(0).getReplayDecorator(); 57 58 if (decorator != null) { 58 59 writer.write(decorator.getHeader()); -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/AbstractTrainCommand.java
r184 r203 2 2 3 3 import java.security.InvalidParameterException; 4 import java.util.Collection; 4 5 import java.util.List; 5 6 … … 68 69 } 69 70 70 List<List<Event<?>>> sequences = null;71 Collection<List<Event<?>>> sequences = null; 71 72 Object dataObject = GlobalDataContainer.getInstance().getData( 72 73 sequencesName); … … 77 78 } 78 79 try { 79 sequences = ( List<List<Event<?>>>) dataObject;80 sequences = (Collection<List<Event<?>>>) dataObject; 80 81 } catch (ClassCastException e) { 81 82 Console.println("Object " + sequencesName 82 + "not of type List<List<Event<?>>>."); 83 + "not of type Collection<List<Event<?>>>."); 84 return; 83 85 } 86 /* TODO implement better type check 84 87 if (sequences.size() == 0 || !(sequences.get(0).get(0) instanceof Event) ) { 85 88 Console.println("Object " + sequencesName 86 + "not of type List<List<Event<?>>>.");89 + "not of type Collection<List<Event<?>>>."); 87 90 return; 88 91 } 92 */ 89 93 90 94 TrieBasedModel model = createModel(); -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDgenerateRandomReplay.java
r171 r203 2 2 3 3 import java.security.InvalidParameterException; 4 import java.util.Collection; 4 5 import java.util.LinkedList; 5 6 import java.util.List; … … 62 63 } else { 63 64 model = (IStochasticProcess) dataObject; 64 List<List<ReplayableEvent<?>>> sequences = new LinkedList<List<ReplayableEvent<?>>>();65 Collection<List<ReplayableEvent<?>>> sequences = new LinkedList<List<ReplayableEvent<?>>>(); 65 66 try { 66 67 for (int i = 0; i < numSessions; i++) { -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDgenerateReplayfile.java
r171 r203 2 2 3 3 import java.security.InvalidParameterException; 4 import java.util.Collection; 4 5 import java.util.List; 5 6 … … 41 42 } 42 43 43 List<List<ReplayableEvent<?>>> sequences = null;44 Collection<List<ReplayableEvent<?>>> sequences = null; 44 45 Object dataObject = GlobalDataContainer.getInstance().getData(sequencesName); 45 46 46 47 try { 47 sequences = ( List<List<ReplayableEvent<?>>>) dataObject;48 sequences = (Collection<List<ReplayableEvent<?>>>) dataObject; 48 49 ReplayGenerator generator = new ReplayGenerator(); 49 if( sequences!=null && sequences.size()>0 && sequences. get(0).get(0) instanceof Event ) {50 if( sequences!=null && sequences.size()>0 && sequences.iterator().next().get(0) instanceof Event ) { 50 51 generator.createLogfileMultipleSessions(sequences, filename); 51 52 } else { … … 53 54 if( sequencesName.equals("sequences") ) { 54 55 Console.traceln("Illegal use of \"sequences\" parameter in the GlobalDataContainer."); 55 Console.traceln("The parameter should always be of type List<List<Event>>!");56 Console.traceln("The parameter should always be of type Collection<List<Event>>!"); 56 57 } 57 58 } -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDsequenceStatistics.java
r171 r203 1 1 package de.ugoe.cs.eventbench.commands; 2 2 3 import java.util.Collection; 3 4 import java.util.List; 4 5 import java.util.Map.Entry; … … 35 36 } 36 37 37 List<List<Event<?>>> sequences = null;38 Collection<List<Event<?>>> sequences = null; 38 39 Object dataObject = GlobalDataContainer.getInstance().getData( 39 40 sequencesName); 40 41 41 42 try { 42 sequences = ( List<List<Event<?>>>) dataObject;43 sequences = (Collection<List<Event<?>>>) dataObject; 43 44 Console.traceln("Number of Sequences: " + sequences.size()); 44 45 SortedMap<Integer, Integer> lengthMap = new TreeMap<Integer, Integer>(); -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDshowSequences.java
r140 r203 2 2 3 3 import java.security.InvalidParameterException; 4 import java.util.Collection; 4 5 import java.util.List; 5 6 … … 22 23 throw new InvalidParameterException(); 23 24 24 List<List<Event<?>>> containedSequences = null;25 Collection<List<Event<?>>> containedSequences = null; 25 26 26 27 try { 27 containedSequences = ( List<List<Event<?>>>) GlobalDataContainer28 containedSequences = (Collection<List<Event<?>>>) GlobalDataContainer 28 29 .getInstance().getData("sequences"); 29 30 } catch (ClassCastException e) { -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDupdateModel.java
r184 r203 2 2 3 3 import java.security.InvalidParameterException; 4 import java.util.Collection; 4 5 import java.util.List; 5 6 … … 38 39 } 39 40 40 List<List<Event<?>>> sequences = null;41 Collection<List<Event<?>>> sequences = null; 41 42 Object dataObject = GlobalDataContainer.getInstance().getData( 42 43 sequencesName); … … 47 48 } 48 49 try { 49 sequences = ( List<List<Event<?>>>) dataObject;50 sequences = (Collection<List<Event<?>>>) dataObject; 50 51 } catch (ClassCastException e) { 51 52 Console.println("Object " + sequencesName 52 + "not of type List<List<Event<?>>>.");53 + "not of type Collection<List<Event<?>>>."); 53 54 } 54 55 if (sequences.size() == 0 55 || !(sequences. get(0).get(0) instanceof Event)) {56 || !(sequences.iterator().next().get(0) instanceof Event)) { 56 57 Console.println("Object " + sequencesName 57 + "not of type List<List<Event<?>>>.");58 + "not of type Collection<List<Event<?>>>."); 58 59 return; 59 60 } -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/web/WeblogParser.java
r177 r203 8 8 import java.text.SimpleDateFormat; 9 9 import java.util.ArrayList; 10 import java.util.Collection; 10 11 import java.util.HashMap; 11 12 import java.util.LinkedList; … … 93 94 * @return generated event sequences 94 95 */ 95 public List<List<WebEvent>> getSequences() {96 public Collection<List<WebEvent>> getSequences() { 96 97 return sequences; 97 98 } -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/LogParser.java
r198 r203 8 8 import java.io.UnsupportedEncodingException; 9 9 import java.security.InvalidParameterException; 10 import java.util.Collection; 10 11 import java.util.LinkedList; 11 12 import java.util.List; … … 71 72 * </p> 72 73 */ 73 private List<List<WindowsEvent>> sequences;74 private Collection<List<WindowsEvent>> sequences; 74 75 75 76 /** … … 127 128 * @return collection of event sequences 128 129 */ 129 public List<List<WindowsEvent>> getSequences() {130 public Collection<List<WindowsEvent>> getSequences() { 130 131 return sequences; 131 132 } -
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/commands/CMDparseXML.java
r198 r203 2 2 3 3 import java.security.InvalidParameterException; 4 import java.util.Collection; 4 5 import java.util.List; 5 6 … … 58 59 parser.parseFile(filename); 59 60 60 List<List<WindowsEvent>> sequences = parser.getSequences();61 Collection<List<WindowsEvent>> sequences = parser.getSequences(); 61 62 62 63 if (GlobalDataContainer.getInstance().addData(sequencesName, sequences)) {
Note: See TracChangeset
for help on using the changeset viewer.