## com.lowagie.text
Class Anchor

    java.lang.Object
      java.util.AbstractCollection<E>
          java.util.AbstractList<E>
              java.util.ArrayList
                  com.lowagie.text.Phrase
                      com.lowagie.text.Anchor

All Implemented Interfaces:
  Element, MarkupAttributes, TextElementArray, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

    public class Anchor

extends Phrase
implements TextElementArray, MarkupAttributes

An `Anchor` can be a reference or a destination of a reference.

An `Anchor` is a special kind of `Phrase`. It is constructed in the same way.

Example:

>      Anchor anchor = new Anchor("this is a link");
>      anchor.setName("LINK");
>      anchor.setReference("http://www.lowagie.com");

See Also:
  `Element`, `Phrase`, Serialized Form

Field Summary
`static java.lang.String` `ANCHOR` This is the anchor tag.
`protected java.lang.String` `name` This is the name of the `Anchor`.
`protected java.lang.String` `reference` This is the reference of the `Anchor`.

Fields inherited from class com.lowagie.text.Phrase
`font, leading, markupAttributes`

Fields inherited from class java.util.AbstractList
`modCount`

Fields inherited from interface com.lowagie.text.Element

`ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE`

Fields inherited from interface com.lowagie.text.Element

`ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE`

Constructor Summary
`Anchor()` Constructs an `Anchor` without specifying a leading.
`Anchor(Chunk chunk)` Constructs an `Anchor` with a certain `Chunk`.
`Anchor(float leading)` Constructs an `Anchor` with a certain leading.
`Anchor(float leading, Chunk chunk)` Constructs an `Anchor` with a certain `Chunk` and a certain leading.
`Anchor(float leading, java.lang.String string)` Constructs an `Anchor` with a certain leading and a certain `String`.
`Anchor(float leading, java.lang.String string, Font font)` Constructs an `Anchor` with a certain leading, a certain `String` and a certain `Font`.
`Anchor(java.util.Properties attributes)` Returns an `Anchor` that has been constructed taking in account the value of some attributes.
`Anchor(java.lang.String string)` Constructs an `Anchor` with a certain `String`.
`Anchor(java.lang.String string, Font font)` Constructs an `Anchor` with a certain `String` and a certain `Font`.

Method Summary
`java.util.ArrayList` `getChunks()` Gets all the chunks in this element.
`java.util.Iterator` `getElements()` Gets an iterator of `Element`s.
`static boolean` `isTag(java.lang.String tag)` Checks if a given tag corresponds with this object.
`java.lang.String` `name()` Returns the name of this `Anchor`.
`boolean` `process(ElementListener listener)` Processes the element by adding it (or the different parts) to an `ElementListener`.
`java.lang.String` `reference()` Gets the reference of this `Anchor`.
`void` `setName(java.lang.String name)` Sets the name of this `Anchor`.
`void` `setReference(java.lang.String reference)` Sets the reference of this `Anchor`.
`int` `type()` Gets the type of the text element.
`java.net.URL` `url()` Gets the reference of this `Anchor`.

Methods inherited from class com.lowagie.text.Phrase
`add, add, addAll, addSpecial, content, font, getInstance, getInstance, getInstance, getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, isEmpty, leading, leadingDefined, setLeading, setMarkupAttribute, setMarkupAttributes`

Methods inherited from class java.util.ArrayList
`addAll, clear, clone, contains, ensureCapacity, get, indexOf, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize`

Methods inherited from class java.util.AbstractList
`equals, hashCode, iterator, listIterator, listIterator, subList`

Methods inherited from class java.util.AbstractCollection
`containsAll, removeAll, retainAll, toString`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.lowagie.text.TextElementArray
`add`

Methods inherited from interface com.lowagie.text.Element
`toString`

Methods inherited from interface com.lowagie.text.MarkupAttributes
`getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, setMarkupAttribute, setMarkupAttributes`

Methods inherited from interface com.lowagie.text.Element
`toString`

Methods inherited from interface java.util.List
`containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList`

Field Detail

### ANCHOR

    public static final java.lang.String ANCHOR

  This is the anchor tag.

  See Also:
    Constant Field Values

### name

    protected java.lang.String name

  This is the name of the `Anchor`.

### reference

    protected java.lang.String reference

  This is the reference of the `Anchor`.

Constructor Detail

### Anchor

    public Anchor()

  Constructs an `Anchor` without specifying a leading.

### Anchor

    public Anchor(float leading)

  Constructs an `Anchor` with a certain leading.

  Parameters:
    `leading` - the leading

### Anchor

    public Anchor(Chunk chunk)

  Constructs an `Anchor` with a certain `Chunk`.

  Parameters:
    `chunk` - a `Chunk`

### Anchor

    public Anchor(java.lang.String string)

  Constructs an `Anchor` with a certain `String`.

  Parameters:
    `string` - a `String`

### Anchor

    public Anchor(java.lang.String string,
                  Font font)

  Constructs an `Anchor` with a certain `String` and a certain `Font`.

  Parameters:
    `string` - a `String`
    `font` - a `Font`

### Anchor

    public Anchor(float leading,
                  Chunk chunk)

  Constructs an `Anchor` with a certain `Chunk` and a certain leading.

  Parameters:
    `leading` - the leading
    `chunk` - a `Chunk`

### Anchor

    public Anchor(float leading,
                  java.lang.String string)

  Constructs an `Anchor` with a certain leading and a certain `String`.

  Parameters:
    `leading` - the leading
    `string` - a `String`

### Anchor

    public Anchor(float leading,
                  java.lang.String string,
                  Font font)

  Constructs an `Anchor` with a certain leading, a certain `String` and a certain `Font`.

  Parameters:
    `leading` - the leading
    `string` - a `String`
    `font` - a `Font`

### Anchor

    public Anchor(java.util.Properties attributes)

  Returns an `Anchor` that has been constructed taking in account the value of some attributes.

  Parameters:
    `attributes` - Some attributes

Method Detail

### process

    public boolean process(ElementListener listener)

  Processes the element by adding it (or the different parts) to an `ElementListener`.

  Specified by:
    `process` in interface `Element`
  Overrides:
    `process` in class `Phrase`
  Parameters:
    `listener` - an `ElementListener`
  Returns:
    `true` if the element was processed successfully

### getChunks

    public java.util.ArrayList getChunks()

  Gets all the chunks in this element.

  Specified by:
    `getChunks` in interface `Element`
  Overrides:
    `getChunks` in class `Phrase`
  Returns:
    an `ArrayList`

### type

    public int type()

  Gets the type of the text element.

  Specified by:
    `type` in interface `Element`
  Overrides:
    `type` in class `Phrase`
  Returns:
    a type

### getElements

    public java.util.Iterator getElements()

  Gets an iterator of `Element`s.

  Returns:
    an `Iterator`

### setName

    public void setName(java.lang.String name)

  Sets the name of this `Anchor`.

  Parameters:
    `name` - a new name

### setReference

    public void setReference(java.lang.String reference)

  Sets the reference of this `Anchor`.

  Parameters:
    `reference` - a new reference

### name

    public java.lang.String name()

  Returns the name of this `Anchor`.

  Returns:
    a name

### reference

    public java.lang.String reference()

  Gets the reference of this `Anchor`.

  Returns:
    a reference

### url

    public java.net.URL url()

  Gets the reference of this `Anchor`.

  Returns:
    an `URL`

### isTag

    public static boolean isTag(java.lang.String tag)

  Checks if a given tag corresponds with this object.

  Parameters:
    `tag` - the given tag
  Returns:
    true if the tag corresponds