Class CIMElementSorter
java.lang.Object
org.sblim.cimclient.internal.cim.CIMElementSorter
- All Implemented Interfaces:
Comparator<Object>
Class CIMElementSorter can sort CIMElement arrays and can do binary search by
name in them.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintstatic CIMElementfind(CIMElement[] pArray, String pName) Finds CIMElement, named pName, in pArray which must be a sorted array of CIMElements.static intfindIdx(CIMElement[] pArray, String pName) Finds the index of CIMElement, named pName, in pArray which must be a sorted array of CIMElements.static CIMElement[]sort(CIMElement[] pArray) Sorts the passed CIMElement array, the passed array is not copied.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
CIMElementSorter
public CIMElementSorter()
-
-
Method Details
-
sort
Sorts the passed CIMElement array, the passed array is not copied.- Parameters:
pArray- the array which will be sorted if it's not null- Returns:
- pArray
-
find
Finds CIMElement, named pName, in pArray which must be a sorted array of CIMElements.- Parameters:
pArray-pName-- Returns:
- the CIMElement if found, otherwise null
-
findIdx
Finds the index of CIMElement, named pName, in pArray which must be a sorted array of CIMElements.- Parameters:
pArray-pName-- Returns:
- the index, just like in case of Arrays.binarySearch()
- See Also:
-
compare
- Specified by:
comparein interfaceComparator<Object>- See Also:
-