ddiff
Version 1.0.0

com.ehsbe.ddiff
Class Analyzer

java.lang.Object
  extended by com.ehsbe.ddiff.Analyzer

public class Analyzer
extends Object

Version:
$Revision: 395 $
Author:
Jens Elkner

Nested Class Summary
Modifier and Type Class and Description
static class Analyzer.Option
          Options, which have an influence, how directories are scanned and the output gets formatted.
 
Field Summary
Modifier and Type Field and Description
static char default_format_sep
          the default field separator for parsable output
 
Constructor Summary
Constructor and Description
Analyzer()
          Initialize with default values.
Analyzer(char separator, EnumSet<Analyzer.Option> options, PathFilter excludes)
          Create a new analyzer instance with the given parameters.
 
Method Summary
Modifier and Type Method and Description
 void compare(java.nio.file.Path left, java.nio.file.Path right, PrintStream out)
          Compare the given directories side by side and print results to the given output stream.
 PathFilter getFilter()
          Get the current filter in use.
 String getFormat()
          Get the format string used for diff printouts.
 Worker getWorker(java.nio.file.Path left, java.nio.file.Path right, PrintStream out)
          Get the worker for compare the given directories side by side, which prints the results to the given output stream.
 boolean isEnabled(Analyzer.Option option)
          Check, whether the given option is set for this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

default_format_sep

public static char default_format_sep
the default field separator for parsable output

Constructor Detail

Analyzer

public Analyzer()
Initialize with default values.


Analyzer

public Analyzer(char separator,
                EnumSet<Analyzer.Option> options,
                PathFilter excludes)
Create a new analyzer instance with the given parameters.

Parameters:
separator - field separator to use for parsable output.
options - options to use for scanning and output formatting. Ignored if null
excludes - filter to use to determine dir entries, which should be ignored. if null nothing gets ignored.
Method Detail

isEnabled

public boolean isEnabled(Analyzer.Option option)
Check, whether the given option is set for this instance.

Parameters:
option - option to check.
Returns:
true if enabled.

getFormat

public String getFormat()
Get the format string used for diff printouts.

Returns:
the output formatused by this instance.

getFilter

public PathFilter getFilter()
Get the current filter in use.

Returns:
the filter used for scanning directories.

compare

public void compare(java.nio.file.Path left,
                    java.nio.file.Path right,
                    PrintStream out)
             throws IOException
Compare the given directories side by side and print results to the given output stream.

Parameters:
left - base directory to use for diffing
right - second directory to use for diffing
out - where to print results. Will be not closed, when finished.
Throws:
IOException

getWorker

public Worker getWorker(java.nio.file.Path left,
                        java.nio.file.Path right,
                        PrintStream out)
                 throws IOException
Get the worker for compare the given directories side by side, which prints the results to the given output stream.

Parameters:
left - base directory to use for diffing
right - second directory to use for diffing
out - where to print results. Will be not closed, when finished.
Returns:
a worker, which needs to be started
Throws:
IOException

ddiff
Version 1.0.0

Created by Jens Elkner