Package de.jungblut.datastructure
Class ArrayJoiner
- java.lang.Object
-
- de.jungblut.datastructure.ArrayJoiner
-
public final class ArrayJoiner extends java.lang.ObjectAJoinerutility that works for primitive arrays which Guava's Joiner can't deal with.- Author:
- thomas.jungblut
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringjoin(byte[] array)Joins the given array with the separator and returns the resulting string.java.lang.Stringjoin(char[] array)Joins the given array with the separator and returns the resulting string.java.lang.Stringjoin(double[] array)Joins the given array with the separator and returns the resulting string.java.lang.Stringjoin(float[] array)Joins the given array with the separator and returns the resulting string.java.lang.Stringjoin(int[] array)Joins the given array with the separator and returns the resulting string.java.lang.Stringjoin(long[] array)Joins the given array with the separator and returns the resulting string.java.lang.Stringjoin(short[] array)Joins the given array with the separator and returns the resulting string.static ArrayJoineron(char separator)static ArrayJoineron(java.lang.String separator)
-
-
-
Method Detail
-
join
public java.lang.String join(byte[] array)
Joins the given array with the separator and returns the resulting string. So an array of [1,2,3,4] turns into "1,2,3,4".- Parameters:
array- a not null array of byte.- Returns:
- a string containing the results.
-
join
public java.lang.String join(short[] array)
Joins the given array with the separator and returns the resulting string. So an array of [1,2,3,4] turns into "1,2,3,4".- Parameters:
array- a not null array of short.- Returns:
- a string containing the results.
-
join
public java.lang.String join(int[] array)
Joins the given array with the separator and returns the resulting string. So an array of [1,2,3,4] turns into "1,2,3,4".- Parameters:
array- a not null array of int.- Returns:
- a string containing the results.
-
join
public java.lang.String join(long[] array)
Joins the given array with the separator and returns the resulting string. So an array of [1,2,3,4] turns into "1,2,3,4".- Parameters:
array- a not null array of long.- Returns:
- a string containing the results.
-
join
public java.lang.String join(float[] array)
Joins the given array with the separator and returns the resulting string. So an array of [1,2,3,4] turns into "1,2,3,4".- Parameters:
array- a not null array of float.- Returns:
- a string containing the results.
-
join
public java.lang.String join(double[] array)
Joins the given array with the separator and returns the resulting string. So an array of [1,2,3,4] turns into "1,2,3,4".- Parameters:
array- a not null array of double.- Returns:
- a string containing the results.
-
join
public java.lang.String join(char[] array)
Joins the given array with the separator and returns the resulting string. So an array of [1,2,3,4] turns into "1,2,3,4".- Parameters:
array- a not null array of char.- Returns:
- a string containing the results.
-
on
public static ArrayJoiner on(char separator)
- Returns:
- a new joiner on that separator.
-
on
public static ArrayJoiner on(java.lang.String separator)
- Returns:
- a new joiner on that separator.
-
-