| java.lang.Object com.flexive.shared.FxArrayUtils
FxArrayUtils | public class FxArrayUtils (Code) | | Utility functions for arrays.
author: Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at) version: $Rev: 181 $ |
Method Summary | |
public static int[] | addElement(int[] list, int element) Adds a element to the end of the array, if it is not already contained. | public static long[] | addElement(long[] list, long element) Adds a element to the end of the array, if it is not already contained. | public static T[] | addElement(T[] list, T element, boolean unique) Adds a element to the end of the array. | public static T[] | addElement(T[] list, T element) Adds a element to the end of the array. | public static int[] | addElements(int[] list, int[] elements) Adds every element in a list to the end of the array, if it is not already contained. | public static T[] | clone(T[] array) | public static boolean | containsElement(int[] list, int element) Return true if the list contains the given element. | public static boolean | containsElement(SelectableObject[] list, SelectableObject element) Return true if the list contains the given element. | public static boolean | containsElement(byte[] list, byte element) Return true if the list contains the given element. | public static boolean | containsElement(String[] list, String element, boolean ignoreCase) Return true if the list contains the given element. | public static boolean | containsElement(long[] list, long element) Return true if the list contains the given element. | public static int | indexOf(String[] list, String element, boolean ignoreCase) Returns the first occurence of the given element. | public static int[] | removeDuplicates(int[] list) Removes dupicated entries from the list. | public static long[] | removeDuplicates(long[] list) Removes dupicated entries from the list. | public static int[] | removeElementFromList(int[] list, int element) Removes the given element from the list. | public static int[] | removeElementsFromList(int[] list, int elements) Removes the given elements from the list. | public static String[] | toArray(String list, char separator) Converts a list with items separated by a specific delimeter to a array. | public static int[] | toIntArray(String list, char separator) Converts a list with integer items separated by a specific delimeter to a array. | public static int[] | toIntArray(Integer list) | public static long[] | toLongArray(String list, char separator) Converts a list with long items separated by a specific delimeter to a array. | public static String | toSeparatedList(SelectableObjectWithLabel[] values, char separator) Converts a SelectableObjectWithLabel array to a string list containing the id's. | public static String | toSeparatedList(int[] values, char separator) Converts a int array to a string list. | public static String | toSeparatedList(byte[] values, char separator) Converts a byte array to a string list. | public static String | toSeparatedList(long[] values, char separator) Converts a long array to a string list. | public static String | toSeparatedList(List elements, String delim) Join a list of elements using the given delimiter. | public static String | toSeparatedList(String[] elements, String delim) Join an array of elements using the given delimiter. |
addElement | public static int[] addElement(int[] list, int element)(Code) | | Adds a element to the end of the array, if it is not already contained.
Parameters: list - original list Parameters: element - the element to add the new list |
addElement | public static long[] addElement(long[] list, long element)(Code) | | Adds a element to the end of the array, if it is not already contained.
Parameters: list - original list Parameters: element - the element to add the new list |
addElement | public static T[] addElement(T[] list, T element, boolean unique)(Code) | | Adds a element to the end of the array.
Parameters: list - original list Parameters: element - the element to add Parameters: unique - true if the element should only be added if it is not already contained the new list |
addElement | public static T[] addElement(T[] list, T element)(Code) | | Adds a element to the end of the array.
Parameters: list - original list Parameters: element - the element to add the new list |
addElements | public static int[] addElements(int[] list, int[] elements)(Code) | | Adds every element in a list to the end of the array, if it is not already contained.
Parameters: elements - the elements to add Parameters: list - the list to add the element to the new list |
clone | public static T[] clone(T[] array)(Code) | | Generic shallow array clone function (until commons ArrayUtils is generified)
< Parameters: T - > array type Parameters: array - the array to be cloned (shallow copy) the cloned array (shallow copy) |
containsElement | public static boolean containsElement(int[] list, int element)(Code) | | Return true if the list contains the given element.
Parameters: list - the list Parameters: element - the element to look for true if the list contains the given element |
containsElement | public static boolean containsElement(SelectableObject[] list, SelectableObject element)(Code) | | Return true if the list contains the given element.
Parameters: list - the list Parameters: element - the element to look for true if the list contains the given element |
containsElement | public static boolean containsElement(byte[] list, byte element)(Code) | | Return true if the list contains the given element.
Parameters: list - the list Parameters: element - the element to look for true if the list contains the given element |
containsElement | public static boolean containsElement(String[] list, String element, boolean ignoreCase)(Code) | | Return true if the list contains the given element.
Parameters: list - the list Parameters: element - the element to look for Parameters: ignoreCase - if set to false the compare is done case sensitive true if the list contains the given element |
containsElement | public static boolean containsElement(long[] list, long element)(Code) | | Return true if the list contains the given element.
Parameters: list - the list Parameters: element - the element to look for true if the list contains the given element |
indexOf | public static int indexOf(String[] list, String element, boolean ignoreCase)(Code) | | Returns the first occurence of the given element.
Parameters: list - the list Parameters: element - the element to look for Parameters: ignoreCase - if set to false the compare is done case sensitive true the first position, or -1 if the element was not found |
removeDuplicates | public static int[] removeDuplicates(int[] list)(Code) | | Removes dupicated entries from the list.
Parameters: list - the list the list without any duplicated entries |
removeDuplicates | public static long[] removeDuplicates(long[] list)(Code) | | Removes dupicated entries from the list.
Parameters: list - the list the list without any duplicated entries |
removeElementFromList | public static int[] removeElementFromList(int[] list, int element)(Code) | | Removes the given element from the list.
Parameters: list - the list the element should be removed from Parameters: element - the element to remove the list without the given element |
removeElementsFromList | public static int[] removeElementsFromList(int[] list, int elements)(Code) | | Removes the given elements from the list.
Parameters: list - the list the element should be removed from Parameters: elements - the elements to remove the list without the given element |
toArray | public static String[] toArray(String list, char separator)(Code) | | Converts a list with items separated by a specific delimeter to a array.
A empty array will be returned if the list is null or a empty string.
Parameters: list - the list Parameters: separator - the separator character the array |
toIntArray | public static int[] toIntArray(String list, char separator) throws FxInvalidParameterException(Code) | | Converts a list with integer items separated by a specific delimeter to a array.
A empty array will be returned if the list is null or a empty string.
Parameters: list - the list Parameters: separator - the separator character the array throws: FxInvalidParameterException - if the list can not be converted, the exception's getParameterName()function will return the token that caused the exception |
toLongArray | public static long[] toLongArray(String list, char separator) throws FxInvalidParameterException(Code) | | Converts a list with long items separated by a specific delimeter to a array.
A empty array will be returned if the list is null or a empty string.
Parameters: list - the list Parameters: separator - the separator character the array throws: FxInvalidParameterException - if the list can not be converted, the exception's getParameterName()function will return the token that caused the exception |
toSeparatedList | public static String toSeparatedList(SelectableObjectWithLabel[] values, char separator)(Code) | | Converts a SelectableObjectWithLabel array to a string list containing the id's.
Parameters: values - the array Parameters: separator - the separator to use between the id's the array as string list |
toSeparatedList | public static String toSeparatedList(int[] values, char separator)(Code) | | Converts a int array to a string list.
Parameters: values - the array Parameters: separator - the separator to use between the numbers the array as string list |
toSeparatedList | public static String toSeparatedList(byte[] values, char separator)(Code) | | Converts a byte array to a string list.
Parameters: values - the array Parameters: separator - the separator to use between the numbers the array as string list |
toSeparatedList | public static String toSeparatedList(long[] values, char separator)(Code) | | Converts a long array to a string list.
Parameters: values - the array Parameters: separator - the separator to use between the numbers the array as string list |
toSeparatedList | public static String toSeparatedList(List elements, String delim)(Code) | | Join a list of elements using the given delimiter.
Parameters: elements - Elements to be joined Parameters: delim - Delimiter between elements Joined string |
toSeparatedList | public static String toSeparatedList(String[] elements, String delim)(Code) | | Join an array of elements using the given delimiter.
Parameters: elements - Elements to be joined Parameters: delim - Delimiter between elements Joined string |
|
|