Package com.luciad.lucy.model
Class TLcyFileTypeDescriptor
java.lang.Object
com.luciad.lucy.model.ALcyFileTypeDescriptor
com.luciad.lucy.model.TLcyFileTypeDescriptor
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 Summary
ConstructorsConstructorDescriptionTLcyFileTypeDescriptor
(String aDisplayName, String[] aExtensions) Creates a new TLcyFileTypeDescriptor with the given display name and extensions. -
Method Summary
Modifier and TypeMethodDescriptionReturns the first extension of the associated list of extensions.Returns the previously set display name appended with (*.ext1, *.ext2, ..., *.extN) where ext1 ... extN are the associated extensions.getExtension
(int aIndex) Returns the extension at the given index.int
Returns the number of associated extensions.boolean
Returns true if the given filename ends with '.ext1' or '.ext2' or ... or '.extN'.void
setDisplayName
(String aDisplayName) Sets the display name to be used.Methods inherited from class com.luciad.lucy.model.ALcyFileTypeDescriptor
toString
-
Constructor Details
-
TLcyFileTypeDescriptor
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
Returns the previously set display name appended with (*.ext1, *.ext2, ..., *.extN) where ext1 ... extN are the associated extensions.- Specified by:
getDisplayName
in classALcyFileTypeDescriptor
- Returns:
- The display name appended with the known extensions.
-
setDisplayName
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
Returns the first extension of the associated list of extensions.- Specified by:
getDefaultExtension
in classALcyFileTypeDescriptor
- Returns:
- the first extension of the associated list of extensions.
-
getExtension
Returns the extension at the given index.- Parameters:
aIndex
- The index to retrieve the extension for.- Returns:
- The extension at index aIndex.
-
includes
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 classALcyFileTypeDescriptor
- Parameters:
aFileName
- The filename to test.- Returns:
- True if the filename is correct, false otherwise.
-