Class CBORParser.TagList

  • Enclosing class:
    CBORParser

    public static final class CBORParser.TagList
    extends java.lang.Object
    Class for keeping track of tags in an optimized manner.
    Since:
    2.15
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int _tagCount  
      private int[] _tags  
    • Constructor Summary

      Constructors 
      Constructor Description
      TagList()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void 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 getFirstTag()
      Gets the first tag in the list.
      boolean isEmpty()
      Checks whether the tag list is empty.
      int size()
      Gets the number of tags available.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _tags

        private int[] _tags
      • _tagCount

        private int _tagCount
    • Constructor Detail

      • TagList

        public TagList()
    • Method Detail

      • 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.