public class AbbrevMap
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AbbrevMap.AbbrevWrapper |
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,AbbrevMap.AbbrevWrapper> |
stringterm |
protected java.util.HashMap<AbbrevMap.AbbrevWrapper,java.lang.Boolean> |
termenabled |
protected java.util.HashMap<AbbrevMap.AbbrevWrapper,java.lang.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(java.lang.String abbreviation,
Term t,
boolean enabled)
Changes the abbreviation
abbreviation to t . |
void |
changeAbbrev(Term t,
java.lang.String abbreviation)
Changes the abbreviation of t to abbreviation.
|
boolean |
containsAbbreviation(java.lang.String s)
Returns true if the map contains the abbreviation s.
|
boolean |
containsTerm(Term t)
Returns true if the map contains the term t.
|
java.lang.String |
getAbbrev(Term t)
Returns the abbreviation mapped to the term t.
|
Term |
getTerm(java.lang.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,
java.lang.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 java.util.HashMap<AbbrevMap.AbbrevWrapper,java.lang.String> termstring
protected java.util.HashMap<java.lang.String,AbbrevMap.AbbrevWrapper> stringterm
protected java.util.HashMap<AbbrevMap.AbbrevWrapper,java.lang.Boolean> termenabled
public void put(Term t, java.lang.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, java.lang.String abbreviation) throws AbbrevException
AbbrevException
- if the abbreviation is already in use.public void changeAbbrev(java.lang.String abbreviation, Term t, boolean enabled) throws AbbrevException
abbreviation
to t
. If
the AbbrevMap doesn't contain abbreviation
nothing happens.AbbrevException
- If an abbreviation for t already exists.public boolean containsAbbreviation(java.lang.String s)
public boolean containsTerm(Term t)
public Term getTerm(java.lang.String s)
public java.lang.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.