Package dk.gtz.graphedit.view.log
Class Hyperlink
java.lang.Object
dk.gtz.graphedit.view.log.Hyperlink
Class representing a clickable textual link.
-
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) Get the displayed character at some indexGet the displayed textgetLink()
Get the link component of the hyperlinkGet the original textboolean
isEmpty()
Checks if the hyperlink display is empty or nowint
length()
Get the length of the displayed text in the hyperlinkmapDisplayedText
(String text) Create a new hyperlink where the displayed text is replaced with a provided string valueboolean
shareSameAncestor
(Hyperlink other) Checks if this hyperlink links to the same base link as another one.subSequence
(int start) Create a new hyperlink where the displayed text is a subsequence of this hyperlink's displayed textsubSequence
(int start, int end) Create a new hyperlink where the displayed text is a subsequence of this hyperlink's displayed texttoString()
-
Method Details
-
isEmpty
public boolean isEmpty()Checks if the hyperlink display is empty or now- Returns:
- true if
length()
returns 0, false otherwise
-
length
public int length()Get the length of the displayed text in the hyperlink- Returns:
- The string-length of the displayed hyperlink text
-
charAt
public char charAt(int index) Get the displayed character at some index- Parameters:
index
- of the character to get- Returns:
- The char value at the specified index
- Throws:
IndexOutOfBoundsException
- if the index argument is negative or larger than the displayed text length
-
getOriginalDisplayedText
Get the original text- Returns:
- String with the original text
-
getDisplayedText
Get the displayed text- Returns:
- String with the displayed text
-
getLink
Get the link component of the hyperlink- Returns:
- String with the link
-
subSequence
Create a new hyperlink where the displayed text is a subsequence of this hyperlink's displayed text- Parameters:
start
- the beginning index, inclusiveend
- the ending index, exclusive- Returns:
- A new hyperlink with the same original text and link, but a subsequence for the displayed text
-
subSequence
Create a new hyperlink where the displayed text is a subsequence of this hyperlink's displayed text- Parameters:
start
- the beginning index, inclusive- Returns:
- A new hyperlink with the same original text and link, but a subsequence for the displayed text
-
mapDisplayedText
Create a new hyperlink where the displayed text is replaced with a provided string value- Parameters:
text
- The new displayed text- Returns:
- A new hyperlink with the same original text and link, but an updated displayed text
-
toString
-