com.planet_ink.coffee_mud.core
Class CMStrings.Diff

java.lang.Object
  extended by com.planet_ink.coffee_mud.core.CMStrings.Diff
Enclosing class:
CMStrings

public static class CMStrings.Diff
extends java.lang.Object

Class representing one diff operation.


Field Summary
 CMStrings.DiffOperation operation
          One of: INSERT, DELETE or EQUAL.
 java.lang.String text
          The text associated with this diff operation.
 
Constructor Summary
CMStrings.Diff(CMStrings.DiffOperation operation, java.lang.String text)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Is this Diff equivalent to another Diff?
 int hashCode()
          Create a numeric hash value for a Diff.
 java.lang.String toString()
          Display a human-readable version of this Diff.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

operation

public CMStrings.DiffOperation operation
One of: INSERT, DELETE or EQUAL.


text

public java.lang.String text
The text associated with this diff operation.

Constructor Detail

CMStrings.Diff

public CMStrings.Diff(CMStrings.DiffOperation operation,
                      java.lang.String text)
Constructor. Initializes the diff with the provided values.

Parameters:
operation - One of INSERT, DELETE or EQUAL.
text - The text being applied.
Method Detail

toString

public java.lang.String toString()
Display a human-readable version of this Diff.

Overrides:
toString in class java.lang.Object
Returns:
text version.

hashCode

public int hashCode()
Create a numeric hash value for a Diff. This function is not used by DMP.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash value.

equals

public boolean equals(java.lang.Object obj)
Is this Diff equivalent to another Diff?

Overrides:
equals in class java.lang.Object
Parameters:
obj - Another Diff to compare against.
Returns:
true or false.