Package org.oscim.core
Class TagSet
java.lang.Object
org.oscim.core.TagSet
The Class TagSet holds a set of Tags.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the Tag tag to TagSet.Tag[]asArray()Return Tags contained in TagSet as new array.voidclear()Reset the TagSet to contain 0 tags.voidClear.booleanChecks if a Tag with given key and value is contained in TagSet.booleancontains(Collection<Tag> tags) Checks if any tag is contained in TagSet.booleanChecks if 'tag' is contained in TagSet.booleancontainsKey(String key) Checks if any tag has the key 'key'.get(int index) Find Tag by given index.Find Tag by given key.Tag[]getTags()Return Tags array contained in TagSet.Get the value for a given key.voidSets the tags from 'tagArray'.voidSets the tags from 'tagSet'.intsize()toString()
-
Constructor Details
-
TagSet
public TagSet()Instantiates a new TagSet with initial size of 10. -
TagSet
public TagSet(int size) Instantiates a new tag set initialized with the given size.- Parameters:
size- the initial size.
-
-
Method Details
-
clear
public void clear()Reset the TagSet to contain 0 tags. -
size
public int size()- Returns:
- Size of TagSet
-
clearAndNullTags
public void clearAndNullTags()Clear. Reset the TagSet to contain 0 tags and null out tags. -
asArray
Return Tags contained in TagSet as new array.- Returns:
- the tag[]
-
get
Find Tag by given index.- Parameters:
index- the index of tag.- Returns:
- the tag if found, null otherwise.
-
get
Find Tag by given key.- Parameters:
key- the key as intern String.- Returns:
- the tag if found, null otherwise.
-
getTags
Return Tags array contained in TagSet.- Returns:
- the tags array.
-
containsKey
Checks if any tag has the key 'key'.- Parameters:
key- the key as intern String.- Returns:
- true, if any tag has the given key
-
getValue
Get the value for a given key.- Parameters:
key- the key as intern String- Returns:
- the value when found, null otherwise
-
add
Adds the Tag tag to TagSet.- Parameters:
tag- the Tag to be added
-
set
Sets the tags from 'tagArray'.- Parameters:
tagArray- the tag array
-
set
Sets the tags from 'tagSet'.- Parameters:
tagSet- the tag set
-
contains
Checks if 'tag' is contained in TagSet.- Parameters:
tag- the tag- Returns:
- true, iff tag is in TagSet
-
contains
Checks if a Tag with given key and value is contained in TagSet.- Parameters:
key- the key as intern Stringvalue- the value as intern String- Returns:
- true, iff any tag has the given key and value
-
contains
Checks if any tag is contained in TagSet.- Parameters:
tags- the tags- Returns:
- true, iff any tag is in TagSet
-
toString
-