org.apache.fop.pdf

## Class PDFNumsArray

- java.lang.Object
- - org.apache.fop.pdf.PDFObject
  - - org.apache.fop.pdf.PDFNumsArray

- All Implemented Interfaces:
    PDFWritable

      public class PDFNumsArray
      extends PDFObject

  Class representing an "Nums" array object (for Number Trees).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.SortedMap<java.lang.Integer,java.lang.Object>` | `map` Sorted Map holding the values of this array.

    - ### Fields inherited from class org.apache.fop.pdf.PDFObject

      `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PDFNumsArray(PDFObject parent)` Create a new, empty array object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `get(int key)` Gets an entry.
    `java.lang.Object` | `get(java.lang.Integer key)` Gets an entry.
    `int` | `length()` Returns the length of the array
    `int` | `output(java.io.OutputStream stream)` Write the PDF represention of this object
    `void` | `put(java.lang.Integer key, java.lang.Object obj)` Sets an entry.
    `void` | `put(int key, java.lang.Object obj)` Sets an entry.

    - ### Methods inherited from class org.apache.fop.pdf.PDFObject

      `contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getChildren, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### map

          protected java.util.SortedMap<java.lang.Integer,java.lang.Object> map

      Sorted Map holding the values of this array.

  - ### Constructor Detail

    - #### PDFNumsArray

          public PDFNumsArray(PDFObject parent)

      Create a new, empty array object.
      Parameters:
        `parent` - the object's parent if any

  - ### Method Detail

    - #### length

          public int length()

      Returns the length of the array
      Returns:
        the length of the array

    - #### put

          public void put(java.lang.Integer key,
                          java.lang.Object obj)

      Sets an entry.
      Parameters:
        `key` - the key of the value to set
        `obj` - the new value

    - #### put

          public void put(int key,
                          java.lang.Object obj)

      Sets an entry.
      Parameters:
        `key` - the key of the value to set
        `obj` - the new value

    - #### get

          public java.lang.Object get(java.lang.Integer key)

      Gets an entry.
      Parameters:
        `key` - the key of requested value
      Returns:
        the requested value

    - #### get

          public java.lang.Object get(int key)

      Gets an entry.
      Parameters:
        `key` - the key of requested value
      Returns:
        the requested value

    - #### output

          public int output(java.io.OutputStream stream)
                     throws java.io.IOException

      Write the PDF represention of this object
      Overrides:
        `output` in class `PDFObject`
      Parameters:
        `stream` - the stream to write the PDF to
      Returns:
        the number of bytes written
      Throws:
        `java.io.IOException` - if there is an error writing to the stream

Copyright 1999-2021 The Apache Software Foundation. All Rights Reserved.