Class JsonArrayImpl.JsonArrayIterator

  • All Implemented Interfaces:
    Iterator<jakarta.json.JsonValue>
    Enclosing class:
    JsonArrayImpl

    private class JsonArrayImpl.JsonArrayIterator
    extends Object
    implements Iterator<jakarta.json.JsonValue>
    We don't need any range check, so we can simplify the Iterator logic. get() on an ArrayList works even faster than ArrayList#iterator!
    • Field Detail

      • cursor

        private int cursor
    • Constructor Detail

      • JsonArrayIterator

        private JsonArrayIterator()
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<jakarta.json.JsonValue>
      • next

        public jakarta.json.JsonValue next()
        Specified by:
        next in interface Iterator<jakarta.json.JsonValue>