class Anchor extends Phrase {

    // constant
    private static final long serialVersionUID = -852278536049236911L;

    // membervariables

    /**
     * This is the name of the <CODE>Anchor</CODE>.
     */
    protected String name = null;

    /**
     * This is the reference of the <CODE>Anchor</CODE>.
     */
    protected String reference = null;

    // constructors

    /**
     * Constructs an <CODE>Anchor</CODE> without specifying a leading.
     */
    public Anchor() {
        super(16);
    }

    /**
     * Constructs an <CODE>Anchor</CODE> with a certain leading.
     *
     * @param leading the leading
     */

    public Anchor(float leading) {
        super(leading);
    }

    /**
     * Constructs an <CODE>Anchor</CODE> with a certain <CODE>Chunk</CODE>.
     *
     * @param chunk a <CODE>Chunk</CODE>
     */
    public Anchor(Chunk chunk) {
        super(chunk);
    }

    /**
     * Constructs an <CODE>Anchor</CODE> with a certain <CODE>String</CODE>.
     *
     * @param string a <CODE>String</CODE>
     */
    public Anchor(String string) {
        super(string);
    }

    /**
     * Constructs an <CODE>Anchor</CODE> with a certain <CODE>String</CODE> and a certain <CODE>Font</CODE>.
     *
     * @param string a <CODE>String</CODE>
     * @param font   a <CODE>Font</CODE>
     */
    public Anchor(String string, Font font) {
        super(string, font);
    }

    /**
     * Constructs an <CODE>Anchor</CODE> with a certain <CODE>Chunk</CODE> and a certain leading.
     *
     * @param leading the leading
     * @param chunk   a <CODE>Chunk</CODE>
     */
    public Anchor(float leading, Chunk chunk) {
        super(leading, chunk);
    }

    /**
     * Constructs an <CODE>Anchor</CODE> with a certain leading and a certain <CODE>String</CODE>.
     *
     * @param leading the leading
     * @param string  a <CODE>String</CODE>
     */
    public Anchor(float leading, String string) {
        super(leading, string);
    }

    /**
     * Constructs an <CODE>Anchor</CODE> with a certain leading, a certain <CODE>String</CODE> and a certain
     * <CODE>Font</CODE>.
     *
     * @param leading the leading
     * @param string  a <CODE>String</CODE>
     * @param font    a <CODE>Font</CODE>
     */
    public Anchor(float leading, String string, Font font) {
        super(leading, string, font);
    }

    /**
     * Constructs an <CODE>Anchor</CODE> with a certain <CODE>Phrase</CODE>.
     *
     * @param phrase a <CODE>Phrase</CODE>
     */
    public Anchor(Phrase phrase) {
        super(phrase);
        if (phrase instanceof Anchor) {
            Anchor a = (Anchor) phrase;
            setName(a.name);
            setReference(a.reference);
        }
    }

    // implementation of the Element-methods

    /**
     * Processes the element by adding it (or the different parts) to an
     * <CODE>ElementListener</CODE>.
     *
     * @param listener an <CODE>ElementListener</CODE>
     * @return <CODE>true</CODE> if the element was processed successfully
     */
    public boolean process(ElementListener listener) {
        try {
            Chunk chunk;
            Iterator i = getChunks().iterator();
            boolean localDestination = (reference != null && reference.startsWith("#"));
            boolean notGotoOK = true;
            while (i.hasNext()) {
                chunk = (Chunk) i.next();
                if (name != null && notGotoOK && !chunk.isEmpty()) {
                    chunk.setLocalDestination(name);
                    notGotoOK = false;
                }
                if (localDestination) {
                    chunk.setLocalGoto(reference.substring(1));
                }
                listener.add(chunk);
            }
            return true;
        } catch (DocumentException de) {
            return false;
        }
    }

    /**
     * Gets all the chunks in this element.
     *
     * @return an <CODE>ArrayList</CODE>
     */
    public ArrayList<Element> getChunks() {
        ArrayList<Element> tmp = new ArrayList<>();
        Chunk chunk;
        Iterator<Element> i = iterator();
        boolean localDestination = (reference != null && reference.startsWith("#"));
        boolean notGotoOK = true;
        while (i.hasNext()) {
            chunk = (Chunk) i.next();
            if (name != null && notGotoOK && !chunk.isEmpty()) {
                chunk.setLocalDestination(name);
                notGotoOK = false;
            }
            if (localDestination) {
                chunk.setLocalGoto(reference.substring(1));
            } else if (reference != null) {
                chunk.setAnchor(reference);
            }
            tmp.add(chunk);
        }
        return tmp;
    }

    /**
     * Gets the type of the text element.
     *
     * @return a type
     */
    public int type() {
        return Element.ANCHOR;
    }

    // methods

    /**
     * Returns the name of this <CODE>Anchor</CODE>.
     *
     * @return a name
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the name of this <CODE>Anchor</CODE>.
     *
     * @param name a new name
     */
    public void setName(String name) {
        this.name = name;
    }

    // methods to retrieve information

    /**
     * Gets the reference of this <CODE>Anchor</CODE>.
     *
     * @return a reference
     */
    public String getReference() {
        return reference;
    }

    /**
     * Sets the reference of this <CODE>Anchor</CODE>.
     *
     * @param reference a new reference
     */
    public void setReference(String reference) {
        this.reference = reference;
    }

    /**
     * Gets the reference of this <CODE>Anchor</CODE>.
     *
     * @return an <CODE>URL</CODE>
     */
    public URL getUrl() {<FILL_FUNCTION_BODY>}

}

        try {
            return new URL(reference);
        } catch (MalformedURLException mue) {
            return null;
        }
    
<methods>public void <init>() ,public void <init>(com.lowagie.text.Phrase) ,public void <init>(float) ,public void <init>(com.lowagie.text.Chunk) ,public void <init>(float, com.lowagie.text.Chunk) ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, com.lowagie.text.Font) ,public void <init>(float, java.lang.String) ,public void <init>(float, java.lang.String, com.lowagie.text.Font) ,public void add(int, com.lowagie.text.Element) ,public boolean add(java.lang.String) ,public boolean add(com.lowagie.text.Element) ,public boolean addAll(Collection<? extends com.lowagie.text.Element>) ,public ArrayList<com.lowagie.text.Element> getChunks() ,public java.lang.String getContent() ,public com.lowagie.text.Font getFont() ,public com.lowagie.text.pdf.HyphenationEvent getHyphenation() ,public static final com.lowagie.text.Phrase getInstance(java.lang.String) ,public static final com.lowagie.text.Phrase getInstance(int, java.lang.String) ,public static final com.lowagie.text.Phrase getInstance(int, java.lang.String, com.lowagie.text.Font) ,public float getLeading() ,public boolean hasLeading() ,public boolean isContent() ,public boolean isEmpty() ,public boolean isNestable() ,public boolean process(com.lowagie.text.ElementListener) ,public void setFont(com.lowagie.text.Font) ,public void setHyphenation(com.lowagie.text.pdf.HyphenationEvent) ,public void setLeading(float) ,public int type() <variables>protected com.lowagie.text.Font font,protected com.lowagie.text.pdf.HyphenationEvent hyphenation,protected float leading,private static final long serialVersionUID