org.extex.font
Class FontKey

java.lang.Object
  extended by org.extex.font.FontKey
All Implemented Interfaces:
java.io.Serializable

public class FontKey
extends java.lang.Object
implements java.io.Serializable

Class for a font key.

Font key is a collection several attributes. The central attribute is the name. If the name is null, then the special null font is meant.

properties:

Tags:

Each font can get several tags (e.g. OpenType: latn, kern)

Version:
$Revision: 6600 $
Author:
Michael Niedermair
See Also:
Serialized Form

Field Summary
static java.lang.String KERNING
          Use the kerning information of the font.
static java.lang.String LANGUAGE
          The language for the font.
static java.lang.String LETTERSPACE
          Use the letterspaced information of the font.
static java.lang.String LIGATURES
          Use the ligature information of the font.
static java.lang.String SCALE
          The scaling factor of the font.
static java.lang.String SIZE
          The size of the font.
 
Constructor Summary
protected FontKey(FontKey fk)
          Create a new object (only in the same name space!).
protected FontKey(java.lang.String theName)
          Create a new object (only in the same name space!).
 
Method Summary
protected  void add(java.util.List<java.lang.String> theTags)
          Add a list of tags.
 boolean eq(FontKey k)
          Check, if the font keys are equals.
 boolean getBoolean(java.lang.String key)
          Returns the value for the key or false, if no key exists in the map.
protected  java.util.Map<java.lang.String,java.lang.Boolean> getBooleanMap()
          Returns the booleanMap.
 FixedCount getCount(java.lang.String key)
          Returns the value for the key or null, if no key exists in the map.
protected  java.util.Map<java.lang.String,FixedCount> getCountMap()
          Returns the countMap.
 FixedDimen getDimen(java.lang.String key)
          Returns the value for the key or null, if no key exists in the map.
protected  java.util.Map<java.lang.String,FixedDimen> getDimenMap()
          Returns the dimenMap.
 FixedGlue getGlue(java.lang.String key)
          Returns the value for the key or null, if no key exists in the map.
protected  java.util.Map<java.lang.String,FixedGlue> getGlueMap()
          Returns the glueMap.
 java.lang.String getName()
          Returns the name.
 java.lang.String getString(java.lang.String key)
          Returns the value for the key or null, if no key exists in the map.
protected  java.util.Map<java.lang.String,java.lang.String> getStringMap()
          Returns the stringMap.
 java.util.List<java.lang.String> getTags()
          Getter for the tags.
 boolean hasBoolean(java.lang.String key)
          Check, if the key exists in the map.
 boolean hasCount(java.lang.String key)
          Check, if the key exists in the map.
 boolean hasDimen(java.lang.String key)
          Check, if the key exists in the map.
 boolean hasGlue(java.lang.String key)
          Check, if the key exists in the map.
 boolean hasString(java.lang.String key)
          Check, if the key exists in the map.
 boolean hasTag(java.lang.String name)
          Returns true, if the tag is set.
protected  void put(java.util.Map<java.lang.String,?> theMap)
          Put an key values pair on the map.
protected  void put(java.lang.String key, boolean value)
          Put an key values pair on the map.
protected  void put(java.lang.String key, FixedCount value)
          Put an key values pair on the map.
protected  void put(java.lang.String key, FixedDimen value)
          Put an key values pair on the map.
protected  void put(java.lang.String key, FixedGlue value)
          Put an key values pair on the map.
protected  void put(java.lang.String key, java.lang.String value)
          Put an key values pair on the map.
 java.lang.String toString()
          Returns the value of the FontKey as String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KERNING

public static final java.lang.String KERNING
Use the kerning information of the font.

See Also:
Constant Field Values

LANGUAGE

public static final java.lang.String LANGUAGE
The language for the font.

See Also:
Constant Field Values

LETTERSPACE

public static final java.lang.String LETTERSPACE
Use the letterspaced information of the font.

See Also:
Constant Field Values

LIGATURES

public static final java.lang.String LIGATURES
Use the ligature information of the font.

See Also:
Constant Field Values

SCALE

public static final java.lang.String SCALE
The scaling factor of the font.

See Also:
Constant Field Values

SIZE

public static final java.lang.String SIZE
The size of the font.

See Also:
Constant Field Values
Constructor Detail

FontKey

protected FontKey(FontKey fk)
Create a new object (only in the same name space!).

Parameters:
fk - The font key.

FontKey

