public class TLcdModelDescriptor extends Object implements ILcdModelDescriptor
ILcdModelDescriptor
.Constructor and Description |
---|
TLcdModelDescriptor()
Constructs a new
TLcdModelDescriptor with default source name,
type name, and display name. |
TLcdModelDescriptor(String aSourceName,
String aTypeName,
String aDisplayName)
Constructs a new
TLcdModelDescriptor with the specified source name,
type name, and display name. |
Modifier and Type | Method and Description |
---|---|
String |
getDisplayName()
Returns a displayable name for the data source, suitable for usage in user interfaces.
|
String |
getSourceName()
Returns the full name that uniquely identifies the data source.
|
String |
getTypeName()
Returns the type/format name of the data source.
|
void |
setDisplayName(String aDisplayName)
Sets the display name of this model descriptor (i.e.
|
void |
setSourceName(String aSourceName)
Sets the source name of this model descriptor.
|
protected void |
setTypeName(String aTypeName)
Sets the type name of this model descriptor (i.e.
|
static String |
sourceNameToDisplayName(String aSourceName,
String... aExtensions)
Convenience method to calculate a display name based on the source name.
|
public TLcdModelDescriptor()
TLcdModelDescriptor
with default source name,
type name, and display name.public TLcdModelDescriptor(String aSourceName, String aTypeName, String aDisplayName)
TLcdModelDescriptor
with the specified source name,
type name, and display name.aSourceName
- the name of the data source.aTypeName
- the type name of the data source.aDisplayName
- the display name of the data source.public String getSourceName()
ILcdModelDescriptor
getSourceName
in interface ILcdModelDescriptor
public String getTypeName()
ILcdModelDescriptor
getTypeName
in interface ILcdModelDescriptor
public String getDisplayName()
ILcdModelDescriptor
getDisplayName
in interface ILcdModelDescriptor
public void setSourceName(String aSourceName)
A typical use-case of this method is when you use a ILcdModelEncoder
to
save a model to a new location.
In this case, you probably want to update the source name of the model as well to
match this new location.
aSourceName
- The new source namepublic void setDisplayName(String aDisplayName)
aDisplayName
- The new display nameprotected void setTypeName(String aTypeName)
aTypeName
- The new type namepublic static String sourceNameToDisplayName(String aSourceName, String... aExtensions)
String sourceName = "Data/some_model.csv";
String extension = "csv";
TLcdModelDescriptor md = new TLcdModelDescriptor(
sourceName,
"CSV_TYPE",
TLcdModelDescriptor.sourceNameToDisplayName(sourceName, extension)
);
aSourceName
- The source nameaExtensions
- The possible extensions for the format, if available.
The casing does not matter.
It doesn't matter either whether the extension starts with a "." or not.
None of these extensions should be null
.
Specify no extensions when the extensions are unknown.