Package com.lowagie.text
Class Anchor
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<Element>
-
- com.lowagie.text.Phrase
-
- com.lowagie.text.Anchor
-
- All Implemented Interfaces:
Element,TextElementArray,Serializable,Cloneable,Iterable<Element>,Collection<Element>,List<Element>,RandomAccess
public class Anchor extends Phrase
AnAnchorcan be a reference or a destination of a reference.An
Anchoris 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 protected StringnameThis is the name of theAnchor.protected StringreferenceThis is the reference of theAnchor.-
Fields inherited from class com.lowagie.text.Phrase
font, hyphenation, leading
-
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, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK
-
-
Constructor Summary
Constructors Constructor Description Anchor()Constructs anAnchorwithout specifying a leading.Anchor(float leading)Constructs anAnchorwith a certain leading.Anchor(float leading, Chunk chunk)Constructs anAnchorwith a certainChunkand a certain leading.Anchor(float leading, String string)Constructs anAnchorwith a certain leading and a certainString.Anchor(float leading, String string, Font font)Constructs anAnchorwith a certain leading, a certainStringand a certainFont.Anchor(Chunk chunk)Constructs anAnchorwith a certainChunk.Anchor(Phrase phrase)Constructs anAnchorwith a certainPhrase.Anchor(String string)Constructs anAnchorwith a certainString.Anchor(String string, Font font)Constructs anAnchorwith a certainStringand a certainFont.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayList<Element>getChunks()Gets all the chunks in this element.StringgetName()Returns the name of thisAnchor.StringgetReference()Gets the reference of thisAnchor.URLgetUrl()Gets the reference of thisAnchor.booleanprocess(ElementListener listener)Processes the element by adding it (or the different parts) to anElementListener.voidsetName(String name)Sets the name of thisAnchor.voidsetReference(String reference)Sets the reference of thisAnchor.inttype()Gets the type of the text element.-
Methods inherited from class com.lowagie.text.Phrase
add, add, add, addAll, addChunk, addSpecial, getContent, getFont, getHyphenation, getInstance, getInstance, getInstance, 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
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Constructor Detail
-
Anchor
public Anchor()
Constructs anAnchorwithout specifying a leading.
-
Anchor
public Anchor(float leading)
Constructs anAnchorwith a certain leading.- Parameters:
leading- the leading
-
Anchor
public Anchor(Chunk chunk)
Constructs anAnchorwith a certainChunk.- Parameters:
chunk- aChunk
-
Anchor
public Anchor(String string)
Constructs anAnchorwith a certainString.- Parameters:
string- aString
-
Anchor
public Anchor(String string, Font font)
Constructs anAnchorwith a certainStringand a certainFont.- Parameters:
string- aStringfont- aFont
-
Anchor
public Anchor(float leading, Chunk chunk)Constructs anAnchorwith a certainChunkand a certain leading.- Parameters:
leading- the leadingchunk- aChunk
-
Anchor
public Anchor(float leading, String string)Constructs anAnchorwith a certain leading and a certainString.- Parameters:
leading- the leadingstring- aString
-
Anchor
public Anchor(float leading, String string, Font font)Constructs anAnchorwith a certain leading, a certainStringand a certainFont.- Parameters:
leading- the leadingstring- aStringfont- aFont
-
Anchor
public Anchor(Phrase phrase)
Constructs anAnchorwith 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.
-
type
public int type()
Gets the type of the text element.
-
setName
public void setName(String name)
Sets the name of thisAnchor.- Parameters:
name- a new name
-
setReference
public void setReference(String reference)
Sets the reference of thisAnchor.- Parameters:
reference- a new reference
-
getName
public String getName()
Returns the name of thisAnchor.- Returns:
- a name
-
getReference
public String getReference()
Gets the reference of thisAnchor.- Returns:
- a reference
-
getUrl
public URL getUrl()
Gets the reference of thisAnchor.- Returns:
- an
URL
-
-