Class LinkColMap

java.lang.Object
uk.ac.starlink.vo.datalink.LinkColMap

public class LinkColMap extends Object
Defines the mapping of columns named by the DataLink standard to a given table.

The usual way to obtain an instance of this class is using the static getMap method.

Since:
22 Nov 2017
Author:
Mark Taylor
See Also:
  • Field Details

  • Constructor Details

    • LinkColMap

      protected LinkColMap(Map<LinkColMap.ColDef<?>,Integer> icolMap)
      Constructor.
      Parameters:
      icolMap - map from column definition to column index, providing the state of this object
  • Method Details

    • getId

      public String getId(Object[] row)
      Returns the value of the DataLink id column in a given row.
      Parameters:
      row - row from the table for which this map was prepared
      Returns:
      cell value for the id column
    • getAccessUrl

      public String getAccessUrl(Object[] row)
      Returns the value of the DataLink access_url column in a given row.
      Parameters:
      row - row from the table for which this map was prepared
      Returns:
      cell value for the access_url column
    • getServiceDef

      public String getServiceDef(Object[] row)
      Returns the value of the DataLink service_def column in a given row.
      Parameters:
      row - row from the table for which this map was prepared
      Returns:
      cell value for the service_def column
    • getErrorMessage

      public String getErrorMessage(Object[] row)
      Returns the value of the DataLink error_message column in a given row.
      Parameters:
      row - row from the table for which this map was prepared
      Returns:
      cell value for the error_message column
    • getDescription

      public String getDescription(Object[] row)
      Returns the value of the DataLink description column in a given row.
      Parameters:
      row - row from the table for which this map was prepared
      Returns:
      cell value for the description column
    • getSemantics

      public String getSemantics(Object[] row)
      Returns the value of the DataLink semantics column in a given row.
      Parameters:
      row - row from the table for which this map was prepared
      Returns:
      cell value for the semantics column
    • getContentType

      public String getContentType(Object[] row)
      Returns the value of the DataLink content_type column in a given row.
      Parameters:
      row - row from the table for which this map was prepared
      Returns:
      cell value for the content_type column
    • getContentLength

      public Long getContentLength(Object[] row)
      Returns the value of the DataLink content_length column in a given row.
      Parameters:
      row - row from the table for which this map was prepared
      Returns:
      cell value for the content_length column, may be null
    • getValue

      public <C> C getValue(LinkColMap.ColDef<C> col, Object[] row)
      Returns the typed corresponding to a given column definition in a given row.
      Parameters:
      col - column value extractor object
      row - row from the table for which this map was prepared
      Returns:
      typed cell value for col
    • getMap

      public static LinkColMap getMap(uk.ac.starlink.table.StarTable table)
      Constructs a LinkColMap that knows where the DataLink columns are in a supplied table. Columns are identified by name and content type. Incorrect UCDs etc lead to warnings emitted through the logging system. No check is made that all columns are present; attempts to retrieve column values for unidentified columns just return null.
      Parameters:
      table - table (assumed DataLink) to interpret
      Returns:
      column map object