|
|
@ -121,13 +121,18 @@ public class Edit { |
|
|
|
|
|
|
|
|
|
|
|
/** @return the type of this region */ |
|
|
|
/** @return the type of this region */ |
|
|
|
public final Type getType() { |
|
|
|
public final Type getType() { |
|
|
|
if (beginA == endA && beginB < endB) |
|
|
|
if (beginA < endA) { |
|
|
|
return Type.INSERT; |
|
|
|
if (beginB < endB) |
|
|
|
if (beginA < endA && beginB == endB) |
|
|
|
return Type.REPLACE; |
|
|
|
return Type.DELETE; |
|
|
|
else /* if (beginB == endB) */ |
|
|
|
if (beginA == endA && beginB == endB) |
|
|
|
return Type.DELETE; |
|
|
|
return Type.EMPTY; |
|
|
|
|
|
|
|
return Type.REPLACE; |
|
|
|
} else /* if (beginA == endA) */{ |
|
|
|
|
|
|
|
if (beginB < endB) |
|
|
|
|
|
|
|
return Type.INSERT; |
|
|
|
|
|
|
|
else /* if (beginB == endB) */ |
|
|
|
|
|
|
|
return Type.EMPTY; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** @return true if the edit is empty (lengths of both a and b is zero). */ |
|
|
|
/** @return true if the edit is empty (lengths of both a and b is zero). */ |
|
|
|