@@ -554,7 +554,8 @@ private static void dump(final boolean all) {
554554
555555 // members:
556556 private final OIFitsFile oiFitsFile ;
557-
557+ /* cached values */
558+ private Set <String > columnNames = null ;
558559 private Set <String > columnNames1D = null ;
559560 private Set <String > columnNames2D = null ;
560561
@@ -567,6 +568,13 @@ public OIFitsFile getOiFitsFile() {
567568 return oiFitsFile ;
568569 }
569570
571+ public Set <String > getNumericalColumnNames () {
572+ if (columnNames == null ) {
573+ columnNames = getAllNumericalColumnNames ();
574+ }
575+ return columnNames ;
576+ }
577+
570578 public Set <String > getNumericalColumnNames1D () {
571579 if (columnNames1D == null ) {
572580 columnNames1D = getAllNumericalColumnNames (false );
@@ -594,7 +602,7 @@ private Set<String> getAllNumericalColumnNames(final boolean is2D) {
594602 columnNames .add (colMeta .getName ());
595603 }
596604 } else if (colMeta .is3D ()) {
597- // not supported in OIData:
605+ // not possible in OIData:
598606 } else if (!is2D ) {
599607 columnNames .add (colMeta .getName ());
600608 }
@@ -604,6 +612,27 @@ private Set<String> getAllNumericalColumnNames(final boolean is2D) {
604612 return columnNames ;
605613 }
606614
615+ private Set <String > getAllNumericalColumnNames () {
616+ final Set <String > columnNames = new LinkedHashSet <String >();
617+
618+ for (OIData oiData : oiFitsFile .getOiDataList ()) {
619+ final List <ColumnMeta > columnsDescCollection = oiData .getNumericalColumnsDescs ();
620+
621+ for (ColumnMeta colMeta : columnsDescCollection ) {
622+ if (colMeta != null ) {
623+ if (colMeta instanceof WaveColumnMeta ) {
624+ columnNames .add (colMeta .getName ());
625+ } else if (colMeta .is3D ()) {
626+ // not possible in OIData:
627+ } else {
628+ columnNames .add (colMeta .getName ());
629+ }
630+ }
631+ }
632+ }
633+ return columnNames ;
634+ }
635+
607636 /**
608637 * Main function to create files.
609638 * @param unused
@@ -614,6 +643,8 @@ public static void main(String[] unused) {
614643
615644 final DataModel dm = getInstance (OIFitsStandard .VERSION_2 );
616645
646+ logger .log (Level .WARNING , "columnNames: {0}" , dm .getNumericalColumnNames ());
647+
617648 logger .log (Level .WARNING , "columnNames1D: {0}" , dm .getNumericalColumnNames1D ());
618649 logger .log (Level .WARNING , "columnNames2D: {0}" , dm .getNumericalColumnNames2D ());
619650 }
0 commit comments