Class CBLFieldUtility

java.lang.Object
com.softwaremining.util.CBLFieldUtility

public class CBLFieldUtility extends Object
utilities used internally by SoftwareMining framework
  • Field Details

    • log

      protected static transient Log log
    • totalRuntime_including_getFillStr

      public static long totalRuntime_including_getFillStr
      for internal use only ... profiling information
  • Constructor Details

    • CBLFieldUtility

      public CBLFieldUtility()
  • Method Details

    • toPrimitives

      public static final ISMObject[] toPrimitives(ISMObject field)
      Convert a CBLGroup to its primitive FieldPrimitives: ie CBLString, CBLInteger, .... Fields of any Subgroups will also be included.
      Parameters:
      field -
      Returns:
    • toPrimitives

      public static final ISMObject[] toPrimitives(ISMObject theFieldOrGroup, ISMObject[] existingItems)
      Add an primitive fields from theFieldOrGroup to the list of existingItems
      Returns:
    • toPrimitives

      public static final ISMObject[] toPrimitives(ISMObject[] fields)
      Convert a CBLGroup to its primitive FieldPrimitives: ie CBLString, CBLInteger, .... Fields of any Subgroups will also be included.
      Returns:
    • getDelegateKeys

      public static final ISMObject[] getDelegateKeys(ISMObject[] fields, ISQLWrapper delegateClass)
    • collectPrimitives

      public static final void collectPrimitives(ArrayList<ISMObject> storage, ISMObject field)
      add "field" parameter to the arrayList (storage.add(field)) ... but if "field" was a group, then add the "fields" within the group
      Parameters:
      storage -
      field -
    • compare

      public static final int compare(ISMObject field1, ISMObject field2)
      method used in 88 variable comparisons
      Parameters:
      field1 -
      field2 -
      Returns:
      result is same as java "compareTo" method on the fields.
    • compare

      public static final int compare(ISMObject field1, double double2)
    • compare

      public static final int compare(ISMObject field1, BigDecimal double2)
    • compare

      public static final int compare(ISMObject field1, int int2)
    • compare

      public static final int compare(double double1, double double2)
    • compare

      public static final int compare(ISMObject field1, char c)
    • compare

      public static final int compare(String s1, char c)
    • compare

      public static final int compare(String s1, String s2)
      Makes sure that the strings have equal padding, then uses Java compareTo Method: A String is less than another if it comes before the other in dictionary order.
      Parameters:
      s1 - - comparison string-1
      s2 - - comparison string-1
      Returns:
    • compare

      public static final int compare(ISMObject field1, String string2)
    • compare

      public static final int compare(CBLBean wrapper, String string2)
    • compare

      public static final int compare(String string1, ISMObject field2)
    • isNumber

      public static final boolean isNumber(String inputString, boolean decmialsAreAccepted)
      check that the string contains only INTEGER values or a decimal point This means that the value "1234E12" is NOT a Number
      NOTE The method is used for validation of stringified FIELDS (ie produced by retrieveAsString()). Therefore, the inputString will NOT be in scientific notation.
      Parameters:
      inputString - -
      Returns:
      - true if inputString contains only digits or decimal point (not scientific notation 'E').
    • equals

      public static final boolean equals(String value, String value1)
      Test for Equality
    • isGreaterThan

      public static final boolean isGreaterThan(String value, String value1)
      compare values of this field with the target field
      Parameters:
      value -
      Returns:
    • isGreaterOrEqualTo

      public static final boolean isGreaterOrEqualTo(String value, String value1)
      compare values of this field with the target field
      Parameters:
      value -
      Returns:
    • isLessThan

      public static final boolean isLessThan(String value, String value1)
      compare values of this field with the target field
      Parameters:
      value -
      Returns:
    • isLessOrEqualTo

      public static final boolean isLessOrEqualTo(String value, String value1)
      compare values of this field with the target field
      Parameters:
      value -
      Returns:
    • trimRight

      public static final String trimRight(String inputString)
      right trim the string ... used in comparisons such as EQUALS or IS GREATER THAN
      Parameters:
      inputString -
      Returns: