Package org.apache.sis.internal.jaxb.gcx
Class Anchor
java.lang.Object
org.apache.sis.xml.XLink
org.apache.sis.internal.jaxb.gcx.Anchor
- All Implemented Interfaces:
Serializable
,CharSequence
,Comparable<org.opengis.util.InternationalString>
,org.opengis.util.InternationalString
The
Anchor
element, which is included in CharacterString
elements.
In XML documents, anchors are values with XLink
attributes used in places
where we would normally expect a character sequence. Since Java properties of type
CharSequence
cannot return XLink
, we workaround that restriction
by providing this Anchor
class as a XLink
subtype implementing the
InternationalString
interface, so it can be used with the above-cited Java
properties.- Since:
- 0.3
- Version:
- 0.8
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.xml.XLink
XLink.Actuate, XLink.Show, XLink.Type
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
Defined as a matter of principle (this class is not expected to be serialized).private String
Often a short textual description of the URI target. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) Returns the character at the given index.int
compareTo
(org.opengis.util.InternationalString other) Compares the value of this object with the given international string for order.boolean
Compares thisAnchor
with the given object for equality.int
hashCode()
Returns a hash code value for this anchor type.int
length()
Returns the number of characters in the value.subSequence
(int start, int end) Returns the sequence of characters in the given range of index.toString()
Returns the text as a string, ornull
if none.Returns the text as a string, ornull
if none.Methods inherited from class org.apache.sis.xml.XLink
freeze, getActuate, getArcRole, getFrom, getHRef, getLabel, getRole, getShow, getTitle, getTo, getType, setActuate, setArcRole, setFrom, setHRef, setLabel, setRole, setShow, setTitle, setTo, setType
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDDefined as a matter of principle (this class is not expected to be serialized).- See Also:
-
value
Often a short textual description of the URI target. This is the value returned bytoString()
.
-
-
Constructor Details
-
Anchor
public Anchor()Creates a uninitializedAnchor
. This constructor is required by JAXB. -
Anchor
Creates anAnchor
initialized to the givenxlink
value.- Parameters:
xlink
- thexlink
from which to copy the attributes.value
- often a short textual description of the URI target.
-
Anchor
Creates anAnchor
initialized to the givenhref
value.- Parameters:
href
- a URI to an external resources or an identifier.value
- often a short textual description of the URI target.
-
-
Method Details
-
toString
Returns the text as a string, ornull
if none. The null value is needed for proper working ofGO_CharacterString.toString()
method.- Specified by:
toString
in interfaceCharSequence
- Specified by:
toString
in interfaceorg.opengis.util.InternationalString
- Overrides:
toString
in classXLink
-
toString
Returns the text as a string, ornull
if none.- Specified by:
toString
in interfaceorg.opengis.util.InternationalString
- Parameters:
locale
- ignored in current implementation.- Returns:
- the anchor text, or
null
if none.
-
length
public int length()Returns the number of characters in the value.- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) Returns the character at the given index.- Specified by:
charAt
in interfaceCharSequence
-
subSequence
Returns the sequence of characters in the given range of index. The returned object is an anchor with the same attribute values. It is caller responsibility to determine if those attributes are still appropriate for the sub-sequence.- Specified by:
subSequence
in interfaceCharSequence
-
compareTo
public int compareTo(org.opengis.util.InternationalString other) Compares the value of this object with the given international string for order. Null values are sorted last.- Specified by:
compareTo
in interfaceComparable<org.opengis.util.InternationalString>
- Parameters:
other
- the string to compare with this anchor type.
-
equals
Compares thisAnchor
with the given object for equality. -
hashCode
public int hashCode()Returns a hash code value for this anchor type.
-