spv.spectrum.factory.GHRSFOS
Class GHRSFOSFileDescriptor

java.lang.Object
  extended by spv.spectrum.factory.FileDescriptor
      extended by spv.spectrum.factory.GHRSFOS.GHRSFOSFileDescriptor

public class GHRSFOSFileDescriptor
extends FileDescriptor

Class used to store and manipulate FileDescriptor objects that describe GHRS and FOS spectra. In this case the descriptor consists solely of the name of the flux file itself (.c1h) followed by the group(s) specification.

Version:
1.0 - 21Apr99
Author:
Ivo Busko (Space Telescope Science Institute)

Field Summary
private  java.lang.String name
           
private  int ngrp
           
 
Constructor Summary
GHRSFOSFileDescriptor(java.lang.String filename, int ngroups)
          Constructor.
 
Method Summary
 java.lang.String getFileName()
          Returns the file name.
 FileView getFileView(SpectrumSelector ss, java.awt.Component comp)
          Returns a view (GUI) into the file.
 java.lang.String getLabelString()
          Returns the labeling string.
 int getNExtens()
          Returns the number of extensions in the file.
 int getNSpectra(int dummy)
          Returns the number of spectra stored in the file.
 java.lang.String[] getSpecRepresentation(int group, int ext)
          Returns a 1-line ASCII representation of the spectrum.
 SpectrumSpecification getSpectrumSpecification(java.net.URL url, int ext, int[] index)
          Returns a SpectrumSpecification object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private java.lang.String name

ngrp

private int ngrp
Constructor Detail

GHRSFOSFileDescriptor

public GHRSFOSFileDescriptor(java.lang.String filename,
                             int ngroups)
Constructor.

Parameters:
filename - the file name with no qualifications
ngroups - the number of groups
Method Detail

getFileView

public FileView getFileView(SpectrumSelector ss,
                            java.awt.Component comp)
Returns a view (GUI) into the file. If no view exists, returns null.

Specified by:
getFileView in class FileDescriptor
Parameters:
ss - the spectrum selector that calls this
comp - the component used for screen positioning
Returns:
a view into the file, or null.

getSpectrumSpecification

public SpectrumSpecification getSpectrumSpecification(java.net.URL url,
                                                      int ext,
                                                      int[] index)
Returns a SpectrumSpecification object.

Specified by:
getSpectrumSpecification in class FileDescriptor
Parameters:
url - the URL
ext - ignored
index - array with FITS extension indices
Returns:
the SpectrumSpecification object

getLabelString

public java.lang.String getLabelString()
Returns the labeling string.

Specified by:
getLabelString in class FileDescriptor
Returns:
the labelling string

getFileName

public java.lang.String getFileName()
Returns the file name.

Specified by:
getFileName in class FileDescriptor
Returns:
the file name

getNExtens

public int getNExtens()
Returns the number of extensions in the file. In GHRS/FOS files this is always 1.

Specified by:
getNExtens in class FileDescriptor
Returns:
always 1

getNSpectra

public int getNSpectra(int dummy)
Returns the number of spectra stored in the file. In GHRS/FOS files this is the same as the number of groups in the file.

Specified by:
getNSpectra in class FileDescriptor
Parameters:
dummy - anything
Returns:
the number of groups

getSpecRepresentation

public java.lang.String[] getSpecRepresentation(int group,
                                                int ext)
Returns a 1-line ASCII representation of the spectrum. This consists for now of the group number only. If group is zero, returns the label string.

Specified by:
getSpecRepresentation in class FileDescriptor
Parameters:
group - the group number
ext - not used
Returns:
the string array with the representation.