Package com.irurueta.commons
Class EditDistance.StringArrayWrapper
- java.lang.Object
-
- com.irurueta.commons.EditDistance.StringArrayWrapper
-
- All Implemented Interfaces:
EditDistance.ArrayWrapper<java.lang.String>
- Enclosing class:
- EditDistance
protected static class EditDistance.StringArrayWrapper extends java.lang.Object implements EditDistance.ArrayWrapper<java.lang.String>
Specific implementation of ArrayWrapper for Strings. Allows efficient comparison of String elements in a generic way.- Author:
- Alberto Irurueta Carro
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringmObjectString to be compared.
-
Constructor Summary
Constructors Constructor Description StringArrayWrapper(java.lang.String object)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(EditDistance.ArrayWrapper<java.lang.String> other, int posX, int posY)Compares the string contained in this instance at position x with the string contained in the other array wrapper at position y.intlength()Length of the string to be compared.
-
-
-
Method Detail
-
length
public int length()
Length of the string to be compared.- Specified by:
lengthin interfaceEditDistance.ArrayWrapper<java.lang.String>- Returns:
- length of array.
-
equals
public boolean equals(EditDistance.ArrayWrapper<java.lang.String> other, int posX, int posY)
Compares the string contained in this instance at position x with the string contained in the other array wrapper at position y.- Specified by:
equalsin interfaceEditDistance.ArrayWrapper<java.lang.String>- Parameters:
other- the other String array wrapper.posX- position in this array to be compared.posY- position in the other array to be compared.- Returns:
- true if elements in provided positions are considered to be equal, false otherwise.
-
-