Package uk.ac.starlink.vo
Class Ivoid
java.lang.Object
uk.ac.starlink.vo.Ivoid
Represents an IVO Identifier.
For most purposes these are strings, but case handling during comparison needs some care. The relevant text in Section 2.1 of the IVOA Identifiers standard reads:
"The Registry references are, as a whole, compared case-insensitively, and must be treated case-insensitively throughout to maintain backwards compatibility with version 1 of this specification. When comparing full IVOIDs, the local part must be split off and compared preserving case, while the registry part must be compared case-insensitively."
The form of an IVOID is:
ivo://<authority><path>[?<query>][#<fragment>]where
ivo://<authority><path>
is known as
the "registry part" and
[?<query>][#<fragment>]
is the "local part".
Invalid Ivoids can still be used and compared; if the text supplied at construction time does not conform to the IVO ID syntax, the registry and local parts will be null, and the equality semantics will simply be that of (case-sensitive) strings.
- Since:
- 4 Jul 2023
- Author:
- Mark Taylor
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
equalsIvoid
(Ivoid other) Typed version ofequals(java.lang.Object)
method.Returns the local part of this IVOID.Returns the registry part of this IVOID.int
hashCode()
boolean
isValid()
Indicates whether the string represented by this Ivoid object is a valid IVO ID.boolean
matchesRegistryPart
(String regPart) Indicates whether the registry part of this Ivoid is equivalent to a supplied textual representation of another registry part.Returns the normalised form of this ivoid suitable for use (for instance ADQL equality matching) in the context of the Relational Registry.toString()
-
Constructor Details
-
Ivoid
Constructor. Construction will always succeed, but a valid IVO ID will have a registry part beginning "ivo://...".- Parameters:
txt
- textual representation of IVOID
-
-
Method Details
-
getRegistryPart
Returns the registry part of this IVOID. This will begin "ivo://..." for a valid IVOID, and be null otherwise.- Returns:
- registry part, may be null for invalid IVOID text
-
getLocalPart
Returns the local part of this IVOID. This may be empty if no local part is present, or null in the case of an invalid IVOID. If present and non-empty the first character will be "#" or "?".- Returns:
- local part, may be null for invalid IVOID text, or may be the empty string for no local part
-
matchesRegistryPart
Indicates whether the registry part of this Ivoid is equivalent to a supplied textual representation of another registry part.- Parameters:
regPart
- textual representation of registry part of an IVO ID- Returns:
- true iff this ivoid's registry part is equivalent
-
isValid
public boolean isValid()Indicates whether the string represented by this Ivoid object is a valid IVO ID. The test is more or less that it starts "ivo://...", and is equivalent to testing whethergetRegistryPart()
returns a non-null value.- Returns:
- true iff this object represents a valid IVO ID
-
toRegtapString
Returns the normalised form of this ivoid suitable for use (for instance ADQL equality matching) in the context of the Relational Registry. See RegTAP 1.1, section 4.3.- Returns:
- lower-cased verson of valid IVO ID, or exact invalid text
- See Also:
-
equalsIvoid
Typed version ofequals(java.lang.Object)
method.- Returns:
- true iff other is equivalent to this
-
hashCode
public int hashCode() -
equals
-
toString
-