Package org.zkoss.zul
Class ArrayComparator<E>
- java.lang.Object
-
- org.zkoss.zul.ArrayComparator<E>
-
- All Implemented Interfaces:
java.io.Serializable,java.util.Comparator<E>
public class ArrayComparator<E> extends java.lang.Object implements java.util.Comparator<E>, java.io.SerializableCompares the specified element of the array. It assumes the data passed tocompare(E, E)is an array, and it compares the n-th element, where n is passed in the constructor,ArrayComparator(int, boolean)(the index parameter). It also assumes the element must implementComparable.- Since:
- 5.0.6
- Author:
- tomyeh
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ArrayComparator(int index, boolean ascending)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(E o1, E o2)booleanequals(java.lang.Object o)intgetIndex()Returns the index of the element.inthashCode()booleanisAscending()Returns whether the sorting is ascending.
-
-
-
Method Detail
-
getIndex
public int getIndex()
Returns the index of the element.
-
isAscending
public boolean isAscending()
Returns whether the sorting is ascending.
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin interfacejava.util.Comparator<E>- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-