Class CBORParser.TagList
java.lang.Object
com.fasterxml.jackson.dataformat.cbor.CBORParser.TagList
- Enclosing class:
CBORParser
Class for keeping track of tags in an optimized manner.
- Since:
- 2.15
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int tag) Adds a tag to the list.voidclear()Clears the tags from the list.booleancontains(int tag) Checks if a tag is present.intGets the first tag in the list.booleanisEmpty()Checks whether the tag list is empty.intsize()Gets the number of tags available.
-
Field Details
-
_tags
private int[] _tags -
_tagCount
private int _tagCount
-
-
Constructor Details
-
TagList
public TagList()
-
-
Method Details
-
size
public int size()Gets the number of tags available.- Returns:
- The number of tags.
-
isEmpty
public boolean isEmpty()Checks whether the tag list is empty.- Returns:
trueif there are no tags,falseif there are tags..
-
clear
public void clear()Clears the tags from the list. -
add
public void add(int tag) Adds a tag to the list.- Parameters:
tag- The tag to add.
-
contains
public boolean contains(int tag) Checks if a tag is present.- Parameters:
tag- The tag to check.- Returns:
trueif the tag is present,falseif it is not.
-
getFirstTag
public int getFirstTag()Gets the first tag in the list. This is primarily to support the legacy API.- Returns:
- The first tag or -1 if there are no tags.
-