public final class Tags
extends java.lang.Object
Constructor and Description |
---|
Tags(java.lang.String name)
Creates a new single tag recognized by the given name.
|
Tags(java.lang.String name,
java.lang.String type)
Creates a new single tag recognized by the given name
and optional tag type.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String name)
Adds a new single tag recognized by the given name to this tag collection.
|
void |
add(java.lang.String name,
java.lang.String type)
Adds a new single tag recognized by the given name and optional type to this tag collection.
|
void |
add(Tags tags)
Adds a collection of tags to this tag collection.
|
boolean |
contains(java.lang.String name)
Returns true if this tag set contains the specified element.
|
boolean |
contains(java.lang.String name,
java.lang.String type)
Returns true if this tag set contains the specified element.
|
boolean |
contains(Tags tags)
Returns true if this tag set contains all of the elements of the specified tag set.
|
java.lang.String |
getName()
Returns name of single tag or a comma separated list of
names of all tags in the collection.
|
int |
getSize()
Returns number of single tags in this tag collection.
|
boolean |
remove(java.lang.String name)
Removes a named tag from this tag collections, if present.
|
boolean |
remove(java.lang.String name,
java.lang.String type)
Removes a named tag from this tag collections, if present,
represented by its name and optional type.
|
boolean |
remove(Tags tags)
Removes all the tags, if present, denoted by the 'tags' argument
from this tag collection.
|
java.lang.String |
toString()
String representation of this tag collection.
|
public Tags(java.lang.String name)
name
- public Tags(java.lang.String name, java.lang.String type)
name
- type
- public void add(java.lang.String name)
name
- public void add(java.lang.String name, java.lang.String type)
name
- type
- public void add(Tags tags)
tags
- public boolean remove(java.lang.String name) throws java.lang.IllegalArgumentException
name
- java.lang.IllegalArgumentException
- if the result would be an empty collectionpublic boolean remove(java.lang.String name, java.lang.String type) throws java.lang.IllegalArgumentException
name
- type
- java.lang.IllegalArgumentException
- if the result would be an empty collectionpublic boolean remove(Tags tags) throws java.lang.IllegalArgumentException
tags
- java.lang.IllegalArgumentException
- if the result would be an empty collectionpublic java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
public int getSize()
public boolean contains(java.lang.String name)
name
- public boolean contains(java.lang.String name, java.lang.String type)
name
- type
- public boolean contains(Tags tags)
tags
-