Added basic append method for many types.

This commit is contained in:
Christian P. MOMON 2017-05-05 10:13:16 +02:00
parent 9154acbfe0
commit f07a364934

View file

@ -105,6 +105,54 @@ public class StringList extends ArrayList<String> implements CharSequence
}
}
/**
* Appends the string of the array argument to this boolean list.
*
* @param strings
* @return
*/
public StringList append(final boolean... items)
{
StringList result;
if (items != null)
{
for (boolean item : items)
{
this.append(item);
}
}
result = this;
//
return result;
}
/**
* Appends the string of the array argument to this byte list.
*
* @param strings
* @return
*/
public StringList append(final byte... items)
{
StringList result;
if (items != null)
{
for (byte item : items)
{
this.append(item);
}
}
result = this;
//
return result;
}
/**
* Appends the string representation of the char argument to this string
* list.
@ -124,6 +172,30 @@ public class StringList extends ArrayList<String> implements CharSequence
return result;
}
/**
* Appends the string of the array argument to this char list.
*
* @param strings
* @return
*/
public StringList append(final char... items)
{
StringList result;
if (items != null)
{
for (char item : items)
{
this.append(item);
}
}
result = this;
//
return result;
}
/**
* Appends the string of the specified collection, in the order they are
* returned by the collection's iterator.
@ -222,6 +294,30 @@ public class StringList extends ArrayList<String> implements CharSequence
return result;
}
/**
* Appends the string of the array argument to this short list.
*
* @param strings
* @return
*/
public StringList append(final short... items)
{
StringList result;
if (items != null)
{
for (short item : items)
{
this.append(item);
}
}
result = this;
//
return result;
}
/**
* Appends the string representation of the long argument to this string
* list.
@ -303,6 +399,60 @@ public class StringList extends ArrayList<String> implements CharSequence
return result;
}
/**
* Appends the string of the array argument to this boolean list.
*
* @param items
* @return
*/
public StringList appendln(final boolean... items)
{
StringList result;
append(items).appendln();
result = this;
//
return result;
}
/**
* Appends the string of the array argument to this byte list.
*
* @param items
* @return
*/
public StringList appendln(final byte... items)
{
StringList result;
append(items).appendln();
result = this;
//
return result;
}
/**
* Appends the string of the array argument to this char list.
*
* @param strings
* @return
*/
public StringList appendln(final char... items)
{
StringList result;
append(items).appendln();
result = this;
//
return result;
}
/**
* Appends the string representation of the char argument to this string
* list, then append a break line too.
@ -405,6 +555,24 @@ public class StringList extends ArrayList<String> implements CharSequence
return result;
}
/**
* Appends the string of the array argument to this short list.
*
* @param strings
* @return
*/
public StringList appendln(final short... items)
{
StringList result;
append(items).appendln();
result = this;
//
return result;
}
/**
* Appendln.
*