ur_rna.Utilities

## Class ObjTools

- java.lang.Object
- - ur_rna.Utilities.ObjTools

-     public abstract class ObjTools
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ObjTools.RefBool` Use to make up for the lack of pass-by-reference in Java
    `static class` | `ObjTools.RefInt` Use to make up for the lack of pass-by-reference in Java
    `static class` | `ObjTools.RefStr` Use to make up for the lack of pass-by-reference in Java

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.lang.reflect.Method` | `cloneMethod`
    `static boolean[]` | `EMPTY_BOOL_ARRAY`
    `static int[]` | `EMPTY_INT_ARRAY`
    `static java.lang.Object[]` | `EMPTY_OBJECT_ARRAY`
    `static java.lang.String[]` | `EMPTY_STRING_ARRAY`
    `static java.lang.Object` | `MISSING` An object that can be used to represent a missing value.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `private` | `ObjTools()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> boolean` | `all(java.lang.Iterable<T> items, java.util.function.Predicate<T> test)` Returns true if the test function returns true for all of the items in the iterable.
    `static <T> boolean` | `any(java.lang.Iterable<T> items, java.util.function.Predicate<T> test)` Returns true if the test function returns true for any of the items in the iterable.
    `static boolean` | `asBool(java.lang.Object obj)` If obj is a boolean, its value is returned.
    `static <T> boolean` | `contains(T[] subject, java.util.function.Predicate<T> test)`
    `static <T> boolean` | `contains(T[] subject, T find)`
    `static <T> void` | `copyTo(java.util.Collection<? extends T> list, T[] arr)` Copies from the collection to the array
    `static <T> void` | `copyTo(java.util.Collection<? extends T> list, T[] arr, int start)` Copies from the collection to the array.
    `static <T> void` | `copyTo(java.util.Collection<? extends T> list, T[] arr, int start, int length)` Copies the specified number of elements from the collection to the array.
    `static <T> void` | `copyTo(java.util.List<? extends T> list, T[] arr)` Copies from the list to the array
    `static <T> void` | `copyTo(java.util.List<? extends T> list, T[] arr, int start)` Copies from the list to the array.
    `static <T> void` | `copyTo(java.util.List<? extends T> list, T[] arr, int start, int length)` Copies the specified number of elements from the list to the array.
    `static <T> T` | `first(java.lang.Iterable<T> list)`
    `static <T> T` | `first(java.lang.Iterable<T> list, T valueIfEmpty)`
    `static <T> T` | `firstOfType(java.lang.Object[] arr, java.lang.Class<T> type)`
    `private static java.lang.reflect.Method` | `getCloneMethod()`
    `static int` | `indexOf(java.lang.String[] subject, java.lang.String find)`
    `static int` | `indexOf(java.lang.String[] subject, java.lang.String find, boolean ignoreCase)`
    `static <T> int` | `indexOf(T[] subject, java.util.function.Predicate<T> test)`
    `static <T> int` | `indexOf(T[] subject, T find)`
    `static boolean` | `isAnySet(int flagToFind, int valueToSearch)`
    `static boolean` | `isSet(int flagToFind, int valueToSearch)`
    `static <T,T2> java.util.List<T2>` | `mapList(java.util.Collection<T> src, java.util.function.Function<T,T2> converter)`
    `static <T,T2> java.util.List<T2>` | `mapList(java.util.Collection<T> src, java.util.List<T2> dest, java.util.function.Function<? super T,? extends T2> converter)`
    `static <K,V,K2,V2> java.util.Map<K2,V2>` | `mapMap(java.util.Map<K,V> src, java.util.function.Function<? super K,? extends K2> keyMap, java.util.function.Function<? super V,? extends V2> valueMap)`
    `static <K,V,K2,V2> java.util.Map<K2,V2>` | `mapMap(java.util.Map<K,V> src, java.util.Map<K2,V2> dest, java.util.function.Function<? super K,? extends K2> keyMap, java.util.function.Function<? super V,? extends V2> valueMap)`
    `static <K,V,K2,V2> java.util.Map<K2,V2>` | `mapMapEntries(java.util.Map<K,V> src, java.util.function.Function<? super java.util.Map.Entry<K,V>,? extends K2> keyMap, java.util.function.Function<? super java.util.Map.Entry<K,V>,? extends V2> valueMap)`
    `static <K,V,K2,V2> java.util.Map<K2,V2>` | `mapMapEntries(java.util.Map<K,V> src, java.util.Map<K2,V2> dest, java.util.function.Function<? super java.util.Map.Entry<K,V>,? extends K2> keyMap, java.util.function.Function<? super java.util.Map.Entry<K,V>,? extends V2> valueMap)`
    `static <T> int` | `max(T[] values, java.util.function.ToIntFunction<T> eval)`
    `static <T> T` | `maxOf(T[] values, java.util.function.ToIntFunction<T> eval)`
    `static <T> int` | `min(T[] values, java.util.function.ToIntFunction<T> eval)`
    `static <T> T` | `minOf(T[] values, java.util.function.ToIntFunction<T> eval)`
    `static <T> java.util.ArrayList<T>` | `safeClone(java.util.ArrayList<T> list)`
    `static <T> T` | `safeClone(T obj)`
    `static java.lang.String` | `toDisplayString(java.lang.Object value)`
    `static java.util.List<java.lang.Double>` | `toList(double[] arr)`
    `static java.util.List<java.lang.Float>` | `toList(float[] arr)`
    `static java.util.List<java.lang.Integer>` | `toList(int[] arr)`
    `static <K,V> java.util.Map<K,V>` | `toMap(K[] keys, V[] values)`
    `static java.lang.Double[]` | `toObjArr(double[] arr)`
    `static java.lang.Float[]` | `toObjArr(float[] arr)`
    `static java.lang.Integer[]` | `toObjArr(int[] arr)`
    `static java.lang.String` | `toStr(java.lang.Object value)`
    `static java.lang.String` | `toStr(java.lang.Object value, java.lang.String nullValue)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### cloneMethod

          private static java.lang.reflect.Method cloneMethod

    - #### EMPTY_BOOL_ARRAY

          public static final boolean[] EMPTY_BOOL_ARRAY

    - #### EMPTY_INT_ARRAY

          public static final int[] EMPTY_INT_ARRAY

    - #### EMPTY_OBJECT_ARRAY

          public static final java.lang.Object[] EMPTY_OBJECT_ARRAY

    - #### EMPTY_STRING_ARRAY

          public static final java.lang.String[] EMPTY_STRING_ARRAY

    - #### MISSING

          public static java.lang.Object MISSING

      An object that can be used to represent a missing value. For example, a Map's get(key) function will return null under either of two circumstances: (1) the key was not found or (2) the key was associated with a null value. Instead of using null as an ambiguous result, MISSING can be returned in the case of the missing key in such circumstances.

  - ### Constructor Detail

    - #### ObjTools

          private ObjTools()

  - ### Method Detail

    - #### all

          public static <T> boolean all(java.lang.Iterable<T> items,
                                        java.util.function.Predicate<T> test)

      Returns true if the test function returns true for all of the items in the iterable.

    - #### any

          public static <T> boolean any(java.lang.Iterable<T> items,
                                        java.util.function.Predicate<T> test)

      Returns true if the test function returns true for any of the items in the iterable.

    - #### asBool

          public static boolean asBool(java.lang.Object obj)

      If obj is a boolean, its value is returned. If obj is null, an empty array, or a number, char or byte representing 0, the return value is False. If obj is a string, then it is evaluated as described in AsBool(string) Otherwise the return value is the the result of AsBool(string) applied to obj.ToString()

    - #### contains

          public static <T> boolean contains(T[] subject,
                                             java.util.function.Predicate<T> test)

    - #### contains

          public static <T> boolean contains(T[] subject,
                                             T find)

    - #### copyTo

          public static <T> void copyTo(java.util.Collection<? extends T> list,
                                        T[] arr)

      Copies from the collection to the array

    - #### copyTo

          public static <T> void copyTo(java.util.Collection<? extends T> list,
                                        T[] arr,
                                        int start)

      Copies from the collection to the array. The starting destination array index is specified by the `start` parameter.

    - #### copyTo

          public static <T> void copyTo(java.util.Collection<? extends T> list,
                                        T[] arr,
                                        int start,
                                        int length)

      Copies the specified number of elements from the collection to the array. The starting destination array index is specified by the `start` parameter.

    - #### copyTo

          public static <T> void copyTo(java.util.List<? extends T> list,
                                        T[] arr)

      Copies from the list to the array

    - #### copyTo

          public static <T> void copyTo(java.util.List<? extends T> list,
                                        T[] arr,
                                        int start)

      Copies from the list to the array. The starting destination array index is specified by the `start` parameter.

    - #### copyTo

          public static <T> void copyTo(java.util.List<? extends T> list,
                                        T[] arr,
                                        int start,
                                        int length)

      Copies the specified number of elements from the list to the array. The starting destination array index is specified by the `start` parameter.

    - #### first

          public static <T> T first(java.lang.Iterable<T> list)

    - #### first

          public static <T> T first(java.lang.Iterable<T> list,
                                    T valueIfEmpty)

    - #### firstOfType

          public static <T> T firstOfType(java.lang.Object[] arr,
                                          java.lang.Class<T> type)

    - #### getCloneMethod

          private static java.lang.reflect.Method getCloneMethod()

    - #### indexOf

          public static int indexOf(java.lang.String[] subject,
                                    java.lang.String find)

    - #### indexOf

          public static int indexOf(java.lang.String[] subject,
                                    java.lang.String find,
                                    boolean ignoreCase)

    - #### indexOf

          public static <T> int indexOf(T[] subject,
                                        java.util.function.Predicate<T> test)

    - #### indexOf

          public static <T> int indexOf(T[] subject,
                                        T find)

    - #### isAnySet

          public static boolean isAnySet(int flagToFind,
                                         int valueToSearch)

    - #### isSet

          public static boolean isSet(int flagToFind,
                                      int valueToSearch)

    - #### mapList

          public static <T,T2> java.util.List<T2> mapList(java.util.Collection<T> src,
                                                          java.util.function.Function<T,T2> converter)

    - #### mapList

          public static <T,T2> java.util.List<T2> mapList(java.util.Collection<T> src,
                                                          java.util.List<T2> dest,
                                                          java.util.function.Function<? super T,? extends T2> converter)

    - #### mapMap

          public static <K,V,K2,V2> java.util.Map<K2,V2> mapMap(java.util.Map<K,V> src,
                                                                java.util.function.Function<? super K,? extends K2> keyMap,
                                                                java.util.function.Function<? super V,? extends V2> valueMap)

    - #### mapMap

          public static <K,V,K2,V2> java.util.Map<K2,V2> mapMap(java.util.Map<K,V> src,
                                                                java.util.Map<K2,V2> dest,
                                                                java.util.function.Function<? super K,? extends K2> keyMap,
                                                                java.util.function.Function<? super V,? extends V2> valueMap)

    - #### mapMapEntries

          public static <K,V,K2,V2> java.util.Map<K2,V2> mapMapEntries(java.util.Map<K,V> src,
                                                                       java.util.function.Function<? super java.util.Map.Entry<K,V>,? extends K2> keyMap,
                                                                       java.util.function.Function<? super java.util.Map.Entry<K,V>,? extends V2> valueMap)

    - #### mapMapEntries

          public static <K,V,K2,V2> java.util.Map<K2,V2> mapMapEntries(java.util.Map<K,V> src,
                                                                       java.util.Map<K2,V2> dest,
                                                                       java.util.function.Function<? super java.util.Map.Entry<K,V>,? extends K2> keyMap,
                                                                       java.util.function.Function<? super java.util.Map.Entry<K,V>,? extends V2> valueMap)

    - #### max

          public static <T> int max(T[] values,
                                    java.util.function.ToIntFunction<T> eval)

    - #### maxOf

          public static <T> T maxOf(T[] values,
                                    java.util.function.ToIntFunction<T> eval)

    - #### min

          public static <T> int min(T[] values,
                                    java.util.function.ToIntFunction<T> eval)

    - #### minOf

          public static <T> T minOf(T[] values,
                                    java.util.function.ToIntFunction<T> eval)

    - #### safeClone

          public static <T> java.util.ArrayList<T> safeClone(java.util.ArrayList<T> list)

    - #### safeClone

          public static <T> T safeClone(T obj)

    - #### toDisplayString

          public static java.lang.String toDisplayString(java.lang.Object value)

    - #### toList

          public static java.util.List<java.lang.Double> toList(double[] arr)

    - #### toList

          public static java.util.List<java.lang.Float> toList(float[] arr)

    - #### toList

          public static java.util.List<java.lang.Integer> toList(int[] arr)

    - #### toMap

          public static <K,V> java.util.Map<K,V> toMap(K[] keys,
                                                       V[] values)

    - #### toObjArr

          public static java.lang.Double[] toObjArr(double[] arr)

    - #### toObjArr

          public static java.lang.Float[] toObjArr(float[] arr)

    - #### toObjArr

          public static java.lang.Integer[] toObjArr(int[] arr)

    - #### toStr

          public static java.lang.String toStr(java.lang.Object value)

    - #### toStr

          public static java.lang.String toStr(java.lang.Object value,
                                               java.lang.String nullValue)