| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_POSTFIX
The default postfix terminating the array's string representation.
|
static String |
DEFAULT_PREFIX
The default prefix starting the array's string representation.
|
static String |
DEFAULT_SEPARATOR
The default separator between array elements.
|
| Constructor and Description |
|---|
ArrayFormatter()
Simplified constructor based on a new Formatter.
|
ArrayFormatter(Formatter formatter)
Simplified constructor using default prefix, separator and postfix.
|
ArrayFormatter(Formatter formatter,
String prefix,
String separator,
String postfix)
Main constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
asString(boolean[] a,
String conversion)
Represent boolean array as String using default prefix, separator and postfix.
|
static String |
asString(boolean[] a,
String conversion,
String prefix,
String separator,
String postfix)
Represent boolean array as String.
|
static String |
asString(byte[] a,
String conversion)
Represent byte array as String using default prefix, separator and postfix.
|
static String |
asString(byte[] a,
String conversion,
String prefix,
String separator,
String postfix)
Represent byte array as String.
|
static String |
asString(double[] a,
String conversion)
Represent double array as String using default prefix, separator and postfix.
|
static String |
asString(double[] a,
String conversion,
String prefix,
String separator,
String postfix)
Represent double array as String.
|
static String |
asString(float[] a,
String conversion)
Represent float array as String using default prefix, separator and postfix.
|
static String |
asString(float[] a,
String conversion,
String prefix,
String separator,
String postfix)
Represent float array as String.
|
static String |
asString(int[] a,
String conversion)
Represent integer array as String using default prefix, separator and postfix.
|
static String |
asString(int[] a,
String conversion,
String prefix,
String separator,
String postfix)
Represent integer array as String.
|
static String |
asString(long[] a,
String conversion)
Represent long array as String using default prefix, separator and postfix.
|
static String |
asString(long[] a,
String conversion,
String prefix,
String separator,
String postfix)
Represent long array as String.
|
static String |
asString(short[] a,
String conversion)
Represent short array as String using default prefix, separator and postfix.
|
static String |
asString(short[] a,
String conversion,
String prefix,
String separator,
String postfix)
Represent short array as String.
|
static <T> String |
asString(T[] a,
String conversion)
Represent array of objects as String using default prefix, separator and postfix.
|
static <T> String |
asString(T[] a,
String conversion,
String prefix,
String separator,
String postfix)
Represent array of objects as String.
|
void |
close()
Closes the formatter this ArrayFormatter is based upon.
|
void |
flush()
Flushed the formatter this ArrayFormatter is based upon.
|
ArrayFormatter |
format(boolean[] a,
String conversion)
Writes a formatted boolean array to this object's destination.
|
ArrayFormatter |
format(byte[] a,
String conversion)
Writes a formatted byte array to this object's destination.
|
ArrayFormatter |
format(double[] a,
String conversion)
Writes a formatted double array to this object's destination.
|
ArrayFormatter |
format(float[] a,
String conversion)
Writes a formatted float array to this object's destination.
|
ArrayFormatter |
format(int[] a,
String conversion)
Writes a formatted integer array to this object's destination.
|
ArrayFormatter |
format(long[] a,
String conversion)
Writes a formatted long array to this object's destination.
|
ArrayFormatter |
format(short[] a,
String conversion)
Writes a formatted short array to this object's destination.
|
ArrayFormatter |
format(String format,
Object... args)
Writes a formatted string to this object's destination.
|
<T> ArrayFormatter |
format(T[] a,
String conversion)
Writes a formatted array of objects to this object's destination.
|
int |
getLimit()
Return the maximum number of array elements displayed for each array formatted.
|
String |
getMoreFormat()
Return format used to indicate the number of elements suppressed at the end of the array.
|
Appendable |
out()
Return the Appendable this formatter writes to.
|
void |
setLimit(int limit)
Set the maximum number of array elements displayed for each array formatted.
|
void |
setMoreFormat(String moreFormat)
Set format used to indicate the number of elements suppressed at the end of the array.
|
public static final String DEFAULT_SEPARATOR
public static final String DEFAULT_PREFIX
public static final String DEFAULT_POSTFIX
public ArrayFormatter(Formatter formatter, String prefix, String separator, String postfix)
formatter - the Formatter this ArrayFormatter will be based onprefix - the prefix starting the array's string representation.separator - the separator between array elements.postfix - the postfix terminating the array's string representation.public ArrayFormatter(Formatter formatter)
formatter - the Formatter this ArrayFormatter will be based onpublic ArrayFormatter()
public int getLimit()
public void setLimit(int limit)
limit - maximum number or 0 if no limitpublic String getMoreFormat()
public void setMoreFormat(String moreFormat)
moreFormat - suitable to display an integerpublic ArrayFormatter format(boolean[] a, String conversion)
a - the arrayconversion - conversion string used on each array elementpublic ArrayFormatter format(byte[] a, String conversion)
a - the arrayconversion - conversion string used on each array elementpublic ArrayFormatter format(short[] a, String conversion)
a - the arrayconversion - conversion string used on each array elementpublic ArrayFormatter format(int[] a, String conversion)
a - the arrayconversion - conversion string used on each array elementpublic ArrayFormatter format(long[] a, String conversion)
a - the arrayconversion - conversion string used on each array elementpublic ArrayFormatter format(float[] a, String conversion)
a - the arrayconversion - conversion string used on each array elementpublic ArrayFormatter format(double[] a, String conversion)
a - the arrayconversion - conversion string used on each array elementpublic <T> ArrayFormatter format(T[] a, String conversion)
a - the arrayconversion - conversion string used on each array elementpublic ArrayFormatter format(String format, Object... args)
format - a format string for the objectsargs - the objectspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void flush()
throws IOException
flush in interface FlushableIOExceptionpublic Appendable out()
public static String asString(boolean[] a, String conversion, String prefix, String separator, String postfix)
a - the arrayconversion - the conversion used on each elementprefix - the prefix at the start of the string representationseparator - the separator between elementspostfix - the postfix after the end of the string representationpublic static String asString(boolean[] a, String conversion)
a - the arrayconversion - the conversion used on each elementpublic static String asString(byte[] a, String conversion, String prefix, String separator, String postfix)
a - the arrayconversion - the conversion used on each elementprefix - the prefix at the start of the string representationseparator - the separator between elementspostfix - the postfix after the end of the string representationpublic static String asString(byte[] a, String conversion)
a - the arrayconversion - the conversion used on each elementpublic static String asString(short[] a, String conversion, String prefix, String separator, String postfix)
a - the arrayconversion - the conversion used on each elementprefix - the prefix at the start of the string representationseparator - the separator between elementspostfix - the postfix after the end of the string representationpublic static String asString(short[] a, String conversion)
a - the arrayconversion - the conversion used on each elementpublic static String asString(int[] a, String conversion, String prefix, String separator, String postfix)
a - the arrayconversion - the conversion used on each elementprefix - the prefix at the start of the string representationseparator - the separator between elementspostfix - the postfix after the end of the string representationpublic static String asString(int[] a, String conversion)
a - the arrayconversion - the conversion used on each elementpublic static String asString(long[] a, String conversion, String prefix, String separator, String postfix)
a - the arrayconversion - the conversion used on each elementprefix - the prefix at the start of the string representationseparator - the separator between elementspostfix - the postfix after the end of the string representationpublic static String asString(long[] a, String conversion)
a - the arrayconversion - the conversion used on each elementpublic static String asString(float[] a, String conversion, String prefix, String separator, String postfix)
a - the arrayconversion - the conversion used on each elementprefix - the prefix at the start of the string representationseparator - the separator between elementspostfix - the postfix after the end of the string representationpublic static String asString(float[] a, String conversion)
a - the arrayconversion - the conversion used on each elementpublic static String asString(double[] a, String conversion, String prefix, String separator, String postfix)
a - the arrayconversion - the conversion used on each elementprefix - the prefix at the start of the string representationseparator - the separator between elementspostfix - the postfix after the end of the string representationpublic static String asString(double[] a, String conversion)
a - the arrayconversion - the conversion used on each elementpublic static <T> String asString(T[] a, String conversion, String prefix, String separator, String postfix)
a - the arrayconversion - the conversion used on each elementprefix - the prefix at the start of the string representationseparator - the separator between elementspostfix - the postfix after the end of the string representationCopyright © 2014–2016 Tomas Teubner. All rights reserved.