daikon.tools
Class DtracePartitioner

Object
  extended by DtracePartitioner
All Implemented Interfaces:
Iterator<String>, Partitioner<String,String>

public class DtracePartitioner
extends Object
implements Partitioner<String,String>, Iterator<String>

This class partitions Daikon trace files so that invocations of the same program point are grouped together for use with random selection.


Constructor Summary
DtracePartitioner(String filename)
           
 
Method Summary
 String assignToBucket(String invocation)
          Returns the program point name given by the input invocation.
 boolean hasNext()
           
 String next()
           
 List<String> patchValues(List<String> enters)
          Same as (List, boolean) with second arg=false.
 List<String> patchValues(List<String> enters, boolean includeUnreturnedEnters)
          Finds the exits that correspond to Enters.
 void remove()
          Not implemented, because this class does not modify the underlying trace file.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DtracePartitioner

public DtracePartitioner(String filename)
Parameters:
filename - The Daikon trace file to be partitioned
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<String>

remove

public void remove()
Not implemented, because this class does not modify the underlying trace file.

Specified by:
remove in interface Iterator<String>

next

public String next()
Specified by:
next in interface Iterator<String>

assignToBucket

public String assignToBucket(String invocation)
Returns the program point name given by the input invocation.

Specified by:
assignToBucket in interface Partitioner<String,String>

patchValues

public List<String> patchValues(List<String> enters)
Same as (List, boolean) with second arg=false.


patchValues

public List<String> patchValues(List<String> enters,
                                boolean includeUnreturnedEnters)
Finds the exits that correspond to Enters.
Modifies: none
Returns: An ArrayList containing all of the elements of 'enters'
@param includeUnreturnedEnters ensures that any ENTER ppt invocations will definitely have a corresponding EXIT ppt invocation following them.

The original order is NOT guaranteed.