ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.app
Class CallTraceSorter

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.app.CallTraceSorter

public class CallTraceSorter
extends Object

Reads a call trace produced by a call center simulator using simulation parameters from an instance of SimParams, sorts the calls by increasing arrival time, and writes the sorted trace into a file.


Nested Class Summary
static class CallTraceSorter.TracedCall
          Represents a call that has been traced.
 
Constructor Summary
CallTraceSorter()
           
 
Method Summary
static void main(String[] args)
          Main method taking as arguments the name of an input trace file and the name of an output file.
static SortedSet<CallTraceSorter.TracedCall> readTrace(Reader reader)
          For each line read from reader, creates an object representing a traced call, puts the objects in a sorted set, and returns that set.
static void writeTrace(Writer writer, Collection<? extends CallTraceSorter.TracedCall> calls, int timePrecision)
          For each traced call in the collection calls, writes one line on writer by using CallTraceSorter.TracedCall.toString().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallTraceSorter

public CallTraceSorter()
Method Detail

readTrace

public static SortedSet<CallTraceSorter.TracedCall> readTrace(Reader reader)
                                                       throws IOException
For each line read from reader, creates an object representing a traced call, puts the objects in a sorted set, and returns that set.

Parameters:
reader - the reader to obtain the trace from.
Returns:
the read and sorted trace.
Throws:
IOException - if an I/O error occurs.

writeTrace

public static void writeTrace(Writer writer,
                              Collection<? extends CallTraceSorter.TracedCall> calls,
                              int timePrecision)
                       throws IOException
For each traced call in the collection calls, writes one line on writer by using CallTraceSorter.TracedCall.toString().

Parameters:
writer - the output writer.
calls - the traced calls to write.
timePrecision - the number of decimal digits of precision for time durations.
Throws:
IOException - if an I/O error occurs.

main

public static void main(String[] args)
                 throws IOException
Main method taking as arguments the name of an input trace file and the name of an output file.

Parameters:
args - the command-line arguments.
Throws:
IOException - if an I/O error occurs.

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.