Class CdfTableBuilder

  • All Implemented Interfaces:
    uk.ac.starlink.table.TableBuilder

    public class CdfTableBuilder
    extends java.lang.Object
    implements uk.ac.starlink.table.TableBuilder
    Table input handler for NASA CDF (Common Data Format) files.
    Since:
    24 Jun 2013
    Author:
    Mark Taylor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canImport​(java.awt.datatransfer.DataFlavor flavor)
      Returns false.
      static CdfTableProfile createProfile​(boolean invarParams, java.lang.String[] descripAttNames, java.lang.String[] unitAttNames, java.lang.String[] blankvalAttNames)
      Constructs an instance of CdfTableProfile with some suggestions for attribute names with known semantics.
      java.lang.String getFormatName()
      Returns "CDF".
      uk.ac.starlink.table.StarTable makeStarTable​(uk.ac.starlink.util.DataSource datsrc, boolean wantRandom, uk.ac.starlink.table.StoragePolicy storagePolicy)  
      void streamStarTable​(java.io.InputStream in, uk.ac.starlink.table.TableSink sink, java.lang.String pos)
      Throws a TableFormatException.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_PROFILE

        public static final CdfTableProfile DEFAULT_PROFILE
        Default CDF-StarTable translation profile.
    • Constructor Detail

      • CdfTableBuilder

        public CdfTableBuilder()
        Constructs a default Cdf table builder.
      • CdfTableBuilder

        public CdfTableBuilder​(CdfTableProfile profile)
        Constructs a Cdf table builder with a custom translation profile.
        Parameters:
        profile - CDF-Startable translation profile
    • Method Detail

      • getFormatName

        public java.lang.String getFormatName()
        Returns "CDF".
        Specified by:
        getFormatName in interface uk.ac.starlink.table.TableBuilder
      • makeStarTable

        public uk.ac.starlink.table.StarTable makeStarTable​(uk.ac.starlink.util.DataSource datsrc,
                                                            boolean wantRandom,
                                                            uk.ac.starlink.table.StoragePolicy storagePolicy)
                                                     throws java.io.IOException
        Specified by:
        makeStarTable in interface uk.ac.starlink.table.TableBuilder
        Throws:
        java.io.IOException
      • canImport

        public boolean canImport​(java.awt.datatransfer.DataFlavor flavor)
        Returns false. I don't think there is a MIME type associated with the CDF format. References to application/x-cdf and application/cdf appear on the web, but neither is IANA registered, and I think they refer to some other format.
        Specified by:
        canImport in interface uk.ac.starlink.table.TableBuilder
      • streamStarTable

        public void streamStarTable​(java.io.InputStream in,
                                    uk.ac.starlink.table.TableSink sink,
                                    java.lang.String pos)
                             throws java.io.IOException
        Throws a TableFormatException. CDF is not suitable for streaming.
        Specified by:
        streamStarTable in interface uk.ac.starlink.table.TableBuilder
        Throws:
        java.io.IOException
      • createProfile

        public static CdfTableProfile createProfile​(boolean invarParams,
                                                    java.lang.String[] descripAttNames,
                                                    java.lang.String[] unitAttNames,
                                                    java.lang.String[] blankvalAttNames)
        Constructs an instance of CdfTableProfile with some suggestions for attribute names with known semantics.
        Parameters:
        invarParams - true for turning non-row-varying variables into table parameters, false for turning them into variables
        descripAttNames - ordered list of names of attributes that might supply description metadata
        unitAttNames - ordered list of names of attributes that might supply units metadata
        blankvalAttNames - ordered list of names of attributes that might supply magic blank values
        Returns:
        new profile instance