class PdfCollectionItem extends PdfDictionary {

    /**
     * The PdfCollectionSchema with the names and types of the items.
     */
    PdfCollectionSchema schema;

    /**
     * Constructs a Collection Item that can be added to a PdfFileSpecification.
     *
     * @param schema the PdfCollectionSchema
     */
    public PdfCollectionItem(PdfCollectionSchema schema) {
        super(PdfName.COLLECTIONITEM);
        this.schema = schema;
    }

    /**
     * Sets the value of the collection item.
     *
     * @param value the value (a String)
     * @param key   the key
     */
    public void addItem(String key, String value) {
        PdfName fieldname = new PdfName(key);
        PdfCollectionField field = (PdfCollectionField) schema.get(fieldname);
        put(fieldname, field.getValue(value));
    }

    /**
     * Sets the value of the collection item.
     *
     * @param value the value (a PdfString)
     * @param key   the key
     */
    public void addItem(String key, PdfString value) {<FILL_FUNCTION_BODY>}

    /**
     * Sets the value of the collection item.
     *
     * @param d   the value (a PdfDate)
     * @param key the key
     */
    public void addItem(String key, PdfDate d) {
        PdfName fieldname = new PdfName(key);
        PdfCollectionField field = (PdfCollectionField) schema.get(fieldname);
        if (field.fieldType == PdfCollectionField.DATE) {
            put(fieldname, d);
        }
    }

    /**
     * Sets the value of the collection item.
     *
     * @param n   the value (a PdfNumber)
     * @param key the key
     */
    public void addItem(String key, PdfNumber n) {
        PdfName fieldname = new PdfName(key);
        PdfCollectionField field = (PdfCollectionField) schema.get(fieldname);
        if (field.fieldType == PdfCollectionField.NUMBER) {
            put(fieldname, n);
        }
    }

    /**
     * Sets the value of the collection item.
     *
     * @param c   the value (a Calendar)
     * @param key the key
     */
    public void addItem(String key, Calendar c) {
        addItem(key, new PdfDate(c));
    }

    /**
     * Sets the value of the collection item.
     *
     * @param i   the value
     * @param key the key
     */
    public void addItem(String key, int i) {
        addItem(key, new PdfNumber(i));
    }

    /**
     * Sets the value of the collection item.
     *
     * @param f   the value
     * @param key the key
     */
    public void addItem(String key, float f) {
        addItem(key, new PdfNumber(f));
    }

    /**
     * Sets the value of the collection item.
     *
     * @param d   the value
     * @param key the key
     */
    public void addItem(String key, double d) {
        addItem(key, new PdfNumber(d));
    }

    /**
     * Adds a prefix for the Collection item. You can only use this method after you have set the value of the item.
     *
     * @param prefix a prefix
     * @param key    the key
     */
    public void setPrefix(String key, String prefix) {
        PdfName fieldname = new PdfName(key);
        PdfObject o = get(fieldname);
        if (o == null) {
            throw new IllegalArgumentException(
                    MessageLocalization.getComposedMessage("you.must.set.a.value.before.adding.a.prefix"));
        }
        PdfDictionary dict = new PdfDictionary(PdfName.COLLECTIONSUBITEM);
        dict.put(PdfName.D, o);
        dict.put(PdfName.P, new PdfString(prefix, PdfObject.TEXT_UNICODE));
        put(fieldname, dict);
    }
}

        PdfName fieldname = new PdfName(key);
        PdfCollectionField field = (PdfCollectionField) schema.get(fieldname);
        if (field.fieldType == PdfCollectionField.TEXT) {
            put(fieldname, value);
        }
    
<methods>public void <init>() ,public void <init>(com.lowagie.text.pdf.PdfName) ,public void clear() ,public boolean contains(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfObject get(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfArray getAsArray(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfBoolean getAsBoolean(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfDictionary getAsDict(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfIndirectReference getAsIndirectObject(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfName getAsName(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfNumber getAsNumber(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfStream getAsStream(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfString getAsString(com.lowagie.text.pdf.PdfName) ,public com.lowagie.text.pdf.PdfObject getDirectObject(com.lowagie.text.pdf.PdfName) ,public Set<com.lowagie.text.pdf.PdfName> getKeys() ,public Set<Entry<com.lowagie.text.pdf.PdfName,com.lowagie.text.pdf.PdfObject>> getKeysAndValues() ,public boolean isCatalog() ,public boolean isFont() ,public boolean isOutlineTree() ,public boolean isPage() ,public boolean isPages() ,public void merge(com.lowagie.text.pdf.PdfDictionary) ,public void mergeDifferent(com.lowagie.text.pdf.PdfDictionary) ,public void put(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject) ,public void putAll(com.lowagie.text.pdf.PdfDictionary) ,public void putEx(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject) ,public void remove(com.lowagie.text.pdf.PdfName) ,public int size() ,public void toPdf(com.lowagie.text.pdf.PdfWriter, java.io.OutputStream) throws java.io.IOException,public java.lang.String toString() <variables>public static final com.lowagie.text.pdf.PdfName CATALOG,public static final com.lowagie.text.pdf.PdfName FONT,public static final com.lowagie.text.pdf.PdfName OUTLINES,public static final com.lowagie.text.pdf.PdfName PAGE,public static final com.lowagie.text.pdf.PdfName PAGES,private com.lowagie.text.pdf.PdfName dictionaryType,protected Map<com.lowagie.text.pdf.PdfName,com.lowagie.text.pdf.PdfObject> hashMap