public abstract class ChoiceCategory extends Named
Constructor and Description |
---|
ChoiceCategory(java.lang.String name,
int keystoragelength)
creates a choice category with the provided name and key storage length
|
ChoiceCategory(java.lang.String name,
int keystoragelength,
boolean pseudonumber)
creates a choice category with the provided name and key storage length,
precision if the choice category should have the pseudo-number option
|
Modifier and Type | Method and Description |
---|---|
abstract void |
generatetoFile(SourceGenerator sg,
Module module)
* generates the source of the choice category to a file
|
abstract java.lang.String |
getDefinitionClass() |
abstract int |
getDisplayLabelLength(int labellength)
This method checks what is the longest label in the choice values, and
returns that value, or the value of label length if higher
|
int |
getKeyStorageLength() |
Module |
getParentModule() |
abstract boolean |
isKeyPresent(java.lang.String key)
checks if a choice value with the given key is present
|
boolean |
isPseudoNumber()
Pseudo-number choice values will have a function to give an integer value to
each choice, and order them by number1
|
void |
setParentModule(Module parentmodule)
sets the parent module for this choice
|
changeName, cleanName, equals, getName
public ChoiceCategory(java.lang.String name, int keystoragelength)
name
- a unique name for the modulekeystoragelength
- should be bigger than the length of the biggest
storage keypublic ChoiceCategory(java.lang.String name, int keystoragelength, boolean pseudonumber)
name
- a unique name for the modulekeystoragelength
- should be bigger than the length of the biggest
storage keypseudonumber
- true if there should be a way to transform each value
in an integerpublic int getKeyStorageLength()
public boolean isPseudoNumber()
public abstract int getDisplayLabelLength(int labellength)
labellength
- specifying the maximum of the labels of the choice values,
and the input length provided (typically for column title)public Module getParentModule()
public void setParentModule(Module parentmodule)
parentmodule
- module the choice category is declared on1public abstract java.lang.String getDefinitionClass()
public abstract void generatetoFile(SourceGenerator sg, Module module) throws java.io.IOException
sg
- source generatormodule
- parent modulejava.io.IOException
- if anything nasty happens while writing the filepublic abstract boolean isKeyPresent(java.lang.String key)
key
- the key