Package com.aowagie.text
Class Anchor
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList
-
- com.aowagie.text.Phrase
-
- com.aowagie.text.Anchor
-
- All Implemented Interfaces:
Element
,TextElementArray
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable
,java.util.Collection
,java.util.List
,java.util.RandomAccess
public class Anchor extends Phrase
AnAnchor
can be a reference or a destination of a reference.An
Anchor
is a special kind ofPhrase
. 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
Fields Modifier and Type Field Description private java.lang.String
name
This is the name of theAnchor
.private java.lang.String
reference
This is the reference of theAnchor
.private static long
serialVersionUID
-
Fields inherited from interface com.aowagie.text.Element
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ArrayList
getChunks()
Gets all the chunks in this element.java.lang.String
getName()
Returns the name of thisAnchor
.java.lang.String
getReference()
Gets the reference of thisAnchor
.java.net.URL
getUrl()
Gets the reference of thisAnchor
.boolean
process(ElementListener listener)
Processes the element by adding it (or the different parts) to anElementListener
.void
setName(java.lang.String name)
Sets the name of thisAnchor
.void
setReference(java.lang.String reference)
Sets the reference of thisAnchor
.int
type()
Gets the type of the text element.-
Methods inherited from class com.aowagie.text.Phrase
add, add, addAll, addSpecial, getContent, getFont, getHyphenation, getLeading, hasLeading, isContent, isEmpty, isNestable, setFont, setHyphenation, setLeading
-
Methods inherited from class java.util.ArrayList
addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
name
private java.lang.String name
This is the name of theAnchor
.
-
reference
private java.lang.String reference
This is the reference of theAnchor
.
-
-
Constructor Detail
-
Anchor
public Anchor()
Constructs anAnchor
without specifying a leading.
-
Anchor
public Anchor(Phrase phrase)
Constructs anAnchor
with a certainPhrase
.- Parameters:
phrase
- aPhrase
-
-
Method Detail
-
process
public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to anElementListener
.
-
getChunks
public java.util.ArrayList getChunks()
Gets all the chunks in this element.
-
type
public int type()
Gets the type of the text element.
-
setName
public void setName(java.lang.String name)
Sets the name of thisAnchor
.- Parameters:
name
- a new name
-
setReference
public void setReference(java.lang.String reference)
Sets the reference of thisAnchor
.- Parameters:
reference
- a new reference
-
getName
public java.lang.String getName()
Returns the name of thisAnchor
.- Returns:
- a name
-
getReference
public java.lang.String getReference()
Gets the reference of thisAnchor
.- Returns:
- a reference
-
getUrl
public java.net.URL getUrl()
Gets the reference of thisAnchor
.- Returns:
- an
URL
-
-