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 TypeMethodDescriptionvoid
add
(int tag) Adds a tag to the list.void
clear()
Clears the tags from the list.boolean
contains
(int tag) Checks if a tag is present.int
Gets the first tag in the list.boolean
isEmpty()
Checks whether the tag list is empty.int
size()
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:
true
if there are no tags,false
if 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:
true
if the tag is present,false
if 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.
-