Class CIMElementSorter

java.lang.Object
org.sblim.cimclient.internal.cim.CIMElementSorter
All Implemented Interfaces:
Comparator<Object>

public class CIMElementSorter extends Object implements Comparator<Object>
Class CIMElementSorter can sort CIMElement arrays and can do binary search by name in them.
  • Constructor Details

    • CIMElementSorter

      public CIMElementSorter()
  • Method Details

    • sort

      public static CIMElement[] sort(CIMElement[] pArray)
      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

      public static CIMElement find(CIMElement[] pArray, String pName)
      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

      public static int findIdx(CIMElement[] pArray, String pName)
      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

      public int compare(Object pObj0, Object pObj1)
      Specified by:
      compare in interface Comparator<Object>
      See Also: