Java Algorithm Library-Artery-Sample

■■■■ Java Algorithm Library -Artery- Sample ■■■■

I will introduce the usage & sample of the Java algorithm library Artery that I am developing. This article is the table of contents. Samples that have not been uploaded to Qiita are included in the vector download below.

A library for building algorithms, logic, and data structures in memory that frequently occur when programming with Java. You can replace complex and long code with simple and tested code.

Samples will be added one by one. However, it does not explain all the functions.

Artery also includes a unit test library. See here. Java Unit Test Library-Artery-Sample

The Artery library can be downloaded from the following. Vector ⇒ Programming ⇒ Java Language version202005 --2020/06/03 released

The Artery library can be used free of charge, including for commercial use.

Feature overview

Data structure construction class-Java standard class related (S00)

The processing targets of these classes are as follows. The processing class is in parentheses.

List related processing (ArList) (00)

Overview

List generation (from (List, array, Set, CSV string), repeating string / number)

□ Clone List (Correspondence that List itself is not Cloneable)

ArList.java


  /**Clone List.Correspondence that List itself is not Cloneable. */
   public static <T> List<T> clone(List<T> list) 

[S00_00_00]

□ Generate List from array (the one generated by Arrays # asList cannot be changed) or Set

ArList.java


   /**Make variadic argument List.Arrays#Because it cannot be changed when generated with asList. */
   public static <T> List<T> construct(T... values)

[S00_00_01]

□ Generate List from CSV string

The separator can be specified as well as a comma.

ArList.java


   /**Divide by commas into a list. */
   public static List<String> construct(String str) 
   /**Divide with set to make a list. */
   public static List<String> constructFromCsv(String str,char sep)

[S00_00_02]

□ Generate a list of numerical values at regular intervals

ArList.java


   /**Generate count numbers from start at step intervals. */
   public static List<Integer> constructSeqList(int start,int count,int step) 

[S00_00_03]

□ Generate a list of random numbers

ArList.java


   /** start(Including)From end(Not included)Generate a number between count times. */
   public static List<Integer> constructRandomList(int start,int end,int count)

[S00_00_03]

□ Generate a list of random alphabetic characters of the specified length

ArList.java


   /**Generate count len length alphabetic strings.You can specify only uppercase letters, only lowercase letters, or a mixture by specifying spec.. */
   public static List<String> constructRandomList(int len,ArCaseSpec spec,int count)

[S00_00_04]

□ Generate a List of specified values

ArList.java


   /**Generate the specified value for the number of counts. */
   public static <T> List<T> construct(T value,int count)

[S00_00_05]

Change List (Prohibit null / duplicate values, delete all conditional values, exchange elements)

□ Avoid inserting null or duplicate values in the List.

ArList.java


   /**
    *Avoid inserting nulls or duplicate data in the list<br>
    * @param ignoreNull : ArNull.IGNORE ⇒ Do not insert
    * @param ignoreDup : ArDuplicate.IGNORE ⇒ Do not insert
    * @return Returns true if inserted.
    */
  public static <T> boolean add(List<T> list,T e,ArNullIgnore arNull,ArDuplicateIgnore arDup)
   /**
    *Avoid inserting nulls or duplicate data in the list<br>
    * @param ignoreNull : ArNull.IGNORE ⇒ Do not insert
    * @param ignoreDup : ArDuplicate.IGNORE ⇒ Do not insert
    * @return Returns true if inserted.
    */
  public static <T> boolean add(List<T> list,int index, T e,ArNullIgnore arNull,ArDuplicateIgnore arDup)

[S00_00_06]

□ Removes all specified values from List. Note, List # remove removes only the first element

ArList.java


   /**Delete all specified elements from List.Note, List#remove($Value)Deletes only the first element*/
   public static <$Value> void removeAll(List<$Value> list,$Value value)
   /**Remove all elements that match the validator from the List. */
   public static <$Value> void removeAll(List<$Value> list,ArValidator<$Value) validator

[S00_00_07]

□ Sort List. Just make it unnecessary to specify Comparator

ArList.java


   /**Sort the list of Comparable*/
   public static void sort(List<Comparable> list,ArSortDir dir)

[S00_00_08]

□ Insert int values sorted in List

ArList.java


   /**Insert int values sorted into list*/
   public static void insert(List<Integer> list,int value,ArSortDir dir)

□ Swap the elements at the specified position in the List.

ArList.java


   /**Swap elements at specified positions. */
   public static <T> void swap(List<T> list,int index0,int index1)

List conversion (random / reverse order, value conversion, type conversion, to (MapOnMap, ListOnMap, ArMatrix, etc.))

□ Randomize the order of the elements in the List

ArList.java


   /**Randomize the order of the elements in the List.The original List does not change.*/
   public static <T> List<T> randomize(List<T> list) 

[S00_00_09]

□ Reverse the elements of List

ArList.java


   /**Reverse the order of the elements in the List.The original List does not change.*/
   public static <T> List<T> reverse(List<T> list)

[S00_00_10]

□ Convert the value of List to another value specified in Map, leave the unspecified value as it is

ArList.java


   /**Convert the value of List to another value specified in Map.The value that is not specified remains the same*/
   public static <$element> void changeValue(List<$element> list,Map<$element,$element> map) 

[S00_00_11]

□ Convert the value of List to another value specified by ArCreator, the value not specified remains the same

ArList.java


   /**Convert the value of List to another value specified by ArCreator. */
   public static <T0,T1> void changeValue(List<T0> list,ArCreator<T0,T0> creator) throws Exception

[S00_00_12]

□ Convert the element type of List to another type with ArCreator to create a new List

ArList.java


   /**Create a new List by converting the element type of List to another type with ArCreator*/
   public static <T0,T1> List<T1> convert(List<T0> list,ArCreator<T0,T1> creator) throws Exception

[S00_00_13]

□ Convert List to Map, specify the key by field name

ArList.java


   /**Convert Collection to Map, specify the key by field name*/
   public static <T0,T1> Map<T1,T0> createMap(Collection<T0> collection,String keyField) throws Exception 

[S00_00_14]

□ Convert List to Map, specify key and value by field name

ArList.java


   /**Convert Collection to Map, specify key and value by field name*/
   public static <T0,T1,T2> Map<T1,T2> createMap(Collection<T0> collection,String keyField,String valueField) throws Exception  

[S00_00_15]

□ Convert List to Map, generate key with ArCreator

ArList.java


   /**Convert Collection to Map, generate key with ArCreator*/
   public static <$Element, $Key> Map<$Key,$element> createMap(Collection<$Element> collection,ArCreator<$Element,$Key> creator) throws Exception 

[S00_00_16]

□ Convert List to Map, generate key and value with ArCreator

ArList.java


   /**Convert Collection to Map, generate keys and values with ArCreator*/
   public static <$Element, $Key, $Value> Map<$Key,$Value> createMap(Collection<$Element> collection,ArCreator<$Element,$Key> creator1,ArCreator<$Element,$Value> creator2) throws Exception 

[S00_00_17]

□ Convert List to ArMatrix (2D Map), specify the key by field name

ArList.java


   /**ArMatrix Collection(2D Map)Convert to, key is specified by field name*/
   public static  <$key0, $key1, $value> ArMatrix<$key0,$key1,$value> createArMatrix(Collection<$value> collection,String key0Field,String key1Field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException

[S00_00_18]

□ Convert List to ArMatrix (2D Map), generate key with ArCreator

ArList.java


   /**ArMatrix Collection(2D Map)Convert to, key generated by ArCreator*/
   public static <T0,T1,T2> ArMatrix<T0,T1,T2> createArMatrix(Collection<T2> collection,ArCreator<T2,T0> key0Creator,ArCreator<T2,T1> key1Creator) throws Exception

[S00_00_19]

□ Convert List to MapOnMap (two-stage Map), specify primary key and secondary key by field name

ArList.java


   /**MapOnMap Collection(Two-stage Map)The primary key and secondary key to be converted to are specified by the field name.*/
   public static <$Key0,$Key1,$Value> Map<$Key0,Map<$Key1,$Value>> createMapOnMap(Collection<$Value> collection,String key0Field,String key1Field) throws Exception 

[S00_00_20]

□ Convert List to MapOnMap (two-stage Map), generate primary key and secondary key with ArCreator

ArList.java


   /**MapOnMap Collection(Two-stage Map)Convert to, primary key and secondary key are generated by ArCreator*/
   public static <$Key0,$Key1,$Value> Map<$Key0,Map<$Key1,$Value>> createMapOnMap(Collection<$Value> collection,ArCreator<$Value,$Key0> key0Creator,ArCreator<$Value,$Key1> key1Creator) throws Exception

[S00_00_21]

□ Convert List to ListOnMap (List on Map), specify the key by field name

ArList.java


   /**ListOnMap Collection(List on Map)Convert to, key is specified by field name*/
   public static <$Key, $Value> Map<$Key,List<$Value>> createListOnMap(Collection<$Value> collection,String keyField) throws InstantiationException, IllegalAccessException, NoSuchFieldException, SecurityException, IllegalArgumentException, InvocationTargetException

[S00_00_22]

□ Convert List to ListOnMap (List on Map), generate key with ArCreator

ArList.java


   /**ListOnMap(List on Map)Convert to, key generated by ArCreator*/
   public static <$Key,$Value> Map<$Key,List<$Value>> createListOnMap(Collection<$Value> collection,ArCreator<$Value,$Key> keyCreator) throws Exception

□ Convert List to Set

ArList.java


   /**Convert List to Set*/
   public static <T> Set<T> toSet(List<T> list) 

□ Convert Integer List to int array

ArList.java


   /**Convert a List of Integers to an array of ints*/
   public static int[] toIntArray(List<Integer> integerList)

Extraction of List values (deletion of duplicate values, index specification, interval specification, condition specification)

□ Extract only duplicate elements of List and create a new List

ArList.java


   /**Create a new List by extracting only the duplicate elements of List*/
   public static <T> List<T> selectDuplicated(List<T> list) 

[S00_00_23]

□ Create a new List without duplicate elements of List

ArList.java


   /**Create a new List with duplicate elements in the List removed*/
   public static <T> List<T> removeDuplicated(List<T> list)

[S00_00_24]

□ Extracts the element of the specified index (other than) from the List and creates a new List

ArList.java


   /**Extracts the element of the specified index from the List and creates a new List*/
   public static <T> List<T> select(List<T> list,List<Integer> indexes)
   /**Creates a new List by extracting elements other than the specified index from the List*/
   public static <T> List<T> selectExcept(List<T> list,List<Integer> indexes)

[S00_00_25]

□ Extract the element of index (other than) that matches ArValidator from List and create a new List

ArList.java


   /**Extract the element of the index that matches ArValidator from the List and create a new List*/
   public static <T> List<T> selectByIndex(List<T> list,ArValidator<Integer> validator)
   /**Create a new List by extracting non-indexed elements that match ArValidator from the List*/
   public static <T> List<T> selectByIndexExcept(List<T> list,ArValidator<Integer> validator)

[S00_00_27]

□ Creates a new List by extracting elements from the beginning (from the end) of the List at specified intervals.

ArList.java


   /**Creates a new List by extracting elements from the beginning of the List at specified intervals*/
   public static <T> List<T> select(List<T> list,int start,int interval,int count)
   /**Creates a new List by extracting elements from the end of the List at specified intervals*/
   public static <T> List<T> selectReverse(List<T> list,int start,int interval,int count) 

[S00_00_26]

□ Extract the elements that match (do not match) ArValidator of List and create a new List

ArList.java


  /**Create a new List by extracting the elements that match the ArValidator of the List*/
  public static <T> List<T> select(List<T> list,ArValidator<T> validator)
  /**Create a new List by extracting the elements that do not match the ArValidator of the List*/
  public static <T> List<T> selectExcept(List<T> list,ArValidator<T> validator)

[S00_00_28]

Get index of List value (direct value specification, value condition specification, continuous number of value condition specification)

□ Returns the index of the value specified after the specified index, specify the value directly or specify ArValidator

ArList.java


   /**Returns the index of the specified value after the specified index, the value is specified directly*/
   public static <T> List<Integer> getIndexes(List<T> list,T element,int start) 
   /**Returns the index of the specified value after the specified index, the value is specified by ArValidator*/
   public static <T> List<Integer> getIndexes(List<T> list,ArValidator<T> validator,int start) 

[S00_00_29]

□ Returns the index of the value specified before the specified index, specify the value directly or specify ArValidator

ArList.java


   /**Returns the index of the value specified before the specified index, the value is specified directly*/
   public static <T> List<Integer> getIndexesReverse(List<T> list,T element,int end)
   /**Returns the index of the value specified before the specified index, the value is specified by ArValidator*/
   public static <T> List<Integer> getIndexesReverse(List<T> list,ArValidator<T> validator,int end)

□ The value specified after the specified Inbooks returns the index consecutively more than the specified number of times, the value is specified by ArValidator

ArList.java


  /**Returns an index in which the specified value since the specified Inbooks continues for the specified number of times.*/
  public static <T> List<Integer> sameValueSequence(List<T> list,ArValidator<T> validator,int count,int start)

□ The value specified before the specified Inbooks returns the index consecutively more than the specified number of times, the value is specified by ArValidator

ArList.java


   /**Returns indexes where the specified value prior to the specified Inbooks is more than the specified number of consecutive times*/
  public static <T> List<Integer> sameValueSequenceReverse(List<T> list,ArValidator<T> validator,int count,int end) 

List value count and existence judgment (duplicate value, null value, value condition specification / index specification / number specification)

□ Determine if the List is null or empty

ArList.java


   /**Determine if Collection is null or empty*/
   public static <T> boolean isNullOrEmpty(Collection<T> list) 
   /**Determine if Colleciton is null or empty*/
   public static <T> boolean isNotNullOrEmpty(Collection<T> list)

□ Count the number of occurrences to determine if there are duplicate values in the List

ArList.java


   /**Determine if the List has duplicate values*/
   public static <T> boolean duplicated(List<T> list)
   /**Count the number of occurrences of List values*/
   public static <T> Map<T,Integer> countValue(List<T> list)

[S00_00_31]

□ Count the number of specified values in List, specify the value directly or specify ArValidator

ArList.java


  /**Count the number of specified values, specify the value directly*/
  public static <T> int count(Collection<T> list,T value) 
  /**Counts the number of specified values, values are specified by ArValidator*/
  public static <T> int count(Collection<T> list,ArValidator<T> validator) 

[S00_00_32]

□ Returns the index of the value specified after the specified index of List, specify the value directly or specify ArValidator

ArList.java


   /**Returns the index of the specified value after the specified index, the value is specified directly*/
   public static <$Value> int contains(List<$Value> list,int index,$Value value) 
   /**Returns the index of the specified value after the specified index, the value is specified by ArValidator*/
   public static <$Value> int contains(List<$Value> list,int index,ArValidator<$Value> validator) 

[S00_00_33]

□ Determine if there is only one value specified by ArValidator in List

ArList.java


   /**Determines if only one value specified by ArValidator exists*/
   public static <$Element> boolean containsOnlyOne(Collection<$Element> list,ArValidator<$Element> validator) 

□ Determine if there is one or more values specified by ArValidator in List

ArList.java


   /**Determines if one or more values specified by ArValidator exist*/
   public static <T> boolean contains(Collection<T> collection,ArValidator<T> validator) 

□ Judge that the value specified by ArValidator does not exist in List

ArList.java


   /**Determines that the value specified by ArValidator does not exist*/
   public static <$Element> boolean containsNone(Collection<$Element> list,ArValidator<$Element> validator)

□ Determine that all elements of List are the values specified by ArValidator

ArList.java


   /**Determines that all elements have the values specified by ArValidator*/
   public static <$Element> boolean containsAll(Collection<$Element> list,ArValidator<$Element> validator) 

□ Determine if all the elements of List1 are included in List0

ArList.java


   /**Determine if all the elements of List1 are included in List0*/
   public static <$Value> boolean contains(List<$Value> list0,List<$Value> list1)

Aggregate values of List values (minimum value, maximum value, total value, mean value, standard deviation)

□ Calculate the aggregated value of the value obtained from the element of List, the value is obtained from the element with ArCreator

ArList.java


   /**Calculate the minimum value obtained from the element of Collection, get the value from the element with ArCreator*/
   public static <T> Number min(Collection<T> list,ArCreator<T,? extends Number> creator) throws Exception
   /**Find the index of the minimum value of the value obtained from the element of List, the value is obtained from the element with ArCreator*/
   public static <T> List<Integer> minIndex(List<T> list,ArCreator<T,? extends Number> creator) throws Exception
   /**Calculate the maximum value of the value obtained from the element of Collection, the value is obtained from the element with ArCreator*/
   public static <T> Number max(Collection<T> list,ArCreator<T,? extends Number> creator) throws Exception
   /**Find the index of the maximum value of the value obtained from the element of List, the value is obtained from the element with ArCreator*/
   public static <T> List<Integer> maxIndex(List<T> list,ArCreator<T,? extends Number> creator) throws Exception
   /**Calculate the total value of the values obtained from the elements of Collection, the values are obtained from the elements with ArCreator*/
   public static <T> Number sum(Collection<T> list,ArCreator<T,? extends Number> creator) throws Exception
   /**Calculate the average value of the values obtained from the elements of Collection, the values are obtained from the elements with ArCreator*/
   public static <T> Double avg(Collection<T> list,ArCreator<T,? extends Number> creator) throws Exception
   /**Calculate the standard deviation value of the value obtained from the element of Collection, the value is obtained from the element with ArCreator*/
   public static <T> Double standardDeviation(Collection<T> list,ArCreator<T,? extends Number> creator) throws Exception 

Transition value of List value (moving average value, fluctuation rate (value) (from initial or middle), percentage, cumulative value (from initial or middle))

□ Calculate the transition value of the value obtained from the elements of List

ArList.java


   /**Calculate the moving average of the values obtained from the elements of the List*/
   public static <T> List<Double> movingAvg(List<T> list,ArCreator<T,? extends Number> creator,int span) throws Exception
   /**Calculate the moving average value of the values obtained from the elements of List and write it to the original List*/
   public static <T> void movingAvg(List<T> list,ArCreator<T,? extends Number> creator,int span,String updateField) throws Exception
   /**Calculate the rate of change from the initial value of the value obtained from the elements of List*/
   public static <T> List<Double> fluctuationRatio(List<T> list,ArCreator<T,? extends Number> creator) throws Exception
   /**Calculate the fluctuation rate from the initial value of the value obtained from the elements of List and write it to the original List*/
   public static <T> void fluctuationRatio(List<T> list,ArCreator<T,? extends Number> creator,String updateField) throws Exception 
   /**Calculate the fluctuation range of the value obtained from the elements of List from the initial value*/
   public static <T> List<? extends Number> fluctuationWidth(List<T> list,ArCreator<T,? extends Number> creator) throws Exception 
   /**Calculate the fluctuation range of the value obtained from the elements of List from the initial value and write it to the original List*/
   public static <T> void fluctuationWidth(List<T> list,ArCreator<T,? extends Number> creator,String updateField) throws Exception
   /**Calculate the rate of change from the span before the value obtained from the elements of List*/
   public static <T> List<Double> fluctuationRatio(List<T> list,ArCreator<T,? extends Number> creator,int span) throws Exception
   /**Calculates the fluctuation rate of the value obtained from the elements of List from the previous span and writes it to the original List.*/
   public static <T> void fluctuationRatio(List<T> list,ArCreator<T,? extends Number> creator,int span,String updateField) throws Exception
   /**Calculate the fluctuation range of the value obtained from the elements of List from the previous span*/
   public static <T> List<? extends Number> fluctuationWidth(List<T> list,ArCreator<T,? extends Number> creator,int span) throws Exception
   /**Calculates the fluctuation range of the value obtained from the elements of List from the previous span and writes it to the original List.*/
   public static <T> void fluctuationWidth(List<T> list,ArCreator<T,? extends Number> creator,int span,String updateField) throws Exception 
   /**Calculate the percentage value of the value obtained from the elements of the List*/
   public static <T> List<Double> percent(List<T> list,ArCreator<T,? extends Number> creator) throws Exception
   /**Calculates the percentage of the value obtained from the elements of the List and writes it to the original List*/
   public static <T> void percent(List<T> collection,ArCreator<T,? extends Number> creator,String updateField) throws Exception 
   /**Calculate the cumulative value of the values obtained from the elements of List*/
   public static <T> List<? extends Number> accumulation(List<T> list,ArCreator<T,? extends Number> creator) throws Exception 
   /**Calculate the total value of the Spanish interval of the values obtained from the elements of List*/
   public static <T> List<? extends Number> periodSumarize(List<T> list,ArCreator<T,? extends Number> creator,int span) throws Exception 

Histogram of List values

□ Create a histogram of the values obtained from the elements of the List

ArList.java


   /**Create a histogram of the values retrieved from the elements of the List*/
   public static <T0,T1> int[] histogram(Collection<T0> collection,ArCreator<T0,T1> creator,ArValidator<T1>[] validators) throws Exception

Value conversion using two Lists

ArList.java


  /**Scans the first List for the index of the specified value and returns the value of the above index in the next List*/
  public static <T0,T1> T1 getPartner(List<T0> orgValues,List<T1> desValues,T0 org)

Equal value judgment of List and (List, Set, array) (null value ignored, duplicate value ignored, order ignored possible)

□ Equal value judgment of List and (List, Set, array)

ArList.java


   /**Equal value judgment of two Lists*/
   public static <T> boolean equals(List<T> list0,List<T> list1)
   /**Equal value judgment of two Lists.Ignore order, ignore null value, ignore duplicate value can be specified*/
   public static <T> boolean equals(List<T> list0,List<T> list1,ArSeqIgnore arSeq,ArNullIgnore arNull,ArDuplicateIgnore arDup) 
   /**Equivalent judgment of List and array.Ignore order, ignore null value, ignore duplicate value can be specified*/
   public static <T> boolean equals(List<T> list0,T[] array1,ArSeqIgnore arSeq,ArNullIgnore arNull,ArDuplicateIgnore arDup) 
   /**Equal value judgment of List and Set.Null value ignore, duplicate value ignore can be specified*/
   public static <T> boolean equals(List<T> list0,Set<T> set1,ArNullIgnore arNull,ArDuplicateIgnore arDup) 

Set operation of two Lists (AND, OR, XOR, EXCEPT)

□ Find AND, OR, XOR, EXCEPT of two Lists

ArList.java


   /**Find the AND of two Lists*/
   public static <T> List<T> and(List<T> list0,List<T> list1)
   /**Find the OR of two Lists*/
   public static <T> List<T> or(List<T> list0,List<T> list1)
   /**Find the XOR of two Lists*/
   public static <T> List<T> xor(List<T> list0,List<T> list1) 
   /**Find the EXCEPT of two Lists*/
   public static <T> List<T> except(List<T> list0,List<T> list1)

Set related processing (ArSet) (01)

Overview

Generate Set (from Set, List, array, CSV string)

ArSet.java


  /**Correspondence that Clone Set, not Cloneable as Set*/
  public static <T> Set<T> clone(Set<T> set)
  /**Generate Set from List*/
  public static <T> Set<T> constructFromList(List<T> list) 
  /**Generate Set from an array*/
  public static <T> Set<T> constructFromArray(T[] array)
  /**Generate Set from CSV string*/
  public static Set<String> construct(String str,char sep) 
  /**Generate Set from CSV string*/
  public static Set<String> construct(String str)
  /**Generate Set from int array*/
  public static Set<Integer> constructFromIntArray(int[] intArray)
  /**Generate a set of numbers at regular intervals*/
  public static Set<Integer> construct(int start,int count,int step)

Extracting the value of Set

□ Create a new Set by extracting the values specified (not specified) in the array from Set

ArSet.java


  /**Creates a new Set by extracting the values specified in the array from Set*/
  public static <T> Set<T> select(Set<T> set,T[] array)
  /**Create a new Set by extracting the values not specified in the array from the Set*/
  public static <T> Set<T> selectExcept(Set<T> set,T[] array)

□ Extract the value specified (not specified) by ArValidator from Set and create a new Set

ArSet.java


  /**Extracts the value specified by ArValidator from Set and creates a new Set*/
  public static <T> Set<T> select(Set<T> set,ArValidator<T> validator)
  /**Create a new Set by extracting the values not specified by ArValidator from the Set*/
  public static <T> Set<T> selectExcept(Set<T> set,ArValidator<T> validator) 

□ Create a new Set by removing the null value from the Set

ArSet.java


  /**Create a new Set by removing the null value from the Set*/
  public static <T> Set<T> removeNull(Set<T> set) 

Set value conversion, type conversion

ArSet.java


  /**Specify the old and new values in Map and convert the value of Set, the value not specified remains the same*/
  public static <T> void changeValue(Set<T> set,Map<T,T> map) 
  /**Create a new Set by specifying the old and new values in Map, the type of Set is also converted*/
  public static <T0,T1> Set<T1> changeValueType(Set<T0> set,ArCreator<T0,T1> creator) throws Exception 

Conversion of Set to other formats

ArSet.java


  /**Convert Set to Map, key specifies element field*/
  public static <T0,T1> Map<T1,T0> createMap(Collection<T0> collection,String keyField) throws Exception
  /**Convert Set to Map, key is generated from element with ArCreator*/
  public static <T0, T1, T2> Map<T1,T2> createMap(Collection<T0> collection,ArCreator<T0,T1> creator1,ArCreator<T0,T2> creator2) throws Exception 
  /**Convert Set to ArMatrix, key specifies element field*/
  public static <T0, T1, T2> ArMatrix<T0,T1,T2> createArMatrix(Collection<T2> collection,String key0Field,String key1Field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
  /**Convert Set to ArMatrix, key is generated from element with ArCreator*/
  public static <T0,T1,T2> ArMatrix<T0,T1,T2> createArMatrix(Collection<T2> collection,ArCreator<T2,T0> key0Creator,ArCreator<T2,T1> key1Creator) throws Exception 
  /**Set to MapOnMap(Two-stage Map)Convert to, key specifies the field of the element*/
  public static  <T0,T1,T2> Map<T0,Map<T1,T2>> createMapOnMap(Collection<T2> collection,String key0Field,String key1Field) throws Exception
  /**Set to MapOnMap(Two-stage Map)Convert to, key generate element in ArCreator*/
  public static  <T0,T1,T2> Map<T0,Map<T1,T2>> createMapOnMap(Collection<T2> collection,ArCreator<T2,T0> key0Creator,ArCreator<T2,T1> key1Creator) throws Exception
  /**Convert a Set of Integer to an array of ints*/
  public static int[] integerSetToIntArray(Set<Integer> integerSet) 

Existence check of Set value

ArSet.java


  /**Determine if there is only one value that matches ArValidator in Set*/
  public static <$Element> boolean containsOnlyOne(Collection<$Element> list,ArValidator<$Element> validator) 
  /**Determine if there is a value that matches ArValidator in Set*/
  public static <T> boolean contains(Collection<T> collection,ArValidator<T> validator)
  /**Determine if there is any value in Set that matches ArValidator*/
  public static <$Element> boolean containsNone(Collection<$Element> list,ArValidator<$Element> validator)
  /**Determine if all the values in Set match ArValidator*/
  public static <$Element> boolean containsAll(Collection<$Element> list,ArValidator<$Element> validator)

Calculation of aggregated values of Set values (maximum value, minimum value, total value, mean value, standard deviation)

ArSet.java


  /**Convert the elements of Set to numbers with ArCreator and calculate the minimum value*/
  public static <T> Number min(Collection<T> set,ArCreator<T,? extends Number> creator) throws Exception
  /**Convert the elements of Set to numbers with ArCreator and calculate the maximum value*/
  public static <T> Number max(Collection<T> set,ArCreator<T,? extends Number> creator) throws Exception
  /**Convert the elements of Set to numbers with ArCreator and calculate the total value*/
  public static <T> Number sum(Collection<T> set,ArCreator<T,? extends Number> creator) throws Exception 
  /**Convert the elements of Set to numbers with ArCreator and calculate the average value*/
  public static <T> Double avg(Collection<T> collection,ArCreator<T,? extends Number> creator) throws Exception 
  /**Convert the elements of Set to numbers with ArCreator and standard deviation*/
  public static <T> Double standardDeviation(Collection<T> collection,ArCreator<T,? extends Number> creator) throws Exception 

Creating a histogram of Set values

ArSet.java


  /**Create a histogram of the values obtained from the elements of Set*/
  public static <T0,T1> int[] histogram(Collection<T0> collection,ArCreator<T0,T1> creator,ArValidator<T1>[] validators) throws Exception

Set operation of two sets (AND, OR, XOR, EXCEPT)

ArSet.java


  /**Find the AND of two sets*/
  public static <T> Set<T> and(Set<T> set0,Set<T> set1) 
  /**Find the OR of two sets*/
  public static <T> Set<T> or(Set<T> set0,Set<T> set1) 
  /**Find the XOR of two sets*/
  public static <T> Set<T> xor(Set<T> set0,Set<T> set1)
  /**Find the EXCEPT of two sets*/
  public static <T> Set<T> except(Set<T> set0,Set<T> set1) 

Equal value judgment and inclusion judgment of two sets

ArSet.java


  /**Perform equality judgment of two sets*/
  public static <T> boolean equals(Set<T> set0,Set<T> set1) 
  /**You can specify to ignore null values, which determines the equality of two sets.*/
  public static <T> boolean equals(Set<T> set0,Set<T> set1,ArNullIgnore arNull)
  /**You can specify to ignore null values and ignore duplicate values, which determines the equality of Set and List.*/
  public static <T> boolean equals(List<T> list0,Set<T> set1,ArNullIgnore arNull,ArDuplicateIgnore arDup)
  /**You can specify to ignore null values and ignore duplicate values, which determines the equality between Set and array.*/
  public static <T> boolean equals(Set<T> set0,T[] array1,ArNullIgnore arNull,ArDuplicateIgnore arDup) 

Map related processing (ArMap) (02)

Overview

Map generation from (Map, Collection, Csv, Tagged Csv, array, two-dimensional array)

ArMap.java


  /**Clone Map, support that Map itself is not Cloneable*/
  public static <$Key, $Value> Map<$Key,$Value> clone(Map<$Key,$Value> map) 
  /**Generate Map from Collection, key is specified field*/
  public static <$Key, $Value> Map<$Key,$Value> constructFromCollection(Collection<$Value> collection,String keyField) throws Exception 
  /**Generate Map from Collection, key is generated by ArCreator*/
  public static <$Key,$Value> Map<$Key,$Value> constructFromCollection(Collection<$Value> collection,ArCreator<$Value,$Key> creator) throws Exception 
  /**Generate Map from CSV string, specify key as array, specify separator*/
  public static Map<String,String> constructFromCsv(String str,char sep,String[] keys) 
  /**You can specify a separator that generates a Map from a Tagged CSV string*/
  public static Map<String,String> constructFromTaggedCsv(String str,ArCsvConf conf) 
  /**Generate Map from Tagged CSV string, separators are equal to comma*/
  public static Map<String,String> constructFromTaggedCsv(String str) 
  /**Generate a Map from two arrays*/
  public static <$Key, $Value> Map<$Key,$Value> construct($Key[] keys,$Value[] values) 
  /**Generate a Map from a two-dimensional array*/
  public static <T> Map<T,T> construct(T[][] keysAndValues)
  /**Generate a Map from a two-dimensional array*/
  public static <T> Map<T,T> construct(T[][] keysAndValues,int keyIndex,int valueIndex)

Map value settings (extract keys and values from objects)

Map equality judgment (designation of judgment exclusion key)

ArMap.java


  /**All elements of the two maps(Key and value)Determine if are equal*/
  public static <$Key, $Value> Boolean equals(Map<$Key,$Value> map0,Map<$Key,$Value> map1)
  /**Specified key elements of two Maps(Key and value)Determine if are equal*/
  public static <$Key, $Value> Boolean equalsByKey(Map<$Key,$Value> map0,Map<$Key,$Value> map1,Set<$Key> keys) 
  /**Specified key elements of two Maps(Key and value)Determine if are equal*/
  public static <$Key, $Value> Boolean equalsByKey(Map<$Key,$Value> map0,Map<$Key,$Value> map1,$Key[] keys)
  /**Elements other than the specified key of the two Maps(Key and value)Determine if are equal*/
  public static <$Key, $Value> Boolean equalsExceptKey(Map<$Key,$Value> map0,Map<$Key,$Value> map1,Set<$Key> keys) 
  /**Elements other than the specified key of the two Maps(Key and value)Determine if are equal*/
  public static <$Key, $Value> Boolean equalsExceptKey(Map<$Key,$Value> map0,Map<$Key,$Value> map1,$Key[] keys) 

Map inclusion judgment (designation of judgment exclusion key)

ArMap.java


  /**map0 is all elements of map1(Key and value)Determine if it contains*/
  public static <$Key, $Value> Boolean contains(Map<$Key,$Value> map0,Map<$Key,$Value> map1) 
  /**Map is an element other than the specified key of map1(Key and value)Determine if it contains*/
  public static <$Key, $Value> Boolean containsExceptKey(Map<$Key,$Value> map0,Map<$Key,$Value> map1,Set<$Key> keys)
  /**Map is an element other than the specified key of map1(Key and value)Determine if it contains*/
  public static <$Key, $Value> Boolean containsExceptKey(Map<$Key,$Value> map0,Map<$Key,$Value> map1,$Key[] keys) 

Extraction of Map elements (specifying value and key conditions)

□ Create a new Map excluding null values

ArMap.java


  /**Create a new Map excluding null values*/
  public static <$Key, $Value> Map<$Key,$Value> selectNullExcept(Map<$Key,$Value> map) 

□ Extract with the specified key and create a new Map

ArMap.java


  /**Extract with the specified key and create a new Map*/
  public static <$Key,$Value> Map<$Key,$Value> selectByKey(Map<$Key,$Value> map,$Key[] keys) 
  /**Extract with the specified key and create a new Map*/
  public static <$Key,$Value> Map<$Key,$Value> selectByKey(Map<$Key,$Value> map,Set<$Key> keys) 
  /**Extract with the specified key and create a new Map*/
  public static <$Key, $Value> Map<$Key,$Value> selectByKey(Map<$Key,$Value> map,ArValidator<$Key> validator)

□ Create a new Map by extracting with a key other than the specified one

ArMap.java


  /**Create a new Map by extracting with a key other than the specified one*/
  public static <$Key,$Value> Map<$Key,$Value> selectByKeyExcept(Map<$Key,$Value> map,$Key[] keys) 
  /**Create a new Map by extracting with a key other than the specified one*/
  public static <$Key,$Value> Map<$Key,$Value> selectByKeyExcept(Map<$Key,$Value> map,Set<$Key> keys) 
  /**Create a new Map by extracting with a key other than the specified one*/
  public static <$Key, $Value> Map<$Key,$Value> selectByKeyExcept(Map<$Key,$Value> map,ArValidator<$Key> validator)

□ Create a new Map by extracting the elements containing the specified value

ArMap.java


  /**Create a new Map by extracting the elements containing the specified value*/
  public static <$Key, $Value> Map<$Key,$Value> selectByValue(Map<$Key,$Value> map,$Value element) 
  /**Create a new Map by extracting the elements containing the specified value*/
  public static <$Key, $Value> Map<$Key,$Value> selectByValue(Map<$Key,$Value> map,ArValidator<$Value> validator)
  /**Create a new Map by extracting the elements containing the specified value*/
  public static <$Key,$Value> Map<$Key,$Value> selectByValue(Map<$Key,$Value> map,Collection<$Value> values) 
  /**Create a new Map by extracting the elements containing the specified value*/
  public static <$Key,$Value> Map<$Key,$Value> selectByValue(Map<$Key,$Value> map,$Value[] values)

□ Create a new Map by extracting elements that do not contain the specified value

ArMap.java


  /**Create a new Map by extracting elements that do not contain the specified value*/
  public static <$Key, $Value> Map<$Key,$Value> selectByValueExcept(Map<$Key,$Value> map,ArValidator<$Value> validator)
  /**Create a new Map by extracting elements that do not contain the specified value*/
  public static <$Key,$Value> Map<$Key,$Value> selectByValueExcept(Map<$Key,$Value> map,Collection<$Value> values) 
  /**Create a new Map by extracting elements that do not contain the specified value*/
  public static <$Key,$Value> Map<$Key,$Value> selectByValueExcept(Map<$Key,$Value> map,$Value[] values) 

Map key extraction (value, key condition specification)

□ Extract the key with the specified value

ArMap.java


  /**Extract the key with the specified value*/
  public static <$Key,$Value> Set<$Key> getKeysFromValue(Map<$Key,$Value> map,ArValidator<$Value> validator)
  /**Extract the key with the specified value*/
  public static <$Key,$Value> Set<$Key> getKeysFromValue(Map<$Key,$Value> map,Collection<$Value> coll) 
  /**Extract the key with the specified value*/
  public static <$Key,$Value> Set<$Key> getKeysFromValue(Map<$Key,$Value> map,$Value[] array) 

□ Extract the key with a value other than the specified value

ArMap.java


  /**Extract the key with a value other than the specified value*/
  public static <$Key,$Value> Set<$Key> getKeysFromValueExcept(Map<$Key,$Value> map,ArValidator<$Value> validator) 
  /**Extract the key with a value other than the specified value*/
  public static <$Key,$Value> Set<$Key> getKeysFromValueExcept(Map<$Key,$Value> map,Collection<$Value> coll) 
  /**Extract the key with a value other than the specified value*/
  public static <$Key,$Value> Set<$Key> getKeysFromValueExcept(Map<$Key,$Value> map,$Value[] array) 

Map set operation (AND, OR, XOR, EXCEPT)

□ Create a new map by performing a set operation of two maps

ArMap.java


  /**Create a new Map by ANDing the keys of two Maps*/
  public static <$Key,$Value> Map<$Key,$Value> andKey(Map<$Key,$Value> map0,Map<$Key,$Value> map1)
  /**Create a new Map by ANDing the key and value of two Maps*/
  public static <$Key,$Value> Map<$Key,$Value> andValue(Map<$Key,$Value> map0,Map<$Key,$Value> map1,ArComparator<$Value> comparator) throws InstantiationException, IllegalAccessException
  /**Create a new Map with XOR of two Maps*/ 
  public static <$Key, $Value> Map<$Key,$Value> xor(Map<$Key,$Value> map0,Map<$Key,$Value> map1)
  /**Create a new Map with EXCEPT of the keys of the two Maps*/ 
  public static <$Key, $Value> Map<$Key,$Value> exceptKey(Map<$Key,$Value> map0,Map<$Key,$Value> map1)
  /**Create a new Map with EXCEPT of the key and value of two Maps*/
  public static <$Key,$Value> Map<$Key,$Value> exceptValue(Map<$Key,$Value> map0,Map<$Key,$Value> map1,ArComparator<$Value> comparator)

Map key value conversion

□ Convert Map key to another value

ArMap.java


  /**Convert Map key to another value*/
  public static <$Key, $Value> Map<$Key,$Value> changeKey(Map<$Key,$Value> map,Map<$Key,$Key> keyMap) 
  /**Convert Map key to another value*/
  public static <$Key,$Value> Map<$Key,$Value> changeKey(Map<$Key,$Value> map,$Key[] oldKeys,$Key[] newKeys)
  /**Convert Map key to another value*/
  public static <$Key,$Value> Map<$Key,$Value> changeKey(Map<$Key,$Value> map,$Key[][] keys) 

Map value conversion, value type conversion

□ Convert Map values

ArMap.java


  /**Convert Map values*/
  public static  <$value,$key> void changeValue(Map<$key,$value> map,Map<$value,$value> valueMap)

□ Convert the value type of Map to create a new Map

ArMap.java


  /**Create a new Map by converting the value type of the Map*/
  public static <$Key,$Value,$NewValue> Map<$Key,$NewValue> changeValueType(Map<$Key,$Value> map,Map<$Value,$NewValue> valueMap) throws Exception 
  /**Create a new Map by converting the value type of the Map*/
  public static <$Key,$Value,$NewValue> Map<$Key,$NewValue> changeValueType(Map<$Key,$Value> map,ArCreator<$Value,$NewValue> creator) throws Exception 

Calculation of aggregated values of Map (minimum value, maximum value, total value, mean value, standard deviation)

□ Calculate the aggregated value from the Map value

ArMap.java


  /**Calculate the maximum value from the value of Map*/
  public static <$KeyT> Number max(Map<$KeyT,? extends Number> map) 
  /**Calculate the minimum value from the value of Map*/
  public static <$Key> Number min(Map<$Key,? extends Number> map) 
  /**Calculate the total value from the value of Map*/
  public static <$Key> Number sum(Map<$Key,? extends Number> map)
  /**Calculate the average value from the value of Map*/
  public static <$Key> Double avg(Map<$Key,? extends Number> map)
  /**Calculate the minimum value from the value of Map*/
  public static  <$Key, $Value> Number min(Map<$Key,$Value> map,ArCreator<$Value,? extends Number> creator) throws Exception 
  /**Calculate the maximum value from the value of Map*/
  public static <$Key, $Value> Number max(Map<$Key,$Value> map,ArCreator<$Value,? extends Number> creator) throws Exception
  /**Calculate the total value from the value of Map*/
  public static <$Key, $Value> Number sum(Map<$Key,$Value> map,ArCreator<$Value,? extends Number> creator) throws Exception 
  /**Calculate the average value from the value of Map*/
  public static <$Key, $Value> Double avg(Map<$Key,$Value> map,ArCreator<$Value,? extends Number> creator) throws Exception 

Other processing of Map

ArMap.java


  /**Invert Map keys and values*/
  public static <$Key,$Value> Map<$Value,$Key> reverse(Map<$Key,$Value> map) {
  /**Add, subtract, multiply, divide the value of Map whose value is Integer*/
  public static <$Key> int calc(Map<$Key,Integer> map,$Key key,ArCalc op,Integer value)

Array related processing (ArArray) (03)

Overview

Determining the existence of array values, converting values using two arrays

□ Returns the index of the specified value

ArArray.java


  /**Returns the index of the specified element.If it does not exist, the size will be zero.. */
  public static <T> List<Integer> getIndexes(T[] list,T element)
  /**Returns the index of the specified element.If it does not exist, the size will be zero.. */
  public static <T> List<Integer> getIndexes(T[] list,ArValidator<T> validator)

□ Value conversion using two arrays

ArArray.java


  /**Find the index that matches org from orgValues and return the corresponding element in desValues.   */
  public static <T0,T1> T1 getPartner(T0[] orgValues,T1[] desValues,T0 org,ArComparator comparator) 
  /**Find the index that matches org from orgValues and return the corresponding element in desValues.  */
  public static <T1> T1 getPartner(int[] orgValues,T1[] desValues,Integer org,ArComparator comparator) 
  /**Find the index that matches org from orgValues and return the corresponding element in desValues.  */
  public static <T0> Integer getPartner(T0[] orgValues,int[] desValues,T0 org,ArComparator comparator) 
  /** valuesArray[][orgIndex]Find the one that matches org from the valuesArray[][desIndex]Returns the value of.   */
  public static <T> T getPartner(T[][] valuesArray,int orgIndex,int desIndex,T org) 
  /** valuesArray[][orgIndex]Find the one that matches org from the valuesArray[][desIndex]Returns the value of.   */
  public static int getPartner(int[][] valuesArray,int orgIndex,int desIndex,int org) 

Array value count, duplicate check

□ Determine if there are duplicate values in the array

ArArray.java


  /**Check for duplicates in the array*/
  public static <T> boolean duplicated(T... array) 

□ Count the number of specified values in the array

ArArray.java


  /**Count the number of specified elements in the array. */
  public static <T> int count(T[] array,T element)
  /**Count the number of specified elements in the array. */
  public static <T> int count(T[] array,ArValidator<T> validator)

□ Returns the index of the specified value in the array

ArArray.java



Existence judgment of null value of array, acquisition of index

□ Determine if there is a null value in the array

ArArray.java



□ Determine if all values in the array are (not) null

ArArray.java


  /**Returns true if all arguments are not null.(False if even one is null). */
  public static boolean allNotNull(Object... objs)

□ Determine if only one value in the array is (not) null

ArArray.java


  /**Returns true if only one argument is null. */
  public static boolean oneNull(Object... objs) 
  /**Returns true if only one argument is non-null. */
  public static boolean oneNotNull(Object... objs) 

□ Returns the index of null values in the array

ArArray.java


  /**Returns the index of null values in an array. */
  public static <T> List<Integer> getNullIndexes(T... values) {
  /**Check if the array contains null.True if included.  */
  public static <T> boolean containsNull(T... array)

Array changes Sorting, reverse order, value conversion, two-dimensional array replacement

□ Sort Comparable array, in case you don't want to specify Comparator

ArArray.java


  /**Sort an array of Comparable*/
  public static void sort(Comparable[] array,ArSortDir dir) 

□ Swap the two elements of the array

ArArray.java


  /**Swap the two elements*/
  public static <T> void swap(T[] array,int i0,int i1) 

□ Reverse the elements of the array

ArArray.java


  /**Reverse the elements*/
  public static <T> void reverse(T[] array) 

□ Convert the value of the array to another value specified in Map

ArArray.java


  /**Converts an array value to another value specified in the Map.The value that is not specified remains the same*/
  public static <T> void changeValue(T[] array,Map<T,T> map) 

□ Delete the null value from the array, it will be returned as a List, so make it an array yourself if necessary

ArArray.java


  /**Remove null from the array.Note, if you want to make the return value an array, toArray on the caller side(new String[]{})To do.  */
  public static <T> List<T> removeNull(T... values)

□ Swap two-dimensional arrays (M × N⇒N × M), int, double, String only

ArArray.java


  /**Swap two-dimensional arrays(M×N⇒N×M) */
  public static int[][] exchange(int[][] array) 
  /**Swap two-dimensional arrays(M×N⇒N×M) */
  public static double[][] exchange(double[][] array) 
  /**Swap two-dimensional arrays(M×N⇒N×M) */
  public static String[][] exchange(String[][] array) {

Conversion of array to Set, List

ArArray.java


  /**set array<T>Convert to. */
  public static <T> Set<T> toSet(T... array) throws InstantiationException, IllegalAccessException
  /** int[]To Set. */
  public static Set<Integer> toSet(int[] args) 
  /**  int[]List<Integer>Convert to. */
  public static List<Integer> toList(int[] intArray) 
  /**
   *Make the array a List.<br>
   *Note, Arrays.asList is java.util.Arrays$Returns an ArrayList so java.util.Implement to return an ArrayList.<br>
   *Note, java.util.Arrays$ArrayList cannot add elements.<br>
   */
  public static <T> List<T> toList(T... array) 

Converting an array to a Map

ArArray.java


  /**Generate a Map from two arrays. */
  public static <T0, T1> Map<T0,T1> toMap(T0[] keys,T1[] values) 
  /**
   *Generate a Map from a two-dimensional array.
   *  keysAndValues[0]Is the key, keysAndValues[1]Becomes the value.
   */
  public static <T> Map<T,T> toMap(T[][] keysAndValues) 
  /**Create a Map from a two-dimensional array.  */
  public static <T> Map<T,T> toMap(T[][] keysAndValues,int keyIndex,int valueIndex) {

Conversion between array and Tagged Csv

ArArray.java


  /**
   *  TaggedCsv(Format string)To two arrays.
   *  @return Object[0]Is a String[]With an array of field names, Object[1]Is a String[]Array of values in.
   */
  public static Object[] fromTaggedCsvToTwoArrays(String taggedCsv,ArCsvConf conf) 
  /**
   *  TaggedCsv(Format string)To a two-dimensional array.
   *  @return Array after conversion.[][0]Is the field name,[][1]Is the value.
   */
  public static String[][] fromTaggedCsvToTwoDimArray(String taggedCsv,ArCsvConf conf) 
  /**Tagged Csv from a two-dimensional array(Format string)Convert to. */
  public static String fromTwoDimArrayToTaggedCsv(String[][] twoDimArray,ArCsvConf conf) 
  /**Tagged Csv from two arrays(Format string)Convert to. */
  public static String fromTwoArraysToTaggedCsv(String[] nameArray,String[] valueArray,ArCsvConf conf) 

Equal value judgment of array, List, Set Ignore null, ignore duplicate, ignore order

ArArray.java


 /**Determine if two arrays are equal.If you pass something that is not an array, you will get a RuntimeException.   */
  public static boolean equals(Object obj0,Object obj1) 
  /**
   *Determine if two arrays are equal.
   *  @param arSeq Whether to ignore the order.If it is IGNORE, it is judged to be equal even if the order is different.
   *  @param arNull Whether to ignore null.If it is IGNORE, skip null and judge.
   *  @param arDup Do you want to ignore duplicates?.If it is IGNORE, it is judged to be equal even if there are duplicates.
   */
  public static <T> boolean equals(T[] array0,T[] array1,ArSeqIgnore arSeq,ArNullIgnore arNull,ArDuplicateIgnore arDup) 
  /**
   *Determine if an array is equal to a List.
   *  @param arSeq Whether to ignore the order.If it is IGNORE, it is judged to be equal even if the order is different.
   *  @param arNull Whether to ignore null.If it is IGNORE, skip null and judge.
   *  @param arDup Do you want to ignore duplicates?.If it is IGNORE, it is judged to be equal even if there are duplicates.
   */
  public static <T> boolean equals(List<T> list0,T[] array1,ArSeqIgnore arSeq,ArNullIgnore arNull,ArDuplicateIgnore arDup) 
  /**
   *Determine if an array is equal to Set.
   *  @param arNull Whether to ignore null.If it is IGNORE, skip null and judge.
   *  @param arDup Do you want to ignore duplicates?.If it is IGNORE, it is judged to be equal even if there are duplicates.
   */
  public static <T> boolean equals(Set<T> set0,T[] array1,ArNullIgnore arNull,ArDuplicateIgnore arDup) 

Judgment of inclusion relationship between two sequences

ArArray.java


  /**Inclusion check.Check if all the elements of array B are contained in array A. */
  public static <T> Boolean contains(T[] arrayA,T... arrayB)
  /**Inclusion check.Check if any of the elements of array B are not included in array A. */
  public static <T> Boolean notContains(T[] arrayA,T... arrayB) 
  /**Inclusion check.Check if all the elements of array B are contained in array A. */
  public static Boolean contains(int[] arrayA,int[] arrayB) 
  /**Inclusion check.Check if any of array B is not included in array A.  */
  public static Boolean notContains(int[] arrayA,int[] arrayB) 
  /**Inclusion check.Check if all the elements of array B are contained in array A. */
  public static Boolean contains(long[] arrayA,long[] arrayB) {
  /**Inclusion check.Check if any of array B is not included in array A. */
  public static Boolean notContains(long[] arrayA,long[] arrayB) {

Array reflection (whether it is an array, whether it is an array element, whether it is a primitive or not)

ArArray.java


  /**Judgment of whether it is an array.Returns null if null. */
  public static Boolean isArray(Object obj) 
  /**Extract the type of elements in an array.obj is an array.Returns null if not an array.  */
  public static Class getArrayComponentType(Object obj) 
  /**Determine if the elements of the array are primitive types.Returns null if obj is not an array. */
  public static Boolean arrayComponentIsPrimitive(Object obj) 

Processing Numeric Arrays (ArMath) (04)

Overview

This class mainly deals with double arrays.

Generation and setting of one-dimensional and two-dimensional numerical arrays

□ Set a value in an existing one-dimensional double array that generates a one-dimensional double array

ArMath.java


  /**Generation of one-dimensional array*/
  public static double[] doubleArray(int size,ArGenerator<Double> generator)
  /**Generation of one-dimensional array,The index of the array is specified in the argument of creator. */
  public static double[] doubleArray(int size,ArCreator<Integer,Double> creator) throws Exception 
  /**One-dimensional array setting*/
  public static void fill(double[] doubleArray,ArGenerator<Double> generator) 
  /**One-dimensional array setting.The index of the array is specified in the argument of creator. */
  public static void fill(double[] doubleArray,ArCreator<Integer,Double> creator) throws Exception 

□ Set a value to an existing 2D double array that creates a 2D double array

ArMath.java


  /**Generation of two-dimensional array*/
  public static double[][] doubleArray2D(int sizeRow,int sizeCol,ArGenerator<Double> generator)
  /**Two-dimensional array generation The array index is specified in the argument of creator..*/
  public static double[][] doubleArray2D(int sizeRow,int sizeCol,ArCreator2d<Integer,Integer,Double> creator) throws Exception 
  /**Two-dimensional array settings*/
  public static void fill(double[][] doubleArray2D,ArGenerator<Double> generator) 
  /**Two-dimensional array settings.The index of the array is specified in the argument of creator. */
  public static void fill(double[][] doubleArray2D,ArCreator2d<Integer,Integer,Double> creator) throws Exception 

Number array format conversion Two-dimensional array row and column extraction, one-dimensional ⇔ two-dimensional conversion

□ Extraction of rows and columns of a two-dimensional array

ArMath.java


  /**Extraction of rows and columns of a two-dimensional array*/
  public static double[] extract(double[][] doubleArray,int index,ArTableRC rowCol)

□ Row / Column exchange of 2D array

ArMath.java


  /**Two-dimensional array Row/Column exchange*/
  public static double[][] exchangeRowColumn(double[][] doubleArray) 

□ One-dimensional array ⇔ Two-dimensional array

ArMath.java


  /**One-dimensional array ⇒ Two-dimensional array*/
  public static double[][] toTwoDim(double[] doubleArray,int colCount) 
  /**Two-dimensional array ⇒ One-dimensional array*/
  public static double[] toOneDim(double[][] doubleArray) 

Numeric array type conversion primitive⇔wrapper, int⇔Integer, etc.

□ int[] ⇔ Integer[]

ArMath.java


  /** int[]⇒Integer[] */
  public static Integer[] convertIntArrayToIntegerArray(int[] intArray) 
  /** Integer[]⇒int[] */
  public static int[] convertIntegerArrayToIntArray(Integer[] integerArray) 

□ int[][] ⇔ Integer[][]

ArMath.java


  /** int[][]⇒Integer[][] */
  public static Integer[][] convertIntArray2dToIntegerArray2d(int[][] intArray2D) 
  /** Integer[][]⇒int[][] */
  public static int[][] convertIntegerArray2dToIntArray2d(Integer[][] integetArray2D) 

□ double[] ⇔ Double[]

ArMath.java


  /** double[]⇒Double[] */
  public static Double[] convertDblArrayToDoubleArray(double[] doubleArray)
  /** Double[]⇒double[] */
  public static double[] convertDoubleArrayToDblArray(Double[] doubleArray)

□ double[][] ⇔ Double[][]

ArMath.java


  /** Double[]⇒double[] */
  public static double[] convertDoubleArrayToDblArray(Double[] doubleArray) 
  /** double[][]⇒Double[][] */
  public static Double[][] convertDblArray2dToDoubleArray2d(double[][] doubleArray2d) 

□ int[] ⇔ double[]

ArMath.java


  /** int[]⇒double[] */
  public static double[] convertIntArrayToDblArray(int[] intArray) 
  /** double[]⇒int[] */
  public static int[] convertDblArrayToIntArray(double[] doubleArray) {

□ int[][] ⇔ double[][]

ArMath.java


  /** int[][]⇒double[][] */
  public static double[][] convertIntArray2dToDblArray2d(int[][] intArray2d) 
  /** double[][]⇒int[][] */
  public static int[][] convertDblArray2dToIntArray2d(double[][] doubleArray2d) 

□ Extract the specified column from double [] []

ArMath.java


  /** double[][]Extract the specified column from*/
  public static double[] extract(double[][] array,int index) 

□ Double List ⇒ Double []

ArMath.java


  /** List<Double>Double[]Convert to*/
  public static Double[] convertDoubleListToDblArray(List<Double> list) 

Aggregate values of values in a numeric array (minimum value, maximum value, total value, mean value, standard deviation)

□ Aggregate value of one-dimensional array and two-dimensional array

ArMath.java


  /**Aggregation of one-dimensional array(Maximum minimum etc.) */
  public static double calc(double[] doubleArray,ArReduceTo kind)
  /**Aggregation of two-dimensional arrays(Maximum minimum etc.) */
  public static double[] calc(double[][] doubleArray,ArReduceTo kind,ArTableRC rowCol) {

□ Maximum value calculation

ArMath.java


  /**Maximum value-collection-Integer.<br> */
  public static Integer max(Collection<Integer> values) 
  /**Maximum value-collection-double.<br> */
  public static Double maxDouble(Collection<Double> values) 
  /**Maximum value-Array-int.<br> */
  public static int max(int... values) 
  /**Maximum value-Array-double.<br> */
  public static double maxDouble(double... values) 

□ Calculation of minimum value

ArMath.java


  /**minimum value-collection-Integer.<br> */
  public static Integer min(Collection<Integer> values) 
  /**minimum value-collection-Double.<br> */
  public static Double minDouble(Collection<Double> values) 
  /**minimum value-Array-int.<br> */
  public static int min(int... values) 
  /**minimum value-Array-double.<br> */
  public static double minDouble(double... values) 

□ Calculation of total value

ArMath.java


  /**Total value-collection-Integer.<br> */
  public static Integer sum(Collection<Integer> values) 
  /**Total value-collection-Double.<br> */
  public static Double sumDouble(Collection<Double> values) 
  /**Total value-Array-int.<br> */
  public static Integer sum(int... values) 
  /**Total value-Array-double.<br> */
  public static Double sumDouble(double... values) 

□ Calculation of average value

ArMath.java


  /**Average value-collection-Integer.<br> */
  public static double avg(Collection<Integer> values) 
  /**Average value-collection-Double.<br> */
  public static double avgDouble(Collection<Double> values) 
  /**Average value-Array-int.<br> */
  public static double avg(int... values) 
  /**Average value-Array-double.<br> */
  public static double avgDouble(double... values) 

□ Calculation of standard deviation

ArMath.java


  /**standard deviation-collection-Integer.<br> */
  public static double stdDevi(Collection<Integer> values) 
  /**standard deviation-collection-Double.<br> */
  public static double stdDeviDouble(Collection<Double> values) 
  /**standard deviation-Array-int.<br> */
  public static double stdDevi(int... values) 
  /**standard deviation-Array-double.<br> */
  public static double stdDeviDouble(double... values) 

Extraction of values by conditions (large and small, etc.) from a numerical array

□ Extract those smaller than the specified value (not included)

ArMath.java


  /** LessThan-collection-Integer. */
  public static List<Integer> ltSelect(Integer boundary,Collection<Integer> values) 
  /** LessThan-collection-Double. */
  public static List<Double> ltSelectDouble(Double boundary,Collection<Double> values) 
  /** LessThan-Array-int. */
  public static List<Integer> lessThan(int boundary,int... values) 
  /** LessThan-Array-double. */
  public static List<Double> ltSelectDouble(double boundary,double... values) 

□ Extract items smaller than the specified value (including)

ArMath.java


  /** LessEqual-collection-Integer. */
  public static List<Integer> leSelect(Integer boundary,Collection<Integer> values) 
  /** LessEqual-collection-Double. */
  public static List<Double> leSelectDouble(Double boundary,Collection<Double> values) 
  /** LessEqual-Array-int. */
  public static List<Integer> lessEqual(int boundary,int... values) 
  /** LessEqual-Array-double. */
  public static List<Double> leSelectDouble(double boundary,double... values) 

□ Extract items larger than the specified value (not included)

ArMath.java


  /** GreaterThan-collection-Integer. */
  public static List<Integer> gtSelect(Integer boundary,Collection<Integer> values) 
  /** GreaterThan-collection-Double. */
  public static List<Double> gtSelectDouble(Double boundary,Collection<Double> values) 
  /** GreaterThan-Array-int. */
  public static List<Integer> greaterThan(int boundary,int... values) 
  /** GreaterThan-Array-double. */
  public static List<Double> gtSelectDouble(double boundary,double... values) 

□ Extract items larger than the specified value (including)

ArMath.java


  /** GreaterEqual-collection-Integer. */
  public static List<Integer> geSelect(Integer boundary,Collection<Integer> values) 
  /** GreaterEqual-collection-Double. */
  public static List<Double> geSelectDouble(Double boundary,Collection<Double> values) 
  /** GreaterEqual-Array-int. */
  public static List<Integer> greaterEqual(int boundary,int... values) 
  /** GreaterEqual-Array-double. */
  public static List<Double> geSelectDouble(double boundary,double... values) 

Reverse order of numeric array, randomize

□ Reverse order of numerical array, randomize

ArMath.java


  /**Reverse order of one-dimensional array*/
  public static double[] reverse(double[] doubleArray) 
  /**Randomize a one-dimensional array*/
  public static double[] randomize(double[] doubleArray) 
  /**Reverse order of rows and columns in a two-dimensional array,index is-When 1 is all Row or Column*/
  public static double[][] reverse(double[][] doubleArray,int index,ArTableRC rowCol) 
  /**Randomize rows and columns in a two-dimensional array,index is-When 1 is all Row or Column*/
  public static double[][] randomize(double[][] doubleArray,int index,ArTableRC rowCol) 

Calculation with specified numerical value of numerical array

□ Arithmetic with the specified numerical value of the numerical array-Operating the entire array

ArMath.java


  /**One-dimensional array transformation*/
  public static double[] convert(double[] doubleArray,ArCalc kind,double value) 
  /**One-dimensional array transformation*/
  public static double[] convert(double[] doubleArray,ArCreator<Double,Double> creator) throws Exception 
  /**One-dimensional array transformation.The index of the array is specified in the Integer argument of creator. */
  public static double[] convert(double[] doubleArray,ArCreator2d<Double,Integer,Double> creator) throws Exception 
  /**Two-dimensional array transformation*/
  public static double[][] convert(double[][] doubleArray,ArCalc kind,double value) 
  /**Two-dimensional array transformation*/
  public static double[][] convert(double[][] doubleArray,ArCreator<Double,Double> creator) throws Exception 
  /**Two-dimensional array transformation*/
  public static double[][] convert(double[][] doubleArray,ArCreator2d<Double,Integer,Double> creator) throws Exception 

Calculation of transition values (moving average, etc.) of a numerical array

□ Calculation of transition values (moving average, etc.) of a numerical array

ArMath.java


  /**
   *Numerical conversion using ArConvertTo.However, the histogram of kind cannot be specified..
   *param is meaningful only if.MOVING_AVG,CHANGE_RATE,CHANGE_WIDTH,PERIOD_SUM.
   *Also CHANGE_RATE,CHANGE_If 0 is specified for param in WIDTH, it will change from the initial value..
   */
  public static double[] convert(double[] array,ArConvertTo kind,int param) throws Exception 
  /**
   *Numerical conversion using ArConvertTo.However, the histogram of kind cannot be specified..
   *param is meaningful only if.MOVING_AVG,CHANGE_RATE,CHANGE_WIDTH,PERIOD_SUM.
   *Also CHANGE_RATE,CHANGE_If 0 is specified for param in WIDTH, it will change from the initial value..
   */
  public static double[] convert(double[][] array,ArConvertTo kind,int param,ArTableRC rowCol,int index) throws Exception 

Creating a histogram from a numeric array

□ Creating a histogram from a numerical array

ArMath.java


  /**
   *Create a histogram.doudary length-A value of 1 is returned.
   * boundary[0],boundary[length-1]Can be null.In that case it is interpreted as an infinite value.
   */
  public static int[] histogram(double[] array,Double[] boundary) throws Exception 
  /**Create a histogram*/
  public static int[] histogram(double[] array,ArValidator<Double>[] validators) throws Exception 

Calculation between two numeric arrays

□ Calculation between two numerical arrays

ArMath.java


  /**Operations between one-dimensional arrays*/
  public static double[] calc(double[] doubleArray0,double[] doubleArray1,ArCalc kind) 
  /**Operations between one-dimensional arrays*/
  public static double[] calc(double[] doubleArray0,double[] doubleArray1,ArCreator2d<Double,Double,Double> creator) throws Exception 
  /**Addition, subtraction, multiplication and division of rows and columns of two-dimensional array and one-dimensional array.The original 2D array is rewritten. */
  public static void calc(double[][] doubleArray0,double[] doubleArray1,int index,ArCalc kind,ArTableRC rowCol) 
  /**Two-dimensional array row / column and one-dimensional array operation.The original 2D array is rewritten.*/
  public static void calc(double[][] doubleArray0,double[] doubleArray1,int index,ArCreator2d<Double,Double,Double> creator,ArTableRC rowCol) throws Exception 

Two-stage Map related processing (ArMapOnMap) (05)

Overview

Generation of two-stage Map from (two-stage Map (Clone), Collection, ListOnMap, ArMatrix)

□ Clone the two-stage map

ArMapOnMap.java


  /**Clone*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> clone(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap) throws InstantiationException, IllegalAccessException 

□ Generate a two-stage Map from ArMatrix

ArMapOnMap.java


  /**Key0 generated from ArMatrix->key1 */
  public static <$Key0,$Key1,$Value> Map<$Key0,Map<$Key1,$Value>> constructFromArMatrixKey0Key1(ArMatrix<$Key0,$Key1,$Value> mat) 
  /**Key1 generated from ArMatrix-key0 */
  public static <$Key0,$Key1,$Value> Map<$Key1,Map<$Key0,$Value>> constructFromArMatrixKey1Key0(ArMatrix<$Key0,$Key1,$Value> mat) throws InstantiationException, IllegalAccessException

□ Generate a two-stage Map from ListOnMap

ArMapOnMap.java


  /**
   *Generate from ListOnMap.The class of the main Map is the same class as the original ListOnMap.
   *Secondary key($Key1)Is the value($Value)Generate from the field of.
   *If the generated secondary key is duplicated for the same primary key, later data will be set..
   */
  public static <$Key0,$Key1,$Value> Map<$Key0,Map<$Key1,$Value>> constructFromListOnMap(Map<$Key0,List<$Value>> listOnMap,String key1Field) throws Exception 
  /**
   *Generate from ListOnMap
   *Secondary key($key1)Is the value($Value)Generate with ArCreator from.
   *If the generated secondary key is duplicated for the same primary key, later data will be set..
   */
  public static <$Key0,$Key1,$Value> Map<$Key0,Map<$Key1,$Value>> constructFromListOnMap(Map<$Key0,List<$Value>> listOnMap,ArCreator<$Value,$Key1> creator) throws Exception {

□ Generate a two-stage Map from Collection

ArMapOnMap.java


  /**Generate from Collection$key0,$key1 is from the specified field. */
  public static <$Key0,$Key1,$Value> Map<$Key0,Map<$Key1,$Value>> constructFromCollection(Collection<$Value> collection,String key0Field,String key1Field) throws Exception
  /**Generate from Collection$key0,$key1 is generated by ArCreator. */
  public static <$Key0, $Key1, $Value> Map<$Key0,Map<$Key1,$Value>> constructFromCollection(Collection<$Value> collection,ArCreator<$Value,$Key0> creator0,ArCreator<$Value,$Key1> creator1) throws Exception  {

Conversion of two-stage Map value (specify the conversion value with Map or ArCreator)

□ Convert the value of the two-stage map

ArMapOnMap.java


  /**Change the value to the value specified in the Map.The value that is not specified remains the same. */
  public static <$PrimaryKey,$SecondaryKey,$Value> void changeValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,Map<$Value,$Value> map)
  /**Change the value in Map with ArCreator. */
  public static <$PrimaryKey,$SecondaryKey,$Value> void changeValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArCreator<$Value,$Value> creator)

Type conversion of two-stage Map value

□ Convert the value type of the two-stage Map to create a new MapO two-stage MapnMap

ArMapOnMap.java


  /**Converts the value type to the type specified in Map.Those with no value in the map are discarded. */
  public static <$PrimaryKey,$SecondaryKey,$Value,$NewValue> Map<$PrimaryKey,Map<$SecondaryKey,$NewValue>> changeValueType(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,Map<$Value,$NewValue> map) throws Exception 
  /**Converts the value type to the type specified by ArCreator.Values that are not converted by creator are discarded*/
  public static <$PrimaryKey,$SecondaryKey,$Value,$NewValue> Map<$PrimaryKey,Map<$SecondaryKey,$NewValue>> changeValueType(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArCreator<$Value,$NewValue> creator) throws Exception 

Two-stage Map key conversion

□ Convert key values.

ArMapOnMap.java


  /**Primary key conversion.The primary key with no value in keyMap remains the same. */
  public static <$PrimaryKey,$SecondaryKey,$Value> void changePrimaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,Map<$PrimaryKey,$PrimaryKey> keyMap) 
  /**Secondary key conversion.Secondary key with no value in keyMap remains original. */
  public static <$PrimaryKey,$SecondaryKey,$Value> void changeSecondaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,Map<$SecondaryKey,$SecondaryKey> keyMap) 

□ Create a new two-stage map with the primary key and secondary key exchanged

ArMapOnMap.java


  /**Replacing the primary key and secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$SecondaryKey,Map<$PrimaryKey,$Value>> exchangeKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap) throws InstantiationException, IllegalAccessException 

Convert two-stage Map to another format

□ Conversion to ListOnMap

ArMapOnMap.java


  /**Conversion to ListOnMap.Secondary key is discarded.Even if there are duplicate values, they are set as they are. */
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,List<$Value>> convertToListOnMap(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap) throws InstantiationException, IllegalAccessException 

□ Convert to List

ArMapOnMap.java


  /**Convert to List.Convert only value.Primary key and secondary key are discarded.Even if there are duplicate values, they are set as they are. */
  public static <$PrimaryKey,$SecondaryKey,$Value> List<$Value> convertToList(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap) 
  /**Convert to List.ArTriple containing key and value. */
  public static <$PrimaryKey,$SecondaryKey,$Value> List<ArTriple<$PrimaryKey,$SecondaryKey,$Value>> convertToArTripleList(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap) 
  /**Convert to List.Objects generated by ArCreator3d from keys and values. */
  public static <$PrimaryKey,$SecondaryKey,$Value, $NewValue> List<$NewValue> convertToArCreator3dList(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArCreator3d<$PrimaryKey,$SecondaryKey,$Value,$NewValue> creator) throws Exception 

□ Conversion to ArMatrix

ArMapOnMap.java


  /**Conversion to ArMatrix.ArMatrix<$SecondaryKey,$PrimaryKey,$Value>If you want to create an exchangeKey. */
  public static <$PrimaryKey,$SecondaryKey,$Value> ArMatrix<$PrimaryKey,$SecondaryKey,$Value> convertToArMatrix(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap) throws InstantiationException, IllegalAccessException 

Two-stage map count (count of the number of data when various conditions are specified)

□ Two-stage map count

ArMapOnMap.java


  /**Number of primary keys.Easy to get but define.*/
  public static <$PrimaryKey,$Secondarykey,$Value> int size(Map<$PrimaryKey,Map<$Secondarykey,$Value>> mapOnMap)
  /**Number of secondary keys under the primary key.Easy to get but define.*/
  public static <$PrimaryKey,$SecondaryKey,$Value> int size(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$PrimaryKey key) 
  /**Total number of secondary keys under the primary key.*/
  public static <$PrimaryKey,$Secondarykey,$Value> int size(Map<$PrimaryKey,Map<$Secondarykey,$Value>> mapOnMap,ArValidator<$PrimaryKey> validator) 
  /**Total number of data.Duplicate values are also counted. */
  public static <$PrimaryKey,$SecondaryKey,$Value> int countAll(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap) 
  /**Number of data under the specified primary key.get(key).size()Same as.Easy to get but define.*/
  public static <$PrimaryKey,$SecondaryKey,$Value> int countByPrimaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$PrimaryKey key) 
  /**Total number of data under the specified primary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> int countByPrimaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$PrimaryKey> validator) 
  /**Specified key Total number of data under primary key and secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> int countByKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$PrimaryKey> primaryValidator,ArValidator<$SecondaryKey> secondaryValidator) 
  /**Total number of data under the specified secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> int countSecondarykey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$SecondaryKey> secondaryValidator) 
  /**Number of specified data*/
  public static <$PrimaryKey,$SecondaryKey,$Value> int countValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$Value value) 
  /**Number of specified data*/
  public static <$PrimaryKey,$SecondaryKey,$Value> int countValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$Value> valueValidator) 

Delete two-stage map (key condition specification, value condition specification, List specification, empty element, null value)

□ Delete two-stage map

ArMapOnMap.java


  /**Specify the primary key and delete*/
  public static <$PrimaryKey,$SecondaryKey,$Value> void removeByPrimaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$PrimaryKey> pValidator) throws InstantiationException, IllegalAccessException 
  /**Specify the primary key and secondary key to delete*/
  public static <$PrimaryKey,$SecondaryKey,$Value> void removeByKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$PrimaryKey> pValidator,ArValidator<$SecondaryKey> sValidator) 
  /**Specify a secondary key and delete*/
  public static <$PrimaryKey,$SecondaryKey,$Value> void removeBySecondaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$SecondaryKey> sValidator)
  /**Specify a value to delete*/
  public static <$PrimaryKey,$SecondaryKey,$Value> void removeByValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$Value value)
  /**Specify a value to delete*/
  public static <$PrimaryKey,$SecondaryKey,$Value> void removeByValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$Value> validator)
  /**Delete the element specified by list*/
  public static <$PrimaryKey,$SecondaryKey,$Value> void removeByArTupleList(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,List<ArTuple<$PrimaryKey,$SecondaryKey>> list)
  /**Empty element(Size zero primary key for null value, secondary key for null value)To delete. */
  public static <$PrimaryKey, $SecondaryKey, $Value> void removeEmptyAndNull(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap) throws InstantiationException, IllegalAccessException

Extraction of two-stage Map value (key condition specification, value condition specification)

□ Extract the value of the specified primary key (other than), specify the primary key with ArValidator

ArMapOnMap.java


  /**Extract the value of the specified primary key.Duplicate values are also extracted. */
  public static <$PrimaryKey,$SecondaryKey,$Value> List<$Value> selectValueByPrimaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$PrimaryKey> validator)
  /**Extract values other than the specified primary key.Duplicate values are also extracted. */
  public static <$PrimaryKey,$SecondaryKey,$Value> List<$Value> selectValueByPrimaryKeyExcept(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$PrimaryKey> validator)

□ Extract the value of the specified secondary key (other than), specify the value directly for the secondary key or specify it with ArValidator

ArMapOnMap.java


  /**Extract the value of the specified secondary key.Duplicate values are also extracted. */
  public static <$PrimaryKey,$SecondaryKey,$Value> List<$Value> selectValueBySecondaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$SecondaryKey sKey) 
  /**Extract the value of the specified secondary key.Duplicate values are also extracted. */
  public static <$PrimaryKey,$SecondaryKey,$Value> List<$Value> selectValueBySecondaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$SecondaryKey> validator)
  /**Extract values other than the specified secondary key.Duplicate values are also extracted. */
  public static <$PrimaryKey,$SecondaryKey,$Value> List<$Value> selectValueBySecondaryKeyExcept(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$SecondaryKey key) 
  /**Extract values other than the specified secondary key.Duplicate values are also extracted. */
  public static <$PrimaryKey,$SecondaryKey,$Value> List<$Value> selectValueBySecondaryKeyExcept(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$SecondaryKey> validator) 

□ Extract the value of the specified value (other than), specify the value with ArValidator

ArMapOnMap.java


  /**Extract the specified value.Duplicate values are also extracted. */
  public static <$PrimaryKey,$SecondaryKey,$Value> List<$Value> selectValueByValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$Value> validator)
  /**Extract values other than the specified value.Duplicate values are also extracted. */
  public static <$PrimaryKey,$SecondaryKey,$Value> List<$Value> selectValueByValueExcept(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$Value> validator) 

Extraction of two-stage Map key (key condition specification, value condition specification)

□ Extract the primary key

ArMapOnMap.java


  /**Extract primary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Set<$PrimaryKey> selectPrimaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$PrimaryKey> pValidator) throws InstantiationException, IllegalAccessException 

□ Extract primary key and secondary key

ArMapOnMap.java


  /**Extract primary key and secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> List<ArTuple<$PrimaryKey,$SecondaryKey>> selectKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$PrimaryKey pKey,$SecondaryKey sKey) 
  /**Extract primary key and secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> List<ArTuple<$PrimaryKey,$SecondaryKey>> selectKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$PrimaryKey> pValidator,ArValidator<$SecondaryKey> sValidator) 

□ Extract the secondary key

ArMapOnMap.java


  /**Extract the secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> List<ArTuple<$PrimaryKey,$SecondaryKey>> selectSecondaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$SecondaryKey sKey) 
  /**Extract the secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> List<ArTuple<$PrimaryKey,$SecondaryKey>> selectSecondaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$SecondaryKey> sValidator) 
  /**Extract the secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Set<$SecondaryKey> secondaryKeySet(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap) 

□ Extract primary key and secondary key by value

ArMapOnMap.java


  /**Extract the key by value*/
  public static <$PrimaryKey,$SecondaryKey,$Value> List<ArTuple<$PrimaryKey,$SecondaryKey>> selectKeyByValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$Value value) 
  /**Extract the key by value*/
  public static <$PrimaryKey,$SecondaryKey,$Value> List<ArTuple<$PrimaryKey,$SecondaryKey>> selectKeyByValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$Value> validator) 

Extraction of two-stage Map elements (key condition specification, value condition specification)

□ Extract the elements of the specified primary key (other than), specify the primary key with ArValidator

ArMapOnMap.java


  /**Extract the elements of the specified primary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> selectByPrimaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$PrimaryKey> validator) 
  /**Extract elements other than the specified primary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> selectByPrimaryKeyExcept(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$PrimaryKey> validator) throws InstantiationException, IllegalAccessException

□ Extract the element of the specified secondary key (other than), specify the secondary key directly by value or by ArValidator

ArMapOnMap.java


  /**Extract the element of the specified secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> selectBySecondaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$SecondaryKey secondaryKey)
  /**Extract the element of the specified secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> selectBySecondaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$SecondaryKey> validator) 
  /**Extract elements other than the specified secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> selectBySecondaryKeyExcept(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$SecondaryKey key) 
  /**Extract elements other than the specified secondary key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> selectBySecondaryKeyExcept(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$SecondaryKey> validator) 

□ Extract elements with a specified value (other than), specify the value directly or with ArValidator

ArMapOnMap.java


  /**Extract elements with the specified value*/
  public static <$PrimaryKey, $SecondaryKey, $Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> selectByValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$Value value) throws InstantiationException, IllegalAccessException 
  /**Extract the element with the specified value with*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> selectByValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$Value> validator) throws InstantiationException, IllegalAccessException
  /**Extract elements with values other than the specified value*/
  public static <$PrimaryKey, $SecondaryKey, $Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> selectByValueExcept(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,$Value value) 
  /**Extract elements with values other than the specified value with*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> selectByValueExcept(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap,ArValidator<$Value> validator) 

Equal value judgment of two-stage map (it is also possible to judge with only the key)

□ Equal value judgment of two-stage map

ArMapOnMap.java


  /**Determine if two MapOnMaps are equal*/
  public static <$PrimaryKey,$SecondaryKey,$Value> boolean equals(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) 
  /**Determine if two MapOnMaps are equal, ignoring the value*/
  public static <$PrimaryKey,$SecondaryKey,$Value> boolean keyEquals(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) 

Two-stage Map inclusion judgment (it is also possible to judge by key only)

□ Inclusion judgment of two-stage map

ArMapOnMap.java


  /**Determines if it contains the specified MapOnMap key and value*/
  public static <$PrimaryKey,$SecondaryKey,$Value> boolean contains(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) 
  /**Determine if it contains the specified MapOnMap key*/
  public static <$PrimaryKey,$SecondaryKey,$Value> boolean containsKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) 

Set operation of two-stage map (AND, OR, XOR, EXCEPT)

□ Set operation of two-stage map

ArMapOnMap.java


  /**AND of two MapOnMap,AND with only the key.Duplicate value is the value of mapOnMap0*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> andKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) throws InstantiationException, IllegalAccessException 
  /**AND of two MapOnMap,AND by key and value. */
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> andValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) throws InstantiationException, IllegalAccessException 

  /**OR of two MapOnMap,Duplicate value is the value of mapOnMap0*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> or(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) throws InstantiationException, IllegalAccessException 
  /**EXCEPT of two MapOnMap,EXCEPT with primary key. */
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> exceptPrimaryKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) throws InstantiationException, IllegalAccessException 
  /**EXCEPT of two MapOnMap,EXCEPT with primary key and secondary key. */
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> exceptKey(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) throws InstantiationException, IllegalAccessException 
  /**EXCEPT of two MapOnMap,EXCEPT with key and value.  */
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> exceptValue(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) throws InstantiationException, IllegalAccessException 
  /**XOR of two MapOnMap,value*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> xor(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap0,Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap1) throws InstantiationException, IllegalAccessException 

ListOnMap (List on Map) Related processing (ArListOnMap) (06)

Overview

ListOnMap generation from (ListOnMap, MapOnMap, Collection)

□ Clone ListOnMap .shallow copy

ArListOnMap.java


  /**Clone ListOnMap.shallow copy.Same as constructFromListOnMap*/
  public static <$Key,$Value> Map<$Key,List<$Value>> clone(Map<$Key,List<$Value>> listOnMap) throws InstantiationException, IllegalAccessException 

□ Create ListOnMap from MapOnMap. Secondary key is lost

ArListOnMap.java


  /**Create ListOnMap from MapOnMap.Secondary key is lost. */
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,List<$Value>> constructFromMapOnMap(Map<$PrimaryKey,Map<$SecondaryKey,$Value>> mapOnMap) throws InstantiationException, IllegalAccessException 

□ Create ListOnMap from Collection

ArListOnMap.java


  /**Create ListOnMap from Collection.The key will be the specified field.If clazz is null, it will be HashMap.Duplicate values and null values are also added. */
  public static <$Key,$Value> Map<$Key,List<$Value>> constructFromCollection(Collection<$Value> collection,String keyField,Class<Map> clazz) throws InstantiationException, IllegalAccessException, NoSuchFieldException, SecurityException, IllegalArgumentException, InvocationTargetException 
  /**Create ListOnMap from Collection.The key is created with ArCreator.If clazz is null, it will be HashMap.Duplicate values and null values are also added. */
  public static <$Key, $Value> Map<$Key,List<$Value>> constructFromCollection(Collection<$Value> collection,ArCreator<$Value,$Key> creator,Class<Map> clazz) throws Exception 

ListOnMap value setting

□ Add a value. You can also ignore duplicate or null values.

ArListOnMap.java


  /**Add value.You can also ignore duplicate or null values.*/
  public static <$Key, $Value> void addValue(Map<$Key,List<$Value>> listOnMap,$Key key,$Value value,ArDuplicateAllowed dupAllowed,ArNullAllowed nullAllowed) 

□ Add the key and value specified in the Map. You can also ignore duplicate or null values.

ArListOnMap.java


  /**Add the key and value specified in the Map.You can also ignore duplicate or null values. */
  public static <$Key, $Value> void addValuesOfMap(Map<$Key,List<$Value>> listOnMap,Map<$Key,$Value> map,ArDuplicateAllowed dupAllowed,ArNullAllowed nullAllowed) 

Delete ListOnMap value

□ Delete the key where List is empty and null

ArListOnMap.java


  /**Delete the key where List is empty and null*/
  public static <$Key, $Value> void removeEmptyAndNullKey(Map<$Key,List<$Value>> listOnMap) 

□ Delete duplicate values in List

ArListOnMap.java


  /**Remove duplicate values in List*/
  public static <$Key,$Value> void removeDuplidatedValue(Map<$Key,List<$Value>> listOnMap) 

□ Delete the null value of List

ArListOnMap.java


  /**Delete the null value of List*/
  public static <$Key,$Value> void removeNullValue(Map<$Key,List<$Value>> listOnMap) 

□ Delete the specified value

ArListOnMap.java


  /**Delete the specified value*/
  public static <$Key,$Value> void removeValue(Map<$Key,List<$Value>> listOnMap,$Value value) 
  /**Delete the value specified by ArValidator*/
  public static <$Key,$Value> void removeValue(Map<$Key,List<$Value>> listOnMap,ArValidator<$Value> validator)

□ Delete the value specified in Collection

ArListOnMap.java


  /**Delete the value specified in Collection*/
  public static <$Key,$Value> void removeValue(Map<$Key,List<$Value>> listOnMap,Collection<$Value> values)

□ Delete the key / value specified in Map

ArListOnMap.java


  /**Delete the key / value specified in Map*/
  public static <$Key,$Value> void removeValue(Map<$Key,List<$Value>> listOnMap,Map<$Key,$Value> map) 

ListOnMap value count

□ Count the number of data of the key specified by ArValidator

ArListOnMap.java


  /**Count the number of data of the key specified by ArValidator*/
  public static <$Key, $Value> int countByKey(Map<$Key,List<$Value>> listOnMap,ArValidator<$Key> validator) 

□ Count the number of data with the specified value

ArListOnMap.java


  /**Count the number of data with the specified value*/
  public static <$Key, $Value> int countByValue(Map<$Key,List<$Value>> listOnMap,$Value value) 
  /**Count the number of data of the value specified by ArValidator*/
  public static <$Key, $Value> int countByValue(Map<$Key,List<$Value>> listOnMap,ArValidator<$Value> validator) 

□ Count the number of data for each key

ArListOnMap.java


  /**Count the number of data for each key*/
  public static <$Key, $Value> Map<$Key,Integer> countMap(Map<$Key,List<$Value>> listOnMap) throws InstantiationException, IllegalAccessException 

□ Count the number of data of the specified value of each key

ArListOnMap.java


  /**Counts the number of data for the specified value for each key*/
  public static <$Key, $Value> Map<$Key,Integer> countMap(Map<$Key,List<$Value>> listOnMap,$Value value) throws InstantiationException, IllegalAccessException 
  /**Counts the number of data with the value specified by ArValidtor for each key*/
  public static <$Key, $Value> Map<$Key,Integer> countMap(Map<$Key,List<$Value>> listOnMap,ArValidator<$Value> validator) throws InstantiationException, IllegalAccessException 

Extracting values from ListOnMap

□ Extracting values from ListOnMap

ArListOnMap.java


  /**Extraction of the value specified by ArValidator.Duplicate values are also extracted. */
  public static <$Key,$Value> List<$Value> selectValue(Map<$Key,List<$Value>> listOnMap,ArValidator<$Value> validator) 
  /**Extraction of values other than the specified value*/
  public static <$Key,$Value> List<$Value> selectValueExcept(Map<$Key,List<$Value>> listOnMap,$Value value) 
  /**Extraction of values other than the value specified by ArValidator*/
  public static <$Key,$Value> List<$Value> selectValueExcept(Map<$Key,List<$Value>> listOnMap,ArValidator<$Value> validator) 

Extracting keys from ListOnMap

□ Extract keys with the specified value (other than)

ArListOnMap.java


  /**Extraction of keys with the specified value*/
  public static <$Key, $Value> Set<$Key> selectKey(Map<$Key,List<$Value>> listOnMap,$Value value) 
  /**Extracting keys with values other than the specified value*/
  public static <$Key, $Value> Set<$Key> selectKeyExcept(Map<$Key,List<$Value>> listOnMap,$Value value) 

□ Extraction of keys with values (other than) specified by ArValidator

ArListOnMap.java


  /**Extraction of keys with the value specified by ArValidator*/
  public static <$Key, $Value> Set<$Key> selectKey(Map<$Key,List<$Value>> listOnMap,ArValidator<$Value> validator)
  /**Extraction of keys with values other than those specified by ArValidator*/
  public static <$Key,$Value> Set<$Key> selectKeyExcept(Map<$Key,List<$Value>> listOnMap,ArValidator<$Value> validator)

Extracting elements from ListOnMap

□ Extraction of elements with the specified value (other than)

ArListOnMap.java


  /**Extraction of elements with the specified value*/
  public static <$Key,$Value> Map<$Key,List<$Value>> selectByValue(Map<$Key,List<$Value>> listOnMap,$Value value) throws InstantiationException, IllegalAccessException
  /**Extraction of elements with values other than the specified value*/
  public static <$Key,$Value> Map<$Key,List<$Value>> selectByValueExcept(Map<$Key,List<$Value>> listOnMap,$Value value) throws InstantiationException, IllegalAccessException

□ Extraction of elements with values (other than) specified by ArValidator

ArListOnMap.java


  /**Extraction of elements with the value specified by ArValidator*/
  public static <$Key,$Value> Map<$Key,List<$Value>> selectByValue(Map<$Key,List<$Value>> listOnMap,ArValidator<$Value> validator) throws InstantiationException, IllegalAccessException
  /**Extraction of elements with values other than the value specified by ArValidator*/
  public static <$Key,$Value> Map<$Key,List<$Value>> selectByValueExcept(Map<$Key,List<$Value>> listOnMap,ArValidator<$Value> validator) throws InstantiationException, IllegalAccessException

□ Extract elements with List that satisfies (does not satisfy) ArValidator

ArListOnMap.java


  /**Extract elements with List that satisfies ArValidator*/
  public static <$Key,$Value> Map<$Key,List<$Value>> selectByList(Map<$Key,List<$Value>> listOnMap,ArValidator<List<$Value>> validator) throws InstantiationException, IllegalAccessException
  /**Extract elements with Lists that do not satisfy ArValidator*/
  public static <$Key,$Value> Map<$Key,List<$Value>> selectByListExcept(Map<$Key,List<$Value>> listOnMap,ArValidator<List<$Value>> validator) throws InstantiationException, IllegalAccessException

Convert ListOnMap value Convert to the value specified by Map or ArCreator

□ Convert ListOnMap value Convert to the value specified by Map or ArCreator

ArListOnMap.java


  /**Convert a value from a Map key to a Map value.Convert all duplicate values in List.Values that do not correspond to Map remain unchanged*/
  public static <$Key,$Value> void convertValue(Map<$Key,List<$Value>> listOnMap,Map<$Value,$Value> map) throws Exception 
  /**Convert values with ArCreator.Convert all duplicate values in List.The value returned by null in ArCreator remains the same*/
  public static <$Key,$Value> void convertValue(Map<$Key,List<$Value>> listOnMap,ArCreator<$Value,$Value> creator) throws Exception

ListOnMap value type conversion Convert to the type specified in Map or ArCreator

□ Convert ListOnMap value type Convert to the type specified by Map or ArCreator

ArListOnMap.java


  /**Convert a value from a Map key to a Map value.Values that do not correspond to Map are discarded*/
  public static <$Key, $Value, $NewValue> Map<$Key,List<$NewValue>> convertValueType(Map<$Key,List<$Value>> listOnMap,Map<$Value,$NewValue> map) throws Exception 
  /**Convert values with ArCreator.Values returned null in ArCreator are discarded*/
  public static <$Key, $Value, $NewValue> Map<$Key,List<$NewValue>> convertValueType(Map<$Key,List<$Value>> listOnMap,ArCreator<$Value,$NewValue> creator) throws Exception 

Converting ListOnMap to other formats

□ Convert to a two-stage map. Secondary key is a specified field

ArListOnMap.java


  /**Convert to a two-stage map.Secondary key is the specified field*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> convertToMapOnMap(Map<$PrimaryKey,List<$Value>> listOnMap,String sKey,Class secondaryMapClass) throws Exception 

□ Convert to a two-stage map. The secondary key is $ Value converted by ArCreator.

ArListOnMap.java


  /**Convert to a two-stage map.The secondary key is$Value converted with ArCreator*/
  public static <$PrimaryKey,$SecondaryKey,$Value> Map<$PrimaryKey,Map<$SecondaryKey,$Value>> convertToMapOnMap(Map<$PrimaryKey,List<$Value>> listOnMap,ArCreator<$Value,$SecondaryKey> creator,Class secondaryMapClass) throws Exception 

□ Convert to List. Keys are discarded

ArListOnMap.java


  /** List<$Value>Convert to.The key is thrown away*/
  public static <$Key,$Value> List<$Value> convertToList(Map<$Key,List<$Value>> listOnMap) 

□ Convert key and value with ArCreator2d to create List

ArListOnMap.java


  /**Key($Key)And value($Value)With ArCreator 2d$Convert to NewValue and List<$NewValue>To create.  */
  public static <$Key,$Value,$NewValue> List<$NewValue> convertToListByArCreator2d(Map<$Key,List<$Value>> listOnMap,ArCreator2d<$Key,$Value,$NewValue> creator) throws Exception

□ Create a List of ArTuple of keys and values

ArListOnMap.java


  /** List<ArTuple<$Key,$Value>>Convert to*/
  public static <$Key, $Value> List<ArTuple<$Key,$Value>> convertToListOfArTuple(Map<$Key,List<$Value>> listOnMap) 

□ Convert List with ArCreator

ArListOnMap.java


  /**Convert List with ArCreator*/
  public static <$Key,$Value,$NewValue> Map<$Key,$NewValue> convertListByArCreator(Map<$Key,List<$Value>> listOnMap,ArCreator<List<$Value>,$NewValue> creator) throws Exception 

Set operation of two ListOnMap

□ Set operation of two ListOnMap

ArListOnMap.java


  /**AND two ListOnMaps.Not only the key but also the elements of List are ANDed.There are no duplicate values in the resulting List. */
  public static <$Key,$Value> Map<$Key,List<$Value>> and(Map<$Key,List<$Value>> listOnMap0,Map<$Key,List<$Value>> listOnMap1) throws InstantiationException, IllegalAccessException 
  /**OR two ListOnMaps.The resulting List can contain duplicate values*/
  public static <$Key,$Value> Map<$Key,List<$Value>> or(Map<$Key,List<$Value>> listOnMap0,Map<$Key,List<$Value>> listOnMap1) throws InstantiationException, IllegalAccessException 
  /**XOR two ListOnMaps with a key*/
  public static <$Key,$Value> Map<$Key,List<$Value>> xorKey(Map<$Key,List<$Value>> listOnMap0,Map<$Key,List<$Value>> listOnMap1) throws InstantiationException, IllegalAccessException 
  /**XOR two ListOnMaps.XOR with key.XOR List for same key*/
  public static <$Key,$Value> Map<$Key,List<$Value>> xorList(Map<$Key,List<$Value>> listOnMap0,Map<$Key,List<$Value>> listOnMap1) throws InstantiationException, IllegalAccessException 
  /**EXCEPT two ListOnMaps with a key*/
  public static <$Key,$Value> Map<$Key,List<$Value>> exceptKey(Map<$Key,List<$Value>> listOnMap0,Map<$Key,List<$Value>> listOnMap1) throws InstantiationException, IllegalAccessException 
  /**EXCEPT two ListOnMaps.EXCEPT with the key.EXCEPT with the same key in List*/
  public static <$Key,$Value> Map<$Key,List<$Value>> exceptList(Map<$Key,List<$Value>> listOnMap0,Map<$Key,List<$Value>> listOnMap1) throws InstantiationException, IllegalAccessException 

Equal value judgment of two ListOnMap

□ Equal value judgment of two ListOnMap

ArListOnMap.java


  /**Equal value judgment of two ListOnMap.Ignore duplicate values, ignore order, and ignore null values can be specified for List judgment.*/
  public static <$Key,$Value> boolean equals(Map<$Key,List<$Value>> listOnMap0,Map<$Key,List<$Value>> listOnMap1,ArSeqIgnore seqIgnore,ArNullIgnore nullIgnore,ArDuplicateIgnore dupIgnore) 
  /**Get the key containing the specified List.Ignore duplicate values, ignore order, and ignore null values can be specified for List judgment.*/
  public static <$Key, $Value> Set<$Key> selectKeyByList(Map<$Key,List<$Value>> listOnMap,List<$Value> list,ArSeqIgnore seqIgnore,ArNullIgnore nullIgnore,ArDuplicateIgnore dupIgnore) 

Data structure construction class (Artery original) (01)

ArBiMap-Bidirectional Map

The terms "key" and "value" are used for convenience, but there is no functional distinction between the two.

Overview

ArBiMap generation

□ Constructor

ArBiMap.java


  /**constructor.  */
  public ArBiMap()

□ Generate from ArBiMap

ArBiMap.java


  /**constructor.Create from ArBiMap*/
  public ArBiMap(ArBiMap<T0,T1> biMap) 

□ Generate from two arrays

ArBiMap.java


  /**constructor.Create an ArBiMap from two arrays. */
  public ArBiMap(T0[] keys,T1[] values) 

□ Generate from Map

ArBiMap.java


  /**constructor.Generate ArBiMap from Map.*/
  public static <T0,T1> ArBiMap<T0,T1> constructFromMap(Map<T0,T1> map) 

□ Generate from a two-dimensional array

ArBiMap.java


  /**constructor.Generate from a two-dimensional array.Key index is 0, value index is 1. */
  public <T> ArBiMap(T[][] keysAndValues) 
  /**constructor.Create an ArBiMap by specifying key and value indexes from a two-dimensional array.*/
  public ArBiMap(T0[][] keysAndValues,int keyIndex,int valueIndex) 

□ Generate from Tagged Csv

ArBiMap.java


  /**constructor.Create from Tagged Csv. */
  public ArBiMap(String str) 

ArBiMap settings / acquisition / deletion

□ Key ⇒ Set Value.

ArBiMap.java


  /**Set Key ⇒ Value.   */
  public void putKeyValue(T0 key,T1 value)

□ Get Value from Key

ArBiMap.java


  /**Get Value from Key.  */
  public T1 getByKey(T0 key)

□ Get the key from Value

ArBiMap.java


  /**Get the key from Value.  */
  public T0 getByValue(T1 value)

□ Get a list of keys

ArBiMap.java


  /**Get a list of keys. */
  public Set<T0> keySet()

□ Get a list of values.

ArBiMap.java


  /**Get a list of values. */
  public Set<T1> valueSet()

□ Delete based on the key. The corresponding Value is returned.

ArBiMap.java


  /**Delete based on the key.The corresponding Value is returned.*/
  public T1 removeByKey(T0 key)

□ Delete based on Value. The corresponding Key is returned.

ArBiMap.java


  /**Delete based on Value.The corresponding Key is returned. */
  public T0 removeByValue(T1 value)

□ Clear.

ArBiMap.java


  /**clear. */
  public void clear() 

Confirmation of existence of ArBiMap key and value

□ Return the number of data.

ArBiMap.java


  /**Return the number of data. */
  public int size() 

□ Confirmation of key existence.

ArBiMap.java


  /**Confirmation of key existence. */
  public boolean containsKey(T0 key) 
  /**Confirmation of key existence*/
  public boolean containsKey(ArValidator<T0> validator)

□ Confirmation of the existence of the value.

ArBiMap.java


  /**Confirmation of existence of value. */
  public boolean containsValue(T1 value) 
  /**Confirmation of existence of value*/
  public boolean containsValue(ArValidator<T1> validator) 

Extraction of ArBiMap elements

□ Extract keys that satisfy (do not) meet the conditions

ArBiMap.java


  /**Get a list of keys that satisfy a validator*/
  public Set<T0> selectKey(ArValidator<T0> validator) throws InstantiationException, IllegalAccessException 
  /**Get a list of keys that do not satisfy the validator*/
  public Set<T0> selectKeyExcept(ArValidator<T0> validator) throws InstantiationException, IllegalAccessException 

□ Extract values that satisfy (do not) satisfy the conditions

ArBiMap.java


  /**Get a list of values that satisfy a validator*/
  public Set<T1> selectValue(ArValidator<T1> validator) throws InstantiationException, IllegalAccessException 
  /**Get a list of values that do not satisfy the validator*/
  public Set<T1> selectValueExcept(ArValidator<T1> validator) throws InstantiationException, IllegalAccessException 

□ Extract elements with keys that satisfy (do not) satisfy the conditions

ArBiMap.java


  /**Create a new ArBiMap by selecting the key with the validator.  */
  public ArBiMap<T0,T1> selectByKey(ArValidator<T0> validator) 
  /**Create a new ArBiMap by selecting a key that does not match the validator.  */
  public ArBiMap<T0,T1> selectByKeyExcept(ArValidator<T0> validator)

□ Extract elements with values that satisfy (do not) satisfy the conditions

ArBiMap.java


  /**Create a new ArBiMap by selecting a value with the validator.  */
  public ArBiMap<T0,T1> selectByValue(ArValidator<T1> validator) 
  /**Create a new ArBiMap by selecting values that do not match the validator.  */
  public ArBiMap<T0,T1> selectByValueExcept(ArValidator<T1> validator) 

Conversion to other structures of ArBiMap

□ Convert to Map

ArBiMap.java


  /**Convert to Map.Key → value*/
  public Map<T0,T1> toMap() 
  /**Convert to Map.Value → key*/
  public Map<T0,T1> toReverseMap() 

□ Convert key to another key shown in Map

ArBiMap.java


  /**Convert a key to another key shown in Map*/
  public void changeKey(Map<T0,T0> map) 

□ Convert a value to another value shown in Map

ArBiMap.java


  /**Convert a value to another value shown in the Map*/
  public void changeValue(Map<T1,T1> map) 

Logical operation of two ArBiMap

□ AND

ArBiMap.java


  /**AND with key to create a new ArBiMap*/
  public static ArBiMap<T0,T1> andKey(ArBiMap<T0,T1> biMap0,ArBiMap<T1,T1> biMap1)
  /**AND by value to create a new ArBiMap*/
  public static ArBiMap<T0,T1> andValue(ArBiMap<T0,T1> biMap0,ArBiMap<T1,T1> biMap1)

□ OR

ArBiMap.java


  /**OR with key to create a new ArBiMap*/
  public static ArBiMap<T0,T1> orKey(ArBiMap<T0,T1> biMap0,ArBiMap<T1,T1> biMap1)
  /**OR by value to create a new ArBiMap*/
  public static ArBiMap<T0,T1> orValue(ArBiMap<T0,T1> biMap0,ArBiMap<T1,T1> biMap1)

□ XOR

ArBiMap.java


  /**XOR with key to create a new ArBiMap*/
  public static ArBiMap<T0,T1> xorKey(ArBiMap<T0,T1> biMap0,ArBiMap<T1,T1> biMap1)
  /**XOR by value to create a new ArBiMap*/
  public static ArBiMap<T0,T1> xorValue(ArBiMap<T0,T1> biMap0,ArBiMap<T1,T1> biMap1)

□ EXCEPT

ArBiMap.java


  /**EXCEPT with key to create a new ArBiMap*/
  public static ArBiMap<T0,T1> exceptKey(ArBiMap<T0,T1> biMap0,ArBiMap<T1,T1> biMap1)
  /**EXCEPT by value to create a new ArBiMap*/
  public static ArBiMap<T0,T1> exceptValue(ArBiMap<T0,T1> biMap0,ArBiMap<T1,T1> biMap1)

ArMatrix --Two-dimensional Map

Overview

ArMatrix generation

□ Constructor

ArMatrix.java


  /**constructor. */
  public ArMatrix()
  /**constructor*/
  public ArMatrix(ArMatrix<T0,T1,T2> mat)

□ Generate ArMatrix from a two-stage map

ArMatrix.java


  /**Generate ArMatrix from two-stage Map*/
  public ArMatrix(ArMatrix<T0,T1,T2> mat) 

□ Generate ArMatrix by specifying the key field from Collection

ArMatrix.java


  /**constructor.Generated by specifying the key field from Collection*/
  public ArMatrix(Collection<T2> collection,String key0Field,String key1Field) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException

□ Generate ArMatrix by specifying ArCreator from Collection

