Package net.morimekta.diff
Class DiffOptions
- java.lang.Object
-
- net.morimekta.diff.DiffOptions
-
public class DiffOptions extends java.lang.ObjectOptions for diff.
-
-
Constructor Summary
Constructors Constructor Description DiffOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DiffOptionsdefaults()Get the default diff options.booleangetCheckLines()java.time.ClockgetClock()intgetEditCost()doublegetTimeout()DiffOptionswithCheckLines(boolean checkLines)Set the option to check line-line diff before inter-line diffs.DiffOptionswithClock(java.time.Clock clock)Use the clock instance when calculating deadline oversteps.DiffOptionswithEditCost(int editCost)Set the cost of an empty edit operation in terms of edit charactersDiffOptionswithTimeout(double timeout)Set the number of seconds to map a diff before giving up (0 for infinity).
-
-
-
Method Detail
-
defaults
public static DiffOptions defaults()
Get the default diff options.- Returns:
- The doff options.
-
withTimeout
public DiffOptions withTimeout(double timeout)
Set the number of seconds to map a diff before giving up (0 for infinity).- Parameters:
timeout- The number of seconds.- Returns:
- The options.
-
withEditCost
public DiffOptions withEditCost(int editCost)
Set the cost of an empty edit operation in terms of edit characters- Parameters:
editCost- The cost value.- Returns:
- The options.
-
withCheckLines
public DiffOptions withCheckLines(boolean checkLines)
Set the option to check line-line diff before inter-line diffs. The two modes of diffing has different overall cost, so may save a significant time when diffing, but may produce a non-optimal diff in some circumstances.- Parameters:
checkLines- If we should check line-diff.- Returns:
- The options.
- See Also:
DiffBase.lineMode(String, String)
-
withClock
public DiffOptions withClock(java.time.Clock clock)
Use the clock instance when calculating deadline oversteps.- Parameters:
clock- The clock to use.- Returns:
- The options.
-
getTimeout
public double getTimeout()
- Returns:
- Number of seconds to map a diff before giving up (0 for infinity).
-
getEditCost
public int getEditCost()
- Returns:
- Cost of an empty edit operation in terms of edit characters.
-
getCheckLines
public boolean getCheckLines()
- Returns:
- If the diff should first check line-by-line changes.
-
getClock
public java.time.Clock getClock()
- Returns:
- The system clock used.
-
-