Package org.spiderwiz.zutils
Class Ztrings
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<String>,Collection<String>,Set<String>
public class Ztrings extends ZHashSet<String>
Extension of
ZHashSet<String> with some utility methods.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description Ztrings() -
Method Summary
Modifier and Type Method Description Collection<String>asCollection()Casts the object to a generic collection of strings.Stringconcatenate()Returns all set elements concatenated by a semicolon (;) into one string.Stringconcatenate(String delimiter)Returns all set elements concatenated by the given delimiter into one string.static ZtringsfromList(Collection<String> c)Returns a new set that contains the elements of the given collection.Ztringsintersection(Collection<String> c)Returns a new set containing the elements that are contained in both this set and the given collection.static Ztringssplit(String string)Returns a new set containing the components of the given string after being split by a semicolon (;).static Ztringssplit(String string, String delimiter)Returns a new set containing the components of the given string after being split by the given delimiter.ZHashSet<UUID>toUUIDs()Converts a set of strings to a set ofUUIDelements.Ztringsunion(Collection<String> c)Returns a new set containing all elements of both this set and the given collection.Methods inherited from class org.spiderwiz.zutils.ZHashSet
add, addAll, addTo, anyMatch, clear, contains, containsAll, forEach, intersection, isEmpty, lockRead, lockWrite, remove, removeAll, removeIf, retainAll, size, toArray, unlockRead, unlockWrite
-
Constructor Details
-
Ztrings
public Ztrings()
-
-
Method Details
-
asCollection
Casts the object to a generic collection of strings.- Returns:
- the object as a generic collection of strings.
-
fromList
Returns a new set that contains the elements of the given collection.- Parameters:
c- the given collection.- Returns:
- a new set that contains the elements of the given collection.
-
concatenate
Returns all set elements concatenated by the given delimiter into one string.- Parameters:
delimiter- the delimiter to use for concatenation.- Returns:
- all set elements concatenated by the given delimiter into one string.
-
concatenate
Returns all set elements concatenated by a semicolon (;) into one string.- Returns:
- all set elements concatenated by a semicolon (;) into one string.
-
split
Returns a new set containing the components of the given string after being split by the given delimiter.- Parameters:
string- the string to split.delimiter- the delimiter to use from splitting.- Returns:
- a new set containing the components of the given string after being split by the given delimiter.
-
split
Returns a new set containing the components of the given string after being split by a semicolon (;).- Parameters:
string- the string to split.- Returns:
- a new set containing the components of the given string after being split by a semicolon (;).
-
union
Returns a new set containing all elements of both this set and the given collection. -
intersection
Returns a new set containing the elements that are contained in both this set and the given collection.- Overrides:
intersectionin classZHashSet<String>- Parameters:
c- the collection to intersect with this set.- Returns:
- a new set containing the elements that are contained in both this set and the given collection.
-
toUUIDs
Converts a set of strings to a set ofUUIDelements.- Returns:
- all the elements of this set as a set of UUID elements.
-