ArMatrix.java


  /**constructor.Generated by specifying ArCreator from Collection*/
  public ArMatrix(Collection<T2> collection,ArCreator<T2,T0> key0Creator,ArCreator<T2,T1> key1Creator) throws Exception {

Set, get, and delete ArMatrix values

□ Set update mode. Depending on this value, put is ignored

ArMatrix.java


  /**
   *Set update mode.Depending on this value, put will be ignored.The initial value is ALWAYS.
   *  mode : ArUpdateMode.ALWAYS Always add / update
   *  mode : ArUpdateMode.NOT Always add / update
   *  mode : ArUpdateMode.IF_Update the EXISTS key if it exists
   *  mode : ArUpdateMode.IF_NOT_Add the EXISTS key if it does not exist
   */
  public void setUpdateMode(ArUpdateMode mode)

□ Set the value. Get the value.

ArMatrix.java


  /**Set the value. */
  public void put(T0 key0,T1 key1,T2 value) 
  /**Get the value. */
  public T2 get(T0 key0,T1 key1)

□ Get Map with key 0.

ArMatrix.java


  /**Get Map with key 0. */
  public Map<T1,T2> getByKey0(T0 key0) 

□ Get Map with key 1.

ArMatrix.java


  /**Get Map with key 1. */
  public Map<T0,T2> getByKey1(T1 key1) 

□ Get the list of key 0. Get the list of key 1.

ArMatrix.java


  /**Get a list of key 0. */
  public Set<T0> key0Set() 
  /**Get a list of key 1. */
  public Set<T1> key1Set() 

□ Get a list of values.

ArMatrix.java


  /**Get a list of values.If there is the same value, it will be acquired more than once..Null value is not retrieved. */
  public List<T2> values() 

□ Delete value ..

ArMatrix.java


  /**Delete value.. */
  public T2 remove(T0 key0,T1 key1) 

□ Delete element with key0 ..

ArMatrix.java


  /**Delete element with key0.. */
  public void removeByKey0(T0 key0) 

□ Delete element with key1.

ArMatrix.java


  /**Delete element with key1.. */
  public void removeByKey1(T1 key1) 

□ Clear all data.

ArMatrix.java


  /**Clear all data. */
  public void clear() 

Confirmation of existence of ArMatrix

□ Confirmation of key existence

ArMatrix.java


  /**Confirmation of key existence. */
  public boolean containsKey(T0 key0,T1 key1) 

□ Confirmation of element existence

ArMatrix.java


  /**Confirmation of element existence*/
  public boolean containsElement(T0 key0,T1 key1,T2 value) 

□ Confirmation of existence of value

ArMatrix.java


  /**Confirmation of existence of value*/
  public boolean containsValue(T2 value) 
  /**Confirmation of existence of value*/
  public boolean containsValue(ArValidator<T2> validator) 

□ Count the number of elements

ArMatrix.java


  /**Return the total number of data. */
  public int totalSize() 
  /**Count the number of elements that match the value. */
  public int countValue(T2 value) 
  /**Count the number of elements that match the value. */
  public int countValue(ArValidator<T2> validator) 

Extracting ArMatrix elements

□ Extraction of elements that match (do not match) key 0

ArMatrix.java


  /**Create a new ArMatrix by selecting Key0 that matches the validator. */
  public ArMatrix<T0,T1,T2> selectByKey0(ArValidator<T0> validator)  
  /**Create a new ArMatrix by selecting Key0 that does not match the validator. */
  public ArMatrix<T0,T1,T2> selectByKey0Except(ArValidator<T0> validator) 

□ Extraction of elements that match (do not match) key 1

ArMatrix.java


  /**Create a new ArMatrix by selecting the Key1 that matches the validator.*/
  public ArMatrix<T0,T1,T2> selectByKey1(ArValidator<T1> validator) 
  /**Create a new ArMatrix by selecting Key1 that does not match the validator. */
  public ArMatrix<T0,T1,T2> selectByKey1Except(ArValidator<T1> validator)  

□ Extraction of elements that match (do not match) the value

ArMatrix.java


  /**Select by value to create a new ArMatrix. */
  public ArMatrix<T0,T1,T2> selectByValue(T2 element) 
  /**Create a new ArMatrix by selecting with a value that matches the validator. */
  public ArMatrix<T0,T1,T2> selectByValue(ArValidator<T2> validator) 
  /**Create a new ArMatrix by selecting a value that does not match the validator. */
  public ArMatrix<T0,T1,T2> selectByValueExcept(ArValidator<T2> validator) 

ArMatrix conversion

□ Swap key0 and key1

ArMatrix.java


  /**Swap key0 and key1*/
  public ArMatrix<T1,T0,T2> exchangeKey() 

□ Batch convert values

ArMatrix.java


  /**Change the value to the value shown in the valueMap.Other values remain unchanged*/
  public void changeValue(Map<T2,T2> valueMap) 
  /**Create an ArMatrix with values converted to T3 objects with creator. */
  public <T3> ArMatrix<T0,T1,T3> convert(ArCreator<T2,T3> creator) throws Exception 

□ Convert to MapOnMap.

ArMatrix.java


  /**Convert to MapOnMap. */
  public Map<T0,Map<T1,T2>> toMapOnMap() throws InstantiationException, IllegalAccessException 

Logical operation of two ArMatrix

□ AND operation with other ArMatrix

ArMatrix.java



□ OR operation with other ArMatrix

ArMatrix.java



□ XOR operation with other ArMatrix

ArMatrix.java



□ EXCEPT operation with other ArMatrix

ArMatrix.java



Important interface (02)

There are quite a few interfaces, but here are some: These play an important role in programming using this library, but they are also used considerably inside this library.

ArValidator --One argument ⇒ true / false (02_00)

Definition

ArValidator.java


/**Interface to determine the validity of a specified object. */
public interface ArValidator<T> {
  /**
   *Determine the specified object.
   *  @param value Judgment target object.
   */
  public boolean check(T value)

Example of use

ArValidator2d --Two arguments ⇒ true / false (02_01)

Definition

ArValidator2d.java


/**An interface that checks the validity based on two values*/
public interface ArValidator2d<$arg0,$arg1> {
  /**Check the value*/
  public boolean check($arg0 arg0,$arg1 arg1)
}

Example of use

ArCreator-Converts one argument to another (02_02)

Definition

ArCreator.java


/**Interface that creates another object from the specified object. */
public interface ArCreator<T0,T1> {
  /**Create a T1 class object from obj.I don't know what the implementation is doing, so throw an Exception. */
  public T1 convert(T0 obj) throws Exception;
}

Example of use

ArCreator2d-Convert two arguments to different values (02_03)

Definition

ArCreator2d.java


/**An interface that generates another value based on two values*/
public interface ArCreator2d<$Arg0,$Arg1,$Value> {
  /**From arg0 and arg1$Create an object of value class.I don't know what the implementation is doing, so throw an Exception. */
  public $Value convert($Arg0 arg0,$Arg1 arg1) throws Exception;
}

Example of use

ArCreator3d-Convert three arguments to different values (02_04)

Definition

ArCreator3d.java


/**Interface that generates another value based on three values*/
public interface ArCreator3d<$Arg0,$Arg1,$Arg2,$Value> {
  /**From arg0 and arg1$Create an object of value class.I don't know what the implementation is doing, so throw an Exception. */
  public $Value convert($Arg0 arg0,$Arg1 arg1,$Arg2 arg2) throws Exception;
}

Example of use

Data retention class (03)

Tuple (ArTuple)-Tuples of data (03_00)

Overview

A class that represents two sets of data. Apart from that, you can store one arbitrary object.

ArTriple-Triple data (03_01)

Overview

A class that represents a triplet of data. Apart from that, you can store one arbitrary object.

CSV (ArCsv) --Comma delimited string (03_02)

Overview

A class that represents a comma-separated string. The delimiter can be customized.

TaggedCSV (ArTaggedCsv)-Comma separated double string (03_03)

Overview

A class that expresses the following character strings. The delimiter can be customized. name=suzuki,address=tokyou,age=30

String processing (04)

Processing of character strings

□ Uppercase the first letter.

ArStr.java


  /**Uppercase the first letter. */
  public static String topUpper(String str) 

□ Make the first letter lowercase.

ArStr.java


  /**Make the first letter lowercase. */
  public static String topLower(String str)

□ Convert to title case (first uppercase letter, last lowercase letter)

ArStr.java


  /**Title case(First uppercase letter, last lowercase letter)Convert to*/
  public static String toTitleCase(String str)

□ Enclose the string in parentheses.

ArStr.java


  /**
   *Enclose the string in parentheses.bracket size is 2.
   *bracket is()Or[], [] Etc..This method does not check that it is in parentheses.
   */
  public static String wrapBracket(String str,String[] bracket)

□ Extract the character string in parentheses.

ArStr.java


  /**
   *Extract the character string in parentheses.
   *If both ends of str do not match bracket, return the original str.
   *  @param bracket String[2],Represents parentheses at both ends.Note, I haven't checked if it's in parentheses.
   */
  public static String unwrapBracket(String str,String[] bracket) 
  /**CharDef on both ends.BRACKET_If it matches any of the LIST, remove the parentheses at both ends and return. */
  public static String unwrapBracket(String str) 

□ String replacement

ArStr.java


  /**
   *Replace oldStr in str with newStr.If there are multiple oldStr, replace them all.
   *Note, creation intention.Because symbol is a regular expression in replaceAll of String, I want to replace it with something that is not a regular expression..
   */
  public static String replaceAll(String str,String oldStr,String newStr) 

Number of characters and bytes

□ Calculate the number of bytes in a string.

ArStr.java


  /**Calculate the number of bytes in a string. */
  public static long byteLength(String str,String charset) throws UnsupportedEncodingException

□ Delete the end of the character string so that it has the specified number of bytes.

ArStr.java


  /**Delete the end of the string so that it has the specified number of bytes. */
  public static String deleteLast(String str,String charSet,long len) throws UnsupportedEncodingException 

□ Add a space so that the specified number of bytes is reached.

ArStr.java


  public static String append(String str,String charSet,long len) throws UnsupportedEncodingException 

□ Add characters to the specified length.

ArStr.java


  /**
   *Later letters(val)To make it the specified length.
   *The length of val is 1(Otherwise do not convert).
   */
  public static String append(String str,int len,String val)

□ Insert a character in front to make it the specified length.

ArStr.java


  /**
   *Letter before(val)To the specified length.
   *The length of val is 1(Otherwise do not convert).
   */
  public static String insert(String str,int len,String val) 

□ Repeat the string the specified number of times.

ArStr.java


  /**Repeat the string a specified number of times. */
  public static String repeat(String str,Integer cnt) 

Space-related judgment and conversion

□ Convert null to the empty string ("").

ArStr.java


  /**
   *null to empty string("")Convert to.
   *If not null, return the original string.
   */
  public static String nullToEmpty(String str) 

□ Determine if it is null or an empty string ("").

ArStr.java


  /**null or empty string("")Determine if. */
  public static boolean isNullOrEmpty(String s) 

□ Make sure it is neither null nor an empty string ("").

ArStr.java


  /**Empty string, not null("")Make sure it's not. */
  public static boolean isNotNullOrEmpty(String s) 

□ Determine if it is a space or tab.

ArStr.java


  /**Determine if it is a space or tab. */
  public static Boolean isSpace(String s) 

□ Determine if it is a space, tab, or double-byte space.

ArStr.java


  /**Determine if it is a space, tab, or double-byte space. */
  public static Boolean isJSpace(String s) 

□ Determine if the beginning is a space, tab, or double-byte space.

ArStr.java


  /**Determine if the beginning is a space, tab, or double-byte space. */
  public static boolean startsWithJSpace(String s) 

□ Determine if the last is a space, tab, or double-byte space.

ArStr.java


  /**Determine if the last is a space, tab, or double-byte space. */
  public static Boolean endsWithJSpace(String s) 

□ Full-width ⇒ half-width space conversion.

ArStr.java


  /**Full-width ⇒ half-width space conversion. */
  public static String jSpaceToESpace(String str) 

□ Half-width ⇒ full-width space conversion.

ArStr.java


  /**Half-width ⇒ full-width space conversion. */
  public static String eSpaceToJSpace(String str) 

□ Delete the previous (space, tab).

ArStr.java


  /**Before(Spaces, tabs)To delete. */
  public static String trimLeadingESace(String str) 

□ Delete the front (space, tab, double-byte space).

ArStr.java


  /**Before(Spaces, tabs, double-byte spaces)To delete. */
  public static String trimLeadingJSace(String str) 

□ Delete after (space, tab).

ArStr.java


  /**rear(Spaces, tabs)To delete. */
  public static String trimTrailingESace(String str)  

□ Delete after (space, tab, double-byte space).

ArStr.java


  /**rear(Spaces, tabs, double-byte spaces)To delete. */
  public static String trimTrailingJSace(String str) {

□ Delete spaces, tabs, and double-byte spaces before and after.

ArStr.java


  /**Delete leading and trailing spaces, tabs, and double-byte spaces.String.trim()Extension of. */
  public static String trim(String str) {

□ Combine multiple spaces and tabs into one.

ArStr.java


  /**
   *Combine multiple spaces and tabs into one.
   * @param str Character string to be processed
   * @param collect processing method, SPACE_ONLY:Only space, TAB_ONLY:Tab only, EACH:Separate spaces and tabs, BOTH:Process spaces and tabs together(The result is space)
   * @return Processing result string
   */
  public static String collectSpaceTab(String str,ArSpaceTabCollect collect) 

Right-justified, left-justified, centering

□ Left justified, right justified, centering

ArStr.java


  /**
   *Left justify.
   *width is the finished width(word count).
   *When the width is not enough, cut is ArCut.If YES, shrink to width, ArCut.If NO, return str as it is.
   */
  public static String lefting(String str,int width,ArCut cut) 
  /**
   *Right justify.
   *width is the finished width(word count).
   *When the width is not enough, cut is ArCut.If YES, shrink to width, ArCut.If NO, return str as it is.
   */
  public static String righting(String str,int width,ArCut cut) 
  /**
   *Centering.
   *width is the finished width(word count).
   *When the width is not enough, cut is ArCut.If YES, shrink to width, ArCut.If NO, return str as it is.
   */
  public static String centering(String str,int width,ArCut cut) 

Quotation marks

□ Add quotes, remove quotes

ArStr.java


  /**
   *Quotes on both ends(")To delete.
   *If there are no quotes, just return.
   */
  public static String removeQuote(String str) 
  /**
   *Put quotation marks on both ends.
   *Escape if there are quotes inside.
   */
  public static String quote(String str) 

Character type check

□ Character type check

ArStr.java


  /**Alphabet. */
  public static boolean is_Alpha(String str) 
  /**First letter. */
  public static boolean is_TopAlpha(String str) 
  /**Alphanumeric. */
  public static boolean is_AlphaNumeric(String str) 
  /**First letter, then alphanumeric. */
  public static boolean is_TopAlpha_AlphaNumeric(String str) 
  /**English letters. */
  public static boolean is_UAlpha(String str) 
  /**First big letter. */
  public static boolean is_TopUAlpha(String str) 
  /**First large alphabet, rear alphabet. */
  public static boolean is_TopUAlpha_Alpha(String str) 
  /**First alphabet, last alphanumeric. */
  public static boolean is_TopUAlpha_AlphaNumeric(String str) 
  /**First large alphabet, second large alphanumeric characters. */
  public static boolean is_TopUAlpha_UAlphaNumeric(String str) 
  /**Small alphabet. */
  public static boolean is_LAlpha(String str) 
  /**First small alphabet. */
  public static boolean is_TopLAlpha(String str) 
  /**First small alphabet, rear alphabet. */
  public static boolean is_TopLAlpha_Alpha(String str) 
  /**First small letters, last alphanumeric characters. */
  public static boolean is_TopLAlpha_AlphaNumeric(String str) 
  /**First small alphabet, last small alphanumeric characters. */
  public static boolean is_TopLAlpha_LAlphaNumeric(String str) 
  /**java identifier. */ //Numbers, letters,_ $  //Other than numbers can be at the beginning
  public static boolean is_JavaIdentifier(String str) 
  /**Numbers.Note, it is better to parse with Integer. */
  public static boolean is_Numeric(String str) 
  /**Numbers other than leading 0, trailing numbers. */
  public static boolean is_TopNonZeroNumeric_Numeric(String str) 
  /**Numbers(Comma every three digits). */
  public static boolean is_CommaNumeric(String str) 
  /**Postal code. */
  public static boolean is_PostalCode(String str) 
  /**cell phone number. */
  public static boolean is_Cellular(String str) 

String replacement

ArStr.java


  /**In the string${xxxx}Format variables names[xxxx]Corresponding to vals[]Replace with the value of. */
  public static String replaceSymbols(String str,String[] symbols,String[] vals) 
  /**In the string${xxxx}Replace the variable of the format with the value of the xxxx key of Map. */
  public static String replaceSymbols(String str,Map<String,String> map) 
  /** ${xxx}Extract the format xxx.Same thing or multiple times but only once. */
  public static Set<String> getVariableSymbols(String str) 

Processing of character string representing date and time

ArStr.java


  /**
   *  ${DATExxxx}With the current date and time.
   *xxxx is a format handled by SimpleDateFormat.
   */
  public static String replaceByDate(String str) 
  /**
   *  ${DATExxxx}Replace with date and time etc..
   *xxxx is a format handled by SimpleDateFormat.
   */
  public static String replaceByDate(String str,java.util.Date date) 
  /**
   *  ${DATExxxx}Replace with date and time etc..
   *xxxx is a format handled by SimpleDateFormat.
   */
  public static String replaceByDate(String str,java.util.Calendar cal) 
  /**
   *  ${DATExxxx}Replace with date and time etc..
   *xxxx is a format handled by SimpleDateFormat.
   */
  public static String replaceByDate(String str,long time) 

Processing of character strings representing numbers

□ Processing of character strings representing numbers

ArStr.java


  /**
   *Character before str(val)To the specified length.
   *Returns null if null.
   *The length of val is 1(Do not convert).
   *Note, NumStr has the same method, which calls this method.
   */
  public static String insertTop(String str,int len,String val) 
  /**Insert a comma every three digits. */
  public static String insertComma(String val) 
  /**Delete the previous zero.Same as deleteLeadingZero. */
  public static String removeLeadingZero(String str) 

Divide the string into an array, List, Set

□ Divide the character string into an array, List, Set

ArStr.java


  /**comma(Such)Divide with and make an array.(String.Redefinition of split). */
  public static String[] splitToArray(String str,char sep) 
  /**comma(Such)Divide with and make a list. */
  public static List<String> splitToList(String str,char sep) 
  /**Divide with commas to make a set.(Since it is a set, it will be aggregated if the elements are duplicated). */
  public static Set<String> splitToSet(String str,char sep) throws InstantiationException, IllegalAccessException 

String concatenation

□ Combine strings

ArStr.java


  /**Combine str with sep for count times. */
  public static String join(char sep,String str,int count) 
  /**Join List of Strings with sep. */
  public static String join(char sep,List<String> values) 
  /**Combine variable arguments of String1 with sep. */
  public static String join(char sep,String... values) 
  /**Combine Set of String1 with sep. */
  public static String join(char sep,Set<String> values) 

String comparison ignoring line breaks, case, and spaces / tabs

ArStr.java


  /**
   *Compare strings.
   * @param arCase Whether to ignore case
   * @param arSpace space/Whether to ignore tabs.Note, if YES, compare multiple spaces and tabs as one space..
   * @param arBreak Whether to ignore line breaks.
   */
  public static int compare(String str0,String str1,ArCase arCase,ArSpaceIgnore arSpace,ArLineBreakIgnore arBreak) 

Java symbol processing

□ Java symbol processing

ArStr.java


  /**Convert field names to setter names. */
  public static String setterName(String field) 
  /**Convert field names to getter names. */
  public static String getterName(String field) 
  /**
   *  _To remove and convert to CamelCase.
   *Note, used to convert table names to class names, etc..
   */
  public static String convertToCamelCase(String line) 
  /**
   *Specified character(sep)To remove and convert to CamelCase.
   *Note, used to convert table names to class names, etc..
   */
  public static String convertToCamelCaseSep(String line,String sep) 
  /**
   *  _To convert to CamelCase and start with lowercase.
   *Note, used to convert column names to field names, etc..
   */
  public static String columnToField(String name) 
  /**
   *Specified character(sep)To convert to CamelCase and start with lowercase.
   *Note, used to convert column names to field names, etc..
   */
  public static String columnToFieldSep(String name,String sep) 
  /**
   *Delete the first word.
   *Delete the first sep.
   */
  public static String removeFirst(String name,String sep) 
  /**
   *Delete the first word and sep and convert to CamelCase.
   *Note, used to convert table names to class names, etc..
   *Same as deleteFirstWordToCamelCase.
   */
  public static String removeFirstWordToCamelCase(String name,String sep) 
  /**
   *Remove the first word and sep, convert to CamelCase and start with lowercase.
   *Note, used to convert column names to field names, etc..
   *Same as deleteFirstWordToFieldSep.
   */
  public static String removeFirstWordToFieldSep(String name,String sep) {
  /**
   *First word and more_Remove, convert to CamelCase and start with lowercase.
   *Note, used to convert column names to field names, etc..
   */
  public static String removeFirstWordToField(String name) 

EBCDIC conversion

□ EBCDIC conversion

ArStr.java


  /**Convert strings to EBCDIC. */
  public static byte[] toEbcdic(String value) 
  /**Convert numbers to EBCDIC. */
  public static byte[] toEbcdic(int val,int len) 
  /**Convert EBCDIC to int*/
  public static Integer fromEbcdicToInt(byte[] bytes) 
  /**Convert EBCDIC to a string*/
  public static String revertString(byte[] bytes) ```

#Date, time, day of the week, holiday(public holiday),Japanese Calendar(05)

##Overview

The related classes are as follows

##ArDate-Handle only dates

1900/01/Supports 01 or later.

###Overview

*ArDate generation *Date of ArDate,Calendar,Conversion to long *Conversion of ArDate to string *ArDate days calculation *ArDate judgment process *ArDate Other

###ArDate generation

*Generation with current date or date

□ Generation by specifying the current date and date

ArDate.java


 / ** Constructor. Get current date. * /
  public ArDate() 
 / ** Constructor. Generated by specifying YYYY, MM, DD. * /
  public ArDate(int yyyy,int mm,int dd) 
 / ** Constructor * /
  public ArDate(ArDate date) 

□ Date,Calendar,Generated from long

ArDate.java


 / ** Convert from constructor.java.util.Date. * /
  public ArDate(java.util.Date date) 
 / ** Constructor. Convert from java.util.Calendar. * /
  public static ArDate(java.util.Calendar cal) 
 / ** Convert from constructor.long. * /
  public ArDate(long time) 

□ Generated from a character string

ArDate.java


 / ** Constructor. Convert from string using SimpleDateFormat. * /
  public static ArDate createFromString(String dateStr,String sdfStr) throws ParseException 
 / ** Constructor. Convert from string using SimpleDateFormat. * /
  public static ArDate construct(String dateStr,String sdfStr) throws ParseException 
  /**
 * Constructor. Convert from string. Supports the following formats.
 * yyyy / mm / dd ⇒ mm, dd may be a single digit.
 * yyyy-mm-dd ⇒ mm, dd may be one digit.
 * yyyy: mm: dd ⇒ mm, dd may be a single digit.
 * yyy.mm.dd ⇒ mm, dd may be a single digit.
 * yyyy year mm month dd day ⇒ mm, dd may be a single digit.
 * yyyymmdd ⇒ mm, dd are two digits.
 * If it is not in the above format, a RuntimeException will occur.
   */
  public static ArDate createFromString(String str) 
  /**
 * Constructor. Convert from string. Supports the following formats.
 * yyyy / mm / dd ⇒ mm, dd may be a single digit.
 * yyyy-mm-dd ⇒ mm, dd may be one digit.
 * yyyy: mm: dd ⇒ mm, dd may be a single digit.
 * yyy.mm.dd ⇒ mm, dd may be a single digit.
 * yyyy year mm month dd day ⇒ mm, dd may be a single digit.
 * yyyymmdd ⇒ mm, dd are two digits.
 * If it is not in the above format, a RuntimeException will occur.
   */
  public static ArDate construct(String str) 

□ Generation by specifying the day of the week

ArDate.java


  /**
 * Find the nth day of the month.
 * Returns null if it does not exist.
   */
  public static ArDate nthOfYoubi(int year,int month,ArYoubi youbi,int n)

###Date of ArDate,Calendar,Conversion to long

ArDate does not have a time, so it will be 0:00, but you can also specify the time to generate it.

□ Date,Calendar,Conversion to long

ArDate.java


 / ** Convert to java.util.Date. * /
  public java.util.Date toDate() 
 / ** Convert to java.util.Date. * /
  public java.util.Date toDate(int hh,int mm,int ss) 
 / ** Convert to java.util.Date. * /
  public java.util.Date toDate(long diff) 
 / ** Convert to long. * /
  public long toLong() 
 / ** Convert to long. * /
  public long toLong(int hh,int mm,int ss) 
 / ** Convert to long. * /
  public long toLong(long diff) 
 / ** Convert to java.util.Calendar. * /
  public java.util.Calendar toCalendar() 
 / ** Convert to java.util.Calendar. * /
  public java.util.Calendar toCalendar(int hh,int mm,int ss) 
 / ** Convert to java.util.Calendar. * /
  public java.util.Calendar toCalendar(long diff) 

###Conversion of ArDate to string

□ Conversion to character string

ArDate.java


 / ** Convert to yyyy / mm / dd. * /
  public String toString() 
  /**
 * Convert to yyyy-mm-dd.
 * -Etc. can be specified with sep. The date is always 2 digits.
   */
  public String toString(String sep) 
 / ** Convert to string with SimpleDateFormat. * /
  public String toStringBySDF(String sdfStr) 

###ArDate days calculation

*Advance or delay ArDate by the specified number of days *Calculate the number of days for two ArDates *Create a List of ArDate *Holidays can be considered in any of the above cases *See Ar Holiday for holiday processing

□ Advance or delay by the specified number of days

ArDate.java


  /**
 * Advance (delay) the number of days.
 * Change your own object.
   */
  public void forward(int n) {
  /**
 * Advance (delay) the number of days.
 * Create a new object.
   */
  public static ArDate forward(ArDate date,int days) 
  /**
 * Advance (delay) the number of days.
 * Create a new object.
   */
  public static ArDate constructForward(ArDate date,int days) 
  /**
 * Advance (delay) the number of days.
 * Consider holidays-change your object.
   */
  public void forward(int n,ArHoliday holiday) 
  /**
 * Advance (delay) the number of days.
 * Holiday consideration-Create a new object.
   */
  public static ArDate forward(ArDate date,int days,ArHoliday holiday) 
  /**
 * Advance (delay) the number of days.
 * Holiday consideration-Create a new object.
   */
  public static ArDate constructForward(ArDate date,int days,ArHoliday holiday) 

□ Calculate the number of days

ArDate.java


  /**
 * Day calculation.
 * start <= end is a prerequisite.
   */
  public static int days(ArDate start,ArDate end) 
  /**
 * Day calculation.
 * Consider holidays.
 * start <= end is a prerequisite.
   */
  public static int days(ArDate start,ArDate end,ArHoliday holiday) 

□ Create a List of ArDate

ArDate.java


 Returns a list of days days from / ** fromDate (including). Days cannot be negative. Size is days + 1 * /
  public static List<ArDate> dateList(ArDate fromDate,int days) 
 / ** Returns a list of dates from from to to * /
  public static List<ArDate> dateList(ArDate from,ArDate to) 
 Returns a list of days days from / ** fromDate (including), except holidays. Assuming that fromDate is not a holiday. Days cannot be negative. Size is days + 1. * /
  public static List<ArDate> dateList(ArDate fromDate,int days,ArHoliday holiday) 
 / ** Returns a list of dates from to to. Consider holidays. * /
  public static List<ArDate> dateList(ArDate from,ArDate to,ArHoliday holiday) 

###ArDate judgment process

*Equal value judgment between ArDates, size judgment

□ Equal value judgment, size judgment

ArDate.java


 / ** Equal value judgment. (Equal when the date is the same). * /
  @Override
  public boolean equals(Object o) 
  @Override
 / ** Comparison of size. * /
  public int compareTo(ArDate pair) 

□ Same day judgment ignoring the time

ArDate.java


 / ** Determine if it is the same date as long. Make it the same even if long is in the middle of the day. * /
  public boolean equals(long time) 
 / ** Determine if it is the same as Date. Date is the same even if it is in the middle of the day. * /
  public boolean equals(Date date) 
 / ** Determine if it is the same date as Calendar. Same even if Calendar is in the middle of the day. * /
  public boolean equals(Calendar cal) 

###ArDate Other

ArDate.java


 / ** Find the day of the week (ArDate). * /
  public static ArYoubi youbi(ArDate date) 
 / ** Find the number of days in the month. * /
  public static int daysOfMonth(ArDate date) 
 / ** Find the number of days in the month. * /
  public static int daysOfMonth(int year,int month) 
 / ** Find the number of days in a year. * /
  public static int daysOfYear(int year) 
 / ** Determine if it is the last day of the month. * /
  public static boolean isLastDay(ArDate date) 
 / ** Leap year judgment. * /
  public static boolean isLeapYear(int yyyy) 

##ArDateUtil-Date and time(Date,Calendar,long)Related utility classes

###Overview

*Get the current date and time *Get the specified date and time *Copy of Date⇔Calendar *Round up and down the time *Advance or delay the time *Same day judgment-Judge as the same day even if the time is different *Current time judgment-Error specification *Same time judgment-Error specification *Days calculation-You can also consider holidays *Date after the specified number of days,Calendar,Find long-You can also consider holidays *Ask for a list between two dates-You can also consider holidays *Ask for a list up to the specified number of days-You can also consider holidays *Get day of the week *Convert to String-Those that use SimpleDateFormat *Convert to String *Conversion from String *Existence check

###Get the current date and time

ArDateUtil.java


 / ** Get the current time Date. * /
  public static Date getCurrentDate() 
 / ** Get the Calendar of the current time. * /
  public static Calendar getCurrentCalendar() 
 / ** Get the long of the current time. * /
  public static long getCurrentTime() 
 / ** Get the Japanese calendar of the current day * /
  public static ArWareki getCurrentWareki() 

###Get the specified date and time

ArDateUtil.java


 / ** Get Date of specified date and time. * /
  public static Date getDate(int year,int month,int day,int hour,int minute,int second) 
 / ** Get the Calendar of the specified date and time. * /
  public static Calendar getCalendar(int year,int month,int day,int hour,int minute,int second) 
 / ** Get the long of the specified date and time. * /
  public static long getCurrentTime(int year,int month,int day,int hour,int minute,int second) 

###Copy of Date⇔Calendar

ArDateUtil.java


 / ** Copy Date * /
  public static Date copy(Date date) 
 / ** Copy Calendar * /
  public static Calendar copy(Calendar cal) {
 / ** Convert java.util.Date to java.util.Calendar. * /
  public static Calendar dateToCalendar(java.util.Date date) 
 / ** Convert java.util.Calendar to java.util.Date. * /
  public static Date calendarToDate(java.util.Calendar cal) 

###Round up and down the time

ArDateUtil.java


 / ** Set to 0 hours, 0 minutes, and 0 seconds on the day. * /
  public static java.util.Date downTo0H0M0S(java.util.Date date) 
 / ** Set to 0 hours, 0 minutes, and 0 seconds on the day. * /
  public static java.util.Calendar downTo0H0M0S(java.util.Calendar cal) 
 / ** Set to 0 hours, 0 minutes, and 0 seconds on the day. * /
  public static long downTo0H0M0S(long time) 
 / ** Set to zero hours, zero minutes, and zero seconds the next day. * /
  public static java.util.Date upTo0H0M0S(java.util.Date date) {
 / ** Set to zero hours, zero minutes, and zero seconds the next day. * /
  public static java.util.Calendar upTo0H0M0S(java.util.Calendar cal) 
 / ** Set to zero hours, zero minutes, and zero seconds the next day. * /
  public static long upTo0H0M0S(long time) 
 / ** Round down time * /
  public static java.util.Date downTo0M0S(java.util.Date date) 
 / ** Round down time * /
  public static java.util.Calendar downTo0M0S(java.util.Calendar cal) 
 / ** Round down time * /
  public static long downTo0M0S(long time) 
 / ** Round up time * /
  public static java.util.Date upTo0M0S(java.util.Date date) 
 / ** Round up time * /
  public static java.util.Calendar upTo0M0S(java.util.Calendar cal) 
 / ** Round up time * /
  public static long upTo0M0S(long time) 

###Advance or delay the time

ArDateUtil.java


 / ** Advance the time. The original date is unchanged. * /
  public static Date forward(Date date,int day,int hour,int minute,int second) 
 / ** Delay the time. The original date is unchanged. * /
  public static Date backward(Date date,int day,int hour,int minute,int second) 
 / ** Advance the time. The original cal does not change. * /
  public static Calendar forward(Calendar cal,int day,int hour,int minute,int second) 
 / ** Delay the time. The original cal does not change. * /
  public static Calendar backward(Calendar cal,int day,int hour,int minute,int second) 
 / ** Advance the time. * /
  public static long forward(long time,int day,int hour,int minute,int second) 
 / ** Delay the time. * /
  public static long backward(long time,int day,int hour,int minute,int second) 

###Same day judgment-Judge as the same day even if the time is different

ArDateUtil.java


 / ** Same day judgment (even if the time is different) ArDate vs ArDate * /
  public static boolean sameDate(ArDate arDate0,ArDate arDate1) 
 / ** Same day judgment (even if the time is different) ArDate vs Date * /
  public static boolean sameDate(ArDate arDate0,Date date) 
 / ** Same day judgment (even if the time is different) ArDate vs Calendar * /
  public static boolean sameDate(ArDate arDate0,Calendar cal) 
 / ** Same day judgment (OK even if the time is different) ArDate vs long * /
  public static boolean sameDate(ArDate arDate0,long time) 
 / ** Same day judgment (even if the time is different) ArDate vs ArWareki * /
  public static boolean sameDate(ArDate arDate0,ArWareki wareki) 
 / ** Same day judgment (OK even if the time is different) Date vs ArDate * /
  public static boolean sameDate(Date date0,ArDate arDate1) 
 / ** Same day judgment (OK even if the time is different) Date vs Date * /
  public static boolean sameDate(Date date0,Date date1) 
 / ** Same day judgment (OK even if the time is different) Date vs Calednar * /
  public static boolean sameDate(Date date,Calendar cal) 
 / ** Same day judgment (OK even if the time is different) Date vs long * /
  public static boolean sameDate(Date date,long time) 
 / ** Same day judgment (even if the time is different) Date vs ArWareki * /
  public static boolean sameDate(Date date,ArWareki wareki) 
 / ** Same day judgment (even if the time is different) Calendar vs ArDate * /
  public static boolean sameDate(Calendar cal0,ArDate arDate1) 
 / ** Same day judgment (even if the time is different) Calendar vs Date * /
  public static boolean sameDate(Calendar cal0,Date date1) 
 / ** Same day judgment (even if the time is different) Calendar vs Calendar * /
  public static boolean sameDate(Calendar cal0,Calendar cal1) 
 / ** Same day judgment (OK even if the time is different) Calendar vs long * /
  public static boolean sameDate(Calendar cal,long time) 
 / ** Same day judgment (even if the time is different) Calendar vs ArWareki * /
  public static boolean sameDate(Calendar cal,ArWareki wareki) 
 / ** Same day judgment (OK even if the time is different) long vs ArDate * /
  public static boolean sameDate(long time0,ArDate arDate1) 
 / ** Same day judgment (OK even if the time is different) long vs Date * /
  public static boolean sameDate(long time0,Date date1) 
 / ** Same day judgment (OK even if the time is different) long vs Calendar * /
  public static boolean sameDate(long time0,Calendar cal1) 
 / ** Same day judgment (OK even if the time is different) long vs long * /
  public static boolean sameDate(long time0,long time1) 
 / ** Same day judgment (OK even if the time is different) long vs ArWareki * /
  public static boolean sameDate(long time0,ArWareki wareki) 
 / ** Same day judgment (even if the time is different) ArWareki vs ArDate * /
  public static boolean sameDate(ArWareki wareki0,ArDate arDate1) 
 / ** Same day judgment (even if the time is different) ArWareki vs Date * /
  public static boolean sameDate(ArWareki wareki0,Date date1) 
 / ** Same day judgment (even if the time is different) ArWareki vs Calendar * /
  public static boolean sameDate(ArWareki wareki0,Calendar cal1) 
 / ** Same day judgment (even if the time is different) ArWareki vs long * /
  public static boolean sameDate(ArWareki wareki0,long time1) 
 / ** Same day judgment (even if the time is different) ArWareki vs ArWareki * /
  public static boolean sameDate(ArWareki wareki0,ArWareki wareki1) 

###Current time judgment-Error specification

ArDateUtil.java


 / ** Current time judgment-Error (minute) specification-Date * /
  public static boolean currentTime(Date date,int min) 
 / ** Current time judgment-Error (minute) specification-Calendar * /
  public static boolean currentTime(Calendar cal,int min) 
 / ** Current time judgment-Error (minute) specification-long * /
  public static boolean currentTime(long time,int min) 

###Same time judgment-Error specification

ArDateUtil.java


 / ** Same time judgment-Error (minute) specification-Date vs Date * /
  public static boolean sameTime(Date date0,Date date1,int min) 
 / ** Same time judgment-Error (minute) specification-Date vs Calendar * /
  public static boolean sameTime(Date date0,Calendar cal1,int min) 
 / ** Same time judgment-Error (minute) specification-Date vs long * /
  public static boolean sameTime(Date date0,long time1,int min) 
 / ** Same time judgment-Error (minute) specification-Calendar vs Date * /
  public static boolean sameTime(Calendar cal0,Date date1,int min) 
 / ** Same time judgment-Error (minute) specification-Calendar vs Calendar * /
  public static boolean sameTime(Calendar cal0,Calendar cal1,int min) 
 / ** Same time judgment-Error (minute) specification-Calendar vs long * /
  public static boolean sameTime(Calendar cal0,long time1,int min) 
 / ** Same time judgment-Error (minute) specification-long vs Date * /
  public static boolean sameTime(long time0,Date date1,int min) 
 / ** Same time judgment-Error (minute) specification-long vs Calendar * /
  public static boolean sameTime(long time0,Calendar cal1,int min) 
 / ** Same time judgment-Error (minute) specification-long vs long * /
  public static boolean sameTime(long time0,long time1,int min) 

###Days calculation-You can also consider holidays

ArDateUtil.java


 / ** Calculate the number of days for two Dates. * /
  public static int days(Date from,Date to) 
 / ** Calculate the number of days for two Dates. Consider holidays * /
  public static int days(Date from,Date to,ArHoliday holiday) 
 / ** Calculate the number of days for two calendars. * /
  public static int days(Calendar from,Calendar to) 
 / ** Calculate the number of days for two Calendars. Consider holidays * /
  public static int days(Calendar from,Calendar to,ArHoliday holiday) 
 / ** Calculate the number of days for two longs. * /
  public static int days(long from,long to) 
 / ** Calculate the number of days for two longs. Consider holidays * /
  public static int days(long from,long to,ArHoliday holiday) 

###Date after the specified number of days,Calendar,Find long-You can also consider holidays

ArDateUtil.java


 / ** Find Date after days. Hours, minutes and seconds are retained. * /
  public static Date days(Date from,int days) 
 / ** Find Date after days. Consider holidays. Hours, minutes and seconds are retained. * /
  public static Date days(Date from,int days,ArHoliday holiday) 
 / ** Find Calendar after days. Hours, minutes and seconds are retained. * /
  public static Calendar days(Calendar from,int days) 
 / ** Find Calendar after days. Consider holidays. Hours, minutes and seconds are retained. * /
  public static Calendar days(Calendar from,int days,ArHoliday holiday) 
 / ** Find long after days. Hours, minutes and seconds are retained. * /
  public static long days(long from,int days) 
 / ** Find long after days. Consider holidays. Hours, minutes and seconds are retained. * /
  public static long days(long from,int days,ArHoliday holiday) 

###Ask for a list between two dates-You can also consider holidays

ArDateUtil.java


 / ** Ask for a list between two dates * /
  public static List<ArDate> dateList(ArDate from,ArDate to) 
 / ** Ask for a list between two dates-consider holidays * /
  public static List<ArDate> dateList(ArDate from,ArDate to,ArHoliday holiday) 
 / ** Find a list between two dates-hours, minutes and seconds are the same as from * /
  public static List<Date> dateList(Date from,Date to) 
 / ** Ask for a list between two dates-consider holidays-hours, minutes and seconds are the same as from * /
  public static List<Date> dateList(Date from,Date to,ArHoliday holiday) 
 / ** Find a list between two dates-hours, minutes and seconds are the same as from * /
  public static List<Calendar> dateList(Calendar from,Calendar to) 
 / ** Ask for a list between two dates-consider holidays-hours, minutes and seconds are the same as from * /
  public static List<Calendar> dateList(Calendar from,Calendar to,ArHoliday holiday) 
 / ** Find a list between two dates-hours, minutes and seconds are the same as from * /
  public static List<Long> dateList(long from,long to) 
 / ** Ask for a list between two dates-consider holidays-hours, minutes and seconds are the same as from * /
  public static List<Long> dateList(long from,long to,ArHoliday holiday) 

###Ask for a list up to the specified number of days-You can also consider holidays

ArDateUtil.java


 Returns a list of dates in days days from / ** from (including). The size of the list is days + 1. Hours, minutes and seconds are retained.
  public static List<Date> dateList(Date from,int days) 
 Returns a list of dates in days days from / ** from (including). The size of the list is days + 1. Consider holidays. Hours, minutes and seconds are retained. * /
  public static List<Date> dateList(Date from,int days,ArHoliday holiday) 
 Returns a list of calendars for days days from / ** from (including). The size of the list is days + 1. Hours, minutes and seconds are retained. * /
  public static List<Calendar> dateList(Calendar from,int days) 
 Returns a list of calendars for days days from / ** from (including). The size of the list is days + 1. Consider holidays.
  public static List<Calendar> dateList(Calendar from,int days,ArHoliday holiday) 
 Returns a long list of days days from / ** from (including). The size of the list is days + 1. Hours, minutes and seconds are preserved. * /
  public static List<Long> dateList(long from,int days) 
 Returns a long list of days days from / ** from (including). List size is days + 1. Consider holidays. Hours, minutes and seconds are retained. * /
  public static List<Long> dateList(long from,int days,ArHoliday holiday) 

###Get day of the week

ArDateUtil.java


 / ** Get the day of the week. * /
  public static ArYoubi getYoubi(ArDate arDate) 
 / ** Get the day of the week. * /
  public static ArYoubi getYoubi(Date date) 
 / ** Get the day of the week. * /
  public static ArYoubi getYoubi(Calendar cal) 
 / ** Get the day of the week. * /
  public static ArYoubi getYoubi(long time) 
 / ** Get the day of the week. * /
  public static ArYoubi getYoubi(ArWareki wareki) 

###Convert to String-Those that use SimpleDateFormat

ArDateUtil.java


 / ** Replace $ {DATExxxx} with the current date and time. Xxxx is a format handled by SimpleDateFormat. * /
  public static String replaceByDate(String str) 
 / ** Replace $ {DATExxxx} with date and time etc. xxxx is a format handled by SimpleDateFormat. * /
  public static String replaceByDate(String str,ArDate date) 
 / ** Replace $ {DATExxxx} with date and time etc. xxxx is a format handled by SimpleDateFormat. * /
  public static String replaceByDate(String str,java.util.Calendar cal) 
 / ** Replace $ {DATExxxx} with date and time etc. xxxx is a format handled by SimpleDateFormat. * /
  public static String replaceByDate(String str,long time) 
 / ** Replace $ {DATExxxx} with date and time etc. <br> xxxx is a format handled by SimpleDateFormat <br> * /
  public static String replaceByDate(String str,java.util.Date date) 

###Convert to String

ArDateUtil.java


 / ** Convert ArDate to date and time. * /
  public static String toString(ArDate date) 
 / ** Convert long to date and time. * /
  public static String toString(long time) 
 / ** Convert java.util.Date to date and time. * /
  public static String toString(java.util.Date utilDate) 
 / ** Convert java.util.Calendar to date and time. * /
  public static String toString(java.util.Calendar cal) 

###Conversion from String

ArDateUtil.java


  /**
 * Convert String to java.util.Date.
 * The format of the target character string is defined in ArDateFormats and ArTimeFormats.
   */
  public static java.util.Date toDate(String str) 
  /**
 * Convert String to java.util.Calendar.
 * The format of the target character string is defined in ArDateFormats and ArTimeFormats.
   */
  public static Calendar toCalendar(String str) 
  /**
 * Convert String to long.
 * The format of the target character string is defined in ArDateFormats and ArTimeFormats.
   */
  public static Long toLong(String str) 

###Existence check

ArDateUtil.java


 / ** Check the existence of the time. * /
  public static boolean isValidTime(int hour,int minite,int second) 
 / ** Check the existence of dates. 1900-2100 * /
  public static boolean isValidDate(int year,int month,int date) 
 / ** Check the existence of the date and time. * /
  public static boolean isValidDateTime(int year,int month,int date,int hour,int minite,int second) 

##ArYoubi-Day of the week enum

###Overview

*Get the current day of the week, get the next day of the week *Mutual conversion with int value, customization of conversion value *Mutual conversion with String value, day/English and long form/Short form

###Get the current day of the week, get the next day of the week

ArYoubi.java


 / ** Find the current day of the week. * /
  public static ArYoubi getCurrentYoubi() 
 / ** Find the next day of the week. * /
  public ArYoubi next() 

###Mutual conversion with int value, customization of conversion value

*The default value for conversion is set to ArYoubiInt *If you set a value for intConversion, it will be converted based on it.

ArYoubi.java


  /**
 * Convert from int to day of the week.
 * Returns null if the value is incorrect.
 * If intConversion is set, convert based on it.
   */
  public static ArYoubi fromInt(int youbi) 
 / ** Convert days of the week to integers. * /
  public int toInt() 

###Mutual conversion with String value, day/English and long form/Short form

*Short format is day, Sun, etc. *Long format is Sunday, Sunday, etc.

ArYoubi.java


  /**
 * Convert to a string.
 * lang specifies the language. Specifies JAPANESE or ENGLISH of Lang.
 * longth specifies abbreviated or long form. Specify LONG or SHORT of Length.
 * Enclose the front and back with the parentheses specified by bracket. Assuming that BRACKETx of CharDef is specified. If null is specified, it will not be enclosed.
   */
  public String toString(int lang,int length,String[] bracket) 
 / ** Return Japanese short form. * /
  public String toJShortString() 
  /**
 * Convert from Japanese single form to Youbi.
 * Returns null if it does not match.
   */
  public static ArYoubi fromJShortString(String str) 
 / ** Return Japanese long form. * /
  public String toJLongString() 
  /**
 * Convert from Japanese long form to Youbi.
 * Returns null if it does not match.
   */
  public static ArYoubi fromJLongString(String str) 
 / ** Return English short form. * /
  public String toEShortString() 
  /**
 * Convert from English single form to Youbi.
 * Returns null if it does not match.
   */
  public static ArYoubi fromEShortString(String str) 
 / ** Return English long form. * /
  public String toELongString() 
  /**
 * Convert from English long form to Youbi.
 * Returns null if it does not match.
   */
  public static ArYoubi fromELongString(String str) 

##ArHoliday-Holiday processing interface(Implementation class is also provided)

###Overview

ArHoliday-Holiday processing interface

ArHoliday.java


package jp.avaj.lib.algo;

import java.util.List;

 / ** Holiday judgment processing interface * /
public interface ArHoliday {
  /**
 * Get holiday information.
 * On holidays ⇒HolidayInfo.isHoliday is true.
 * On working days ⇒ HolidayInfo.isHoliday is false.
 * When it cannot be determined ⇒ The return value is null.
   */
  public ArHolidayInfo get(ArDate date);
  /**
 * Get holiday information for the relevant year and month.
 * Get information on holidays and working days.
 * Does not include days that cannot be determined.
   */
  public List<ArHolidayInfo> get(int year,int month);
  /**
 * Get holiday information for the year.
 * Get information on holidays and working days.
 * Does not include days that cannot be determined.
   */
  public List<ArHolidayInfo> get(int year);

}

ArHolidayInfo-Holiday information class

ArHolidayInfo.java


package jp.avaj.lib.algo;

 / ** Holiday information * /
public class ArHolidayInfo {
 / ** Date. * /
  public ArDate date;
 / ** Holiday? . * /
  public Boolean isHoliday;
 /** Description. */
  public String descr;
}

###Various implementation classes of ArHoliday

You can create your own implementation class, but the Artery library provides:

ArHolidayStandard-Combine other ArHoliday implementation classes

*Complex holidays combined with other implementation classes/Achieve working day conditions *Examine the specified classes in order *If you can't decide, look at the next class

##ArWareki-Japanese calendar processing

*Corresponding to after January 1, 1897 *Generate ArWareki for the current day *ArWareki's Coby

###reference:Correspondence between Japanese calendar and Western calendar

*January 1, 1873 ⇔ January 1, 1873. *July 30, 1912 ⇔ July 30, 1912. *December 25, 1926 ⇔ December 25, 1926. *January 8, 2001 ⇔ January 8, 1989. *May 1st, 1st year of Reiwa ⇒ May 1st, 2019.

Note, the Julian calendar is used until the 5th year of the Meiji era, and the year and date do not match..

###Generate ArWareki for the current day

ArWareki.java


 / ** Generate the Japanese calendar for the current day * /
  public static ArWareki construct() 

###ArWareki's Coby

ArWareki.java


 / ** Constructor * /
  public ArWareki(ArWareki wareki)

ArDate,Date,Calendar,Generate ArWareki from long

ArWareki.java


 / ** Convert from Western calendar to Japanese calendar. * /
  public static ArWareki fromArDate(ArDate date) 
 /** Convert from java.util.Date to Japanese calendar. * /
  public static ArWareki fromDate(java.util.Date utilDate) 
 / ** Convert from java.util.Calendar to Japanese calendar. * /
  public static ArWareki fromCalendar(java.util.Calendar cal) 
 / ** Convert from long to Japanese calendar. * /
  public static ArWareki fromLong(long time) 

###ArWareki to ArDate,Date,Calendar,Generate long(Hour, minute and second are 0)

ArWareki.java


 / ** Convert from Japanese calendar to Western calendar. * /
  public ArDate toArDate() 
 / ** Convert from Japanese calendar to java.util.Date (0:00:00). * /
  public static java.util.Date toDate(ArWareki wareki) 
 / ** Convert from Japanese calendar to java.util.Calendar (0:00:00). * /
  public static java.util.Calendar toCalendar(ArWareki wareki) 
 / ** Convert from Japanese calendar to long (0:00:00). * /
  public static long toLong(ArWareki wareki) 

###Get the day of the week from ArWareki

ArWareki.java


 / ** Get day of the week * /
  public ArYoubi getYoubi() 

###ArWareki and ArDate,Date,Calendar,Same day judgment with long

ArWareki.java


 / ** Same day judgment (ArWareki) * /
  public boolean sameDate(ArWareki wareki) 
 / ** Same day judgment (ArDate) * /
  public boolean sameDate(ArDate arDate) 
 / ** Same day judgment (Date) * /
  public boolean sameDate(Date date) 
 / ** Same day judgment (Calendar) * /
  public boolean sameDate(Calendar cal) 
 / ** Same day judgment (long) * /
  public boolean sameDate(long time) 

#Other/interface

###Overview

#Other/class

#Other/Enum

#Copying values between beans()

-The value is frequently copied in the process between screen ⇔ business logic ⇔ DB. There are the following problems here. -The field names are different. -The field type is different. -Even in the same type of field, the meaning of the value is different. Example,(male:0,Female:1)⇒(male:1,Female2)。 -There are fields that you do not want to copy. -If such processing is described individually, the methods will be different and bugs will be more likely to occur. -Similar processing is described in various places. ・ It is desirable to improve the quality by making it common and parts as much as possible.

Example of using ArAutoValueConverter(Field type conversion) ・[ArValueConverter(Implementation class)Usage example-Convert an object to another object / reverse conversion] ・[Copy of field with the same name(Field type conversion-Using ArAutoValueConverter)] ・[Copy between beans-Copy of fields with different names(Specify conversion information and convert with ArValueConverter)] ・(It's extra)[Set the creator / creation date / time and updater / update date / time for the bean.]

#Graph processing()

###Related class ・ ArGraphPointType ⇒ Definition of point type(start/End/start&End/Passing) ・ ArGraphEdge ⇒ Edge ・ ArGraphEdgeDir ⇒ Edge direction(Bidirectional/One direction/No meaning) ・ ArGraphConnection ⇒Point connection information(Connection destination and connection source) ・ ArGraph ⇒ Processing logic

###ArGraph methods

ArGraph.java


 / ** Topological sort. Null is returned if looping * /
  public static <$Point> List<$Point> topologicalSort(Collection<ArGraphEdge<$Point>> edges)
  /**
 * Split an unbound graph. If it is a connected graph, only one graph will be returned.
 * @param pontMap Point information, getAllPoints in advance.
   */
  public static <$Point> List<Map<$Point,ArGraphConnection<$Point>>> divide(Collection<ArGraphEdge<$Point>> edges) {
  /**
 * Split an unbound graph. If it is a connected graph, only one graph will be returned.
 * @param pontMap Point information, getAllPoints in advance.
   */
  public static <$Point> List<Map<$Point,ArGraphConnection<$Point>>> divide(Map<$Point,ArGraphConnection<$Point>> pointMap)
  /**
 * Find the route between specified points.
 * @param pontMap Point information, getAllPoints in advance.
 * @param targetPoints Passing points, [0]: origin, [n-1]: destination
   */
  public static <$Point> List<List<$Point>> findRoute(Collection<ArGraphEdge<$Point>> edges,$Point[] targetPoints)
  /**
 * Find the route between specified points.
 * @param pontMap Point information, getAllPoints in advance.
 * @param targetPoints Passing points, [0]: origin, [n-1]: destination
   */
  public static <$Point> List<List<$Point>> findRoute(Map<$Point,ArGraphConnection<$Point>> pointMap,$Point[] targetPoints) 
  /**
 * Determine if the cycle is closed.
 * @return If true, the cycle is closed, but there may be multiple cycles.
   */
  public static <$Point> boolean closed(Collection<ArGraphEdge<$Point>> edges) 
 / ** Ask for start point information. Including those that also serve as start point and end point. Zero size if it does not exist. * /
  public static <$Point> Map<$Point,ArGraphConnection<$Point>> getStartPoints(Collection<ArGraphEdge<$Point>> edges) {
 / ** Find end point information. Including those that also serve as start and end points. Zero size if it does not exist. * /
  public static <$Point> Map<$Point,ArGraphConnection<$Point>> getEndPoints(Collection<ArGraphEdge<$Point>> edges) 
 / ** Find start point end point information. Zero size if it does not exist * /
  public static <$Point> Map<$Point,ArGraphConnection<$Point>> getStartEndPoints(Collection<ArGraphEdge<$Point>> edges) 
 / ** Get all point information * /
  public static <$Point> Map<$Point,ArGraphConnection<$Point>> getAllPoints(Collection<ArGraphEdge<$Point>> edges)

###sample

Graph processing(Railway line)-Cycle judgment/Start point end point search/Route division/Topological sort/Route search between stations

#Various miscellaneous(08)

###combination(Combination)

combination(ArCombination)Generation(Q08_00)

###State machine

State machine sample(Q08_01)

###Processing of numeric arrays

Processing of numeric arrays-Aggregation(Maximum, minimum, total, mean, standard deviation),conversion(Moving average, rate of change, etc.), Histogram, etc.

Recommended Posts

Java Algorithm Library-Artery-Sample
Java Unit Test Library-Artery-Sample
Java
Java
AtCoder 400 points algorithm summary (Java edition)
Java learning (0)
Studying Java ―― 3
[Java] array
Java protected
[Java] Annotation
[Java] Module
Java array
Studying Java ―― 9
Java scratch scratch
Java tips, tips
Java methods
Java method
java (constructor)
Java array
[Java] ArrayDeque
java (override)
java (method)
Java string
java (array)
Java serialization
java beginner 4
JAVA paid
Algorithm gymnastics 1
Studying Java ―― 4
Java (set)
java shellsort
[Java] compareTo
Studying Java -5
java reflexes
java (interface)
Java memorandum
☾ Java / Collection
Java array
Studying Java ―― 1
[Java] Polymorphism
Studying Java # 0
Java review
Java features
[Java] Inheritance
FastScanner Java
Java features
java beginner 3
Java memo
java (encapsulation)
Java inheritance
[Java] Overload
Java basics
Decompile Java
[Java] Annotation
java notes
java beginner
Java (add2)
JAVA (Map)
[java] interface
Java9 collection
Java basics