Class TLcyFileTypeDescriptor

java.lang.Object
com.luciad.lucy.model.ALcyFileTypeDescriptor
com.luciad.lucy.model.TLcyFileTypeDescriptor

public class TLcyFileTypeDescriptor extends ALcyFileTypeDescriptor
Implementation of ALcyFileTypeDescriptor that allows a list of valid extensions. A filename is accepted if it ends with one of the extensions, the default extension is the first given extension, and the displayname is appended with (*.ext1, *.ext2, ... )
  • Constructor Details

    • TLcyFileTypeDescriptor

      public TLcyFileTypeDescriptor(String aDisplayName, String[] aExtensions)
      Creates a new TLcyFileTypeDescriptor with the given display name and extensions.
      Parameters:
      aDisplayName - The display name for this descriptor.
      aExtensions - The list of valid extensions, where the first extension is used as the default extension. The extensions do not include the dot (.)
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Returns the previously set display name appended with (*.ext1, *.ext2, ..., *.extN) where ext1 ... extN are the associated extensions.
      Specified by:
      getDisplayName in class ALcyFileTypeDescriptor
      Returns:
      The display name appended with the known extensions.
    • setDisplayName

      public void setDisplayName(String aDisplayName)
      Sets the display name to be used.
      Parameters:
      aDisplayName - The new display name.
    • getExtensionCount

      public int getExtensionCount()
      Returns the number of associated extensions.
      Returns:
      the number of associated extensions.
    • getDefaultExtension

      public String getDefaultExtension()
      Returns the first extension of the associated list of extensions.
      Specified by:
      getDefaultExtension in class ALcyFileTypeDescriptor
      Returns:
      the first extension of the associated list of extensions.
    • getExtension

      public String getExtension(int aIndex)
      Returns the extension at the given index.
      Parameters:
      aIndex - The index to retrieve the extension for.
      Returns:
      The extension at index aIndex.
    • includes

      public boolean includes(String aFileName)
      Returns true if the given filename ends with '.ext1' or '.ext2' or ... or '.extN'. Where ext1 ... extN are the associated extensions.
      Specified by:
      includes in class ALcyFileTypeDescriptor
      Parameters:
      aFileName - The filename to test.
      Returns:
      True if the filename is correct, false otherwise.