public class AbbrevMap extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AbbrevMap.AbbrevWrapper |
Modifier and Type | Field and Description |
---|---|
protected HashMap<String,AbbrevMap.AbbrevWrapper> |
stringterm |
protected HashMap<AbbrevMap.AbbrevWrapper,Boolean> |
termenabled |
protected HashMap<AbbrevMap.AbbrevWrapper,String> |
termstring
HashMaps used to store the mappings from Term to String, String to Term
and Term to Enabled.
|
Constructor and Description |
---|
AbbrevMap()
Creates a AbbrevMap.
|
Modifier and Type | Method and Description |
---|---|
void |
changeAbbrev(Term t,
String abbreviation)
Changes the abbreviation of t to abbreviation.
|
boolean |
containsAbbreviation(String s)
Returns true if the map contains the abbreviation s.
|
boolean |
containsTerm(Term t)
Returns true if the map contains the term t.
|
String |
getAbbrev(Term t)
Returns the abbreviation mapped to the term t.
|
Term |
getTerm(String s)
Returns the term which is mapped to the abbreviation s, null if no term
is mapped to the abbreviation.
|
boolean |
isEnabled(Term t)
Returns true if the mapping is enabled, which means that the abbreviation may
be used.
|
void |
put(Term t,
String abbreviation,
boolean enabled)
Associates a Term and its abbreviation in this map.
|
void |
setEnabled(Term t,
boolean enabled)
Sets the mapping of the term t to its abbreviation enabled or disabled
|
protected HashMap<AbbrevMap.AbbrevWrapper,String> termstring
protected HashMap<String,AbbrevMap.AbbrevWrapper> stringterm
protected HashMap<AbbrevMap.AbbrevWrapper,Boolean> termenabled
public void put(Term t, String abbreviation, boolean enabled) throws AbbrevException
t
- a termabbreviation
- the abbreviation for of this termenabled
- true if the abbreviation should be used
(e.g. when printing the term), false otherwise.AbbrevException
public void changeAbbrev(Term t, String abbreviation) throws AbbrevException
AbbrevException
public boolean containsAbbreviation(String s)
public boolean containsTerm(Term t)
public Term getTerm(String s)
public String getAbbrev(Term t)
public boolean isEnabled(Term t)
public void setEnabled(Term t, boolean enabled)
t
- a Termenabled
- true if the abbreviation of t may be used.