public class HapiSource extends Object
Constructor and Description |
---|
HapiSource(HapiService service,
URL dataUrl,
HapiParam[] params)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getLabel()
Returns a human-readable label for the table that will be loaded.
|
URL |
getStandaloneUrl()
Returns a standalone URL from which it ought to be possible
to load this object's table.
|
int |
hashCode() |
void |
streamHapi(TableSink sink,
int chunkLimit,
IOConsumer<String> limitCallback)
Streams this object's table to a supplied TableSink.
|
public HapiSource(HapiService service, URL dataUrl, HapiParam[] params)
The params
parameter is optional, but if present
must match the data from the dataUrl.
If it is absent a query requesting the header data is submitted.
service
- servicedataUrl
- URL of HAPI file without headerparams
- parameters being read from dataUrl contents,
may be nullpublic URL getStandaloneUrl()
Feeding the contents of the returned URL to
HapiTableBuilder.streamStarTable(java.io.InputStream, uk.ac.starlink.table.TableSink, java.lang.String)
should generate a
table ready for use.
The table read by streamHapi(uk.ac.starlink.table.TableSink, int, uk.ac.starlink.util.IOConsumer<java.lang.String>)
may not actually be
generated by this method but if the service obeys the HAPI standard
it ought to give the same results.
public String getLabel()
public void streamHapi(TableSink sink, int chunkLimit, IOConsumer<String> limitCallback) throws IOException
sink
- table destinationchunkLimit
- maximum number of chunks allowedlimitCallback
- called with a message if chunk limit is exceeded;
may be nullIOException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.