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.String
concatenate()
Returns all set elements concatenated by a semicolon (;) into one string.String
concatenate(String delimiter)
Returns all set elements concatenated by the given delimiter into one string.static Ztrings
fromList(Collection<String> c)
Returns a new set that contains the elements of the given collection.Ztrings
intersection(Collection<String> c)
Returns a new set containing the elements that are contained in both this set and the given collection.static Ztrings
split(String string)
Returns a new set containing the components of the given string after being split by a semicolon (;).static Ztrings
split(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 ofUUID
elements.Ztrings
union(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:
intersection
in 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 ofUUID
elements.- Returns:
- all the elements of this set as a set of UUID elements.
-