protected FontKey(java.lang.String theName)
Create a new object (only in the same name space!). If the name is a empty string, then the key for the null font is returned; i.e. the name is treated as null.

Parameters:
theName - The name of the font.
Method Detail

add

protected void add(java.util.List<java.lang.String> theTags)
Add a list of tags.

Parameters:
theTags - The list of tags.

eq

public boolean eq(FontKey k)
Check, if the font keys are equals.

Parameters:
k - The font key for the check.
Returns:
Returns true, if the keys are equals.

getBoolean

public boolean getBoolean(java.lang.String key)
Returns the value for the key or false, if no key exists in the map.

Parameters:
key - The key.
Returns:
Returns the value for the key.

getBooleanMap

protected java.util.Map<java.lang.String,java.lang.Boolean> getBooleanMap()
Returns the booleanMap.

Returns:
Returns the booleanMap.

getCount

public FixedCount getCount(java.lang.String key)
Returns the value for the key or null, if no key exists in the map.

Parameters:
key - The key.
Returns:
Returns the value for the key.

getCountMap

protected java.util.Map<java.lang.String,FixedCount> getCountMap()
Returns the countMap.

Returns:
Returns the countMap.

getDimen

public FixedDimen getDimen(java.lang.String key)
Returns the value for the key or null, if no key exists in the map.

Parameters:
key - The key.
Returns:
Returns the value for the key.

getDimenMap

protected java.util.Map<java.lang.String,FixedDimen> getDimenMap()
Returns the dimenMap.

Returns:
Returns the dimenMap.

getGlue

public FixedGlue getGlue(java.lang.String key)
Returns the value for the key or null, if no key exists in the map.

Parameters:
key - The key.
Returns:
Returns the value for the key.

getGlueMap

protected java.util.Map<java.lang.String,FixedGlue> getGlueMap()
Returns the glueMap.

Returns:
Returns the glueMap.

getName

public java.lang.String getName()
Returns the name.

Returns:
Returns the name.

getString

public java.lang.String getString(java.lang.String key)
Returns the value for the key or null, if no key exists in the map.

Parameters:
key - The key.
Returns:
Returns the value for the key.

getStringMap

protected java.util.Map<java.lang.String,java.lang.String> getStringMap()
Returns the stringMap.

Returns:
Returns the stringMap.

getTags

public java.util.List<java.lang.String> getTags()
Getter for the tags.

Returns:
Returns the tags.

hasBoolean

public boolean hasBoolean(java.lang.String key)
Check, if the key exists in the map.

Parameters:
key - The key.
Returns:
Returns true, if the key exists.

hasCount

public boolean hasCount(java.lang.String key)
Check, if the key exists in the map.

Parameters:
key - The key.
Returns:
Returns true, if the key exists.

hasDimen

public boolean hasDimen(java.lang.String key)
Check, if the key exists in the map.

Parameters:
key - The key.
Returns:
Returns true, if the key exists.

hasGlue

public boolean hasGlue(java.lang.String key)
Check, if the key exists in the map.

Parameters:
key - The key.
Returns:
Returns true, if the key exists.

hasString

public boolean hasString(java.lang.String key)
Check, if the key exists in the map.

Parameters:
key - The key.
Returns:
Returns true, if the key exists.

hasTag

public boolean hasTag(java.lang.String name)
Returns true, if the tag is set.

Parameters:
name - The name of the tag.
Returns:
Returns true, if the tag is set.

put

protected void put(java.util.Map<java.lang.String,?> theMap)
Put an key values pair on the map.

Parameters:
theMap - The map.

put

protected void put(java.lang.String key,
                   boolean value)
Put an key values pair on the map.

Parameters:
key - The key.
value - The value.

put

protected void put(java.lang.String key,
                   FixedCount value)
Put an key values pair on the map.

Parameters:
key - The key.
value - The value.

put

protected void put(java.lang.String key,
                   FixedDimen value)
Put an key values pair on the map.

Parameters:
key - The key.
value - The value.

put

protected void put(java.lang.String key,
                   FixedGlue value)
Put an key values pair on the map.

Parameters:
key - The key.
value - The value.

put

protected void put(java.lang.String key,
                   java.lang.String value)
Put an key values pair on the map.

Parameters:
key - The key.
value - The value.

toString

public java.lang.String toString()
Returns the value of the FontKey as String. If a value is null, then the text 'null' is returned.

Overrides:
toString in class java.lang.Object
Returns:
the printable representation for this instance
See Also:
Object.toString()