public abstract class LinksDoc
extends java.lang.Object
ivo://ivoa.net/std/DataLink#links-1.0
"application/x-votable+xml;content=datalink
"An instance of this class gives you what you need to work with a Links service response.
This class simply aggregates three items: the table, column map, and service descriptors. However it also has some static utility methods that are useful for creating and working with datalink tables.
Constructor | Description |
---|---|
LinksDoc() |
Modifier and Type | Method | Description |
---|---|---|
static LinksDoc |
createLinksDoc(uk.ac.starlink.table.StarTable table) |
Returns a LinksDoc based on a supplied table.
|
static LinksDoc |
createLinksDoc(uk.ac.starlink.table.StarTable resultTable,
LinkColMap colMap,
uk.ac.starlink.votable.datalink.ServiceDescriptor[] servDescriptors) |
Creates a LinksDoc with fixed members.
|
static LinksDoc |
createLinksDoc(uk.ac.starlink.votable.VOElement el) |
Parses a VOElement as a LinksDoc.
|
abstract LinkColMap |
getColumnMap() |
Returns an object that knows where the DataLink-defined columns
are in this document's table.
|
abstract uk.ac.starlink.table.StarTable |
getResultTable() |
Returns the results table.
|
abstract uk.ac.starlink.votable.datalink.ServiceDescriptor[] |
getServiceDescriptors() |
Returns a list of the ServiceDescriptor objects defined by
RESOURCES with @type="meta" and @utype="adhoc:service".
|
static uk.ac.starlink.votable.datalink.ServiceDescriptor[] |
getServiceDescriptors(uk.ac.starlink.table.StarTable table) |
Utility method to extract a list of service descriptors associated
with a given StarTable.
|
static boolean |
isLinksResponse(uk.ac.starlink.table.StarTable table,
int nMistake) |
Indicates whether the table in question looks like a Links-response
table.
|
static LinksDoc |
randomAccess(LinksDoc ldoc) |
Returns a LinksDoc with the same content as a given one,
for which the result table is guaranteed to support random access.
|
public abstract uk.ac.starlink.table.StarTable getResultTable()
public abstract LinkColMap getColumnMap()
public abstract uk.ac.starlink.votable.datalink.ServiceDescriptor[] getServiceDescriptors()
public static LinksDoc createLinksDoc(uk.ac.starlink.table.StarTable resultTable, LinkColMap colMap, uk.ac.starlink.votable.datalink.ServiceDescriptor[] servDescriptors)
resultTable
- results tablecolMap
- object that understands which columns mean what
in the resultTable
servDescriptors
- list of service descriptor objects
associated with the tablepublic static LinksDoc createLinksDoc(uk.ac.starlink.table.StarTable table)
There is no guarantee that the result will be represent a useful DataLink document, for instance it may have none of the required DataLink columns.
table
- assumed DataLink results tablepublic static LinksDoc createLinksDoc(uk.ac.starlink.votable.VOElement el) throws java.io.IOException
There is no guarantee that the result will be represent a useful DataLink document, for instance it may have none of the required DataLink columns.
el
- VOTable DOM element that contains RESOURCES corresponding
to DataLink data and metadatajava.io.IOException
- if the element structure does not contain a
unique results tablepublic static LinksDoc randomAccess(LinksDoc ldoc) throws java.io.IOException
ldoc
- input links docjava.io.IOException
public static uk.ac.starlink.votable.datalink.ServiceDescriptor[] getServiceDescriptors(uk.ac.starlink.table.StarTable table)
table
- input tablepublic static boolean isLinksResponse(uk.ac.starlink.table.StarTable table, int nMistake)
LinkColMap.COLDEF_MAP
).
If the number of missing/incorrect columns does not exceed a given
tolerance, and at least one of the columns access_url
,
error_message
and service_def
is present
and usable, true is returned.table
- table to testnMistake
- maximum number of incorrect/missing columns tolerated;
2 might be a reasonable number?Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.