Package com.irurueta.commons
Class EditDistance.GenericArrayWrapper<T>
- java.lang.Object
-
- com.irurueta.commons.EditDistance.GenericArrayWrapper<T>
-
- Type Parameters:
T
- generic data type.
- All Implemented Interfaces:
EditDistance.ArrayWrapper<T[]>
- Enclosing class:
- EditDistance
protected static class EditDistance.GenericArrayWrapper<T> extends java.lang.Object implements EditDistance.ArrayWrapper<T[]>
Implementation of ArrayWrapper for generic objects of type T. Allows the efficient and generic comparison of objects of type T, as long as T is not a primitive data type.
-
-
Constructor Summary
Constructors Constructor Description GenericArrayWrapper(T[] object)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(EditDistance.ArrayWrapper<T[]> other, int posX, int posY)
Compares the array contained in this instance at position X with the array contained in the other array wrapper at position Y.int
length()
Length of array to be compared.
-
-
-
Field Detail
-
mObject
private final T[] mObject
Generic array of type T to be compared.
-
-
Constructor Detail
-
GenericArrayWrapper
public GenericArrayWrapper(T[] object)
Constructor.- Parameters:
object
- generic array of type T to be compared.
-
-
Method Detail
-
length
public int length()
Length of array to be compared.- Specified by:
length
in interfaceEditDistance.ArrayWrapper<T>
- Returns:
- length of array.
-
equals
public boolean equals(EditDistance.ArrayWrapper<T[]> other, int posX, int posY)
Compares the array contained in this instance at position X with the array contained in the other array wrapper at position Y.- Specified by:
equals
in interfaceEditDistance.ArrayWrapper<T>
- Parameters:
other
- the other generic array wrapper.posX
- position in this array to be compared.posY
- position in the other array to be compared.- Returns:
- true if elements in both arrays at provided positions are considered to be equal, false otherwise.
-
-