public class StringContainer extends Object
toString is called. Note:it's not thread safety| Constructor and Description |
|---|
StringContainer()
defines the constructor function for the class.
|
StringContainer(String joinSeparator)
defines the constructor function for the class.
|
StringContainer(String[] strings) |
StringContainer(String[] strings,
String joinSeparator) |
| Modifier and Type | Method and Description |
|---|---|
StringContainer |
addHead(String... strings)
add a Strings array from this container's header.
strings:"a","b","c", StringContainer this:["d","e","f"], result:this:["a","b","c","d","e","f"], |
StringContainer |
addHead(StringContainer myContainer)
add a StringContainer from this container's header.
StringContainer m:["a","b","c"], StringContainer this:["d","e","f"], result:this:["a","b","c","d","e","f"], |
StringContainer |
addTail(Object... objs)
add a objects array at this container's tail.
|
StringContainer |
addTail(String... strings)
add a Strings array at this container's tail.
strings:"a","b","c", StringContainer this:["d","e","f"], result:this:["d","e","f","a","b","c"], |
StringContainer |
addTail(StringContainer myContainer)
add a StringContainer at this container's tail.
param StringContainer:["a","b","c"], this StringContainer :["d","e","f"], result:this:["d","e","f","a","b","c"], |
StringContainer |
clone() |
boolean |
equals(Object sc) |
boolean |
equals(StringContainer sc)
judge whether the param is equal to this container.
|
List<String> |
getReverseList() |
List<String> |
getSequenceList() |
String |
getSubString(int index)
return a sub-string in this container.
e.g. |
StringContainer |
getSubStringContainer(int start,
int end)
/** return a sub-container consist of several continuous strings in this
container.If
start <= end, return a empty container e.g. |
int |
hashCode() |
String |
join(String separator)
for all string in rev and seq, concat them with separator and return String.
|
int |
length() |
int |
size() |
String |
toString() |
public StringContainer()
public StringContainer(String joinSeparator)
public StringContainer(String[] strings)
public int size()
public int length()
public StringContainer addTail(Object... objs)
objs - -to be addedpublic StringContainer addTail(String... strings)
strings - - to be addedpublic StringContainer addTail(StringContainer myContainer)
myContainer - - to be addedpublic StringContainer addHead(String... strings)
strings - - to be addedpublic StringContainer addHead(StringContainer myContainer)
myContainer - - given StringContainer to be add in headpublic String join(String separator)
separator - separator of stringpublic String getSubString(int index)
index - - the index of wanted sub-stringpublic StringContainer getSubStringContainer(int start, int end)
container.If
start <= end, return a empty container e.g. this container is ["aa","bbb","cc","d","ee"];
this.getSubString(0,0) = ["aa"]start - - the start index of wanted sub-stringend - - the end index of wanted sub-stringpublic boolean equals(StringContainer sc)
sc - -StringContainer Object to judge whether the object is equal to this containerpublic StringContainer clone()
Copyright © 2022 The Apache Software Foundation. All rights reserved.