org.w3c.tidy
Class EntityTable

java.lang.Object
  extended byorg.w3c.tidy.EntityTable

public final class EntityTable
extends java.lang.Object

Entity hash table.

Version:
$Revision: 1.10 $ ($Author: fgiust $)
Author:
Dave Raggett dsr@w3.org , Andy Quick ac.quick@sympatico.ca (translation to Java), Fabrizio Giustina

Field Summary
private static EntityTable defaultEntityTable
          the default entity table.
private static Entity[] entities
          Known entities.
private  java.util.Map entityHashtable
          Entity map.
 
Constructor Summary
private EntityTable()
          use getDefaultEntityTable to get an entity table instance.
 
Method Summary
 int entityCode(java.lang.String name)
          Returns the entity code for the given entity name.
 java.lang.String entityName(short code)
          Returns the entity name for the given entity code.
static EntityTable getDefaultEntityTable()
          Returns the default entity table instance.
private  Entity install(Entity ent)
          installs an entity.
 Entity lookup(java.lang.String name)
          Lookup an entity by its name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultEntityTable

private static EntityTable defaultEntityTable
the default entity table.


entities

private static Entity[] entities
Known entities.


entityHashtable

private java.util.Map entityHashtable
Entity map.

Constructor Detail

EntityTable

private EntityTable()
use getDefaultEntityTable to get an entity table instance.

Method Detail

install

private Entity install(Entity ent)
installs an entity.

Parameters:
ent - entity
Returns:
installed Entity

lookup

public Entity lookup(java.lang.String name)
Lookup an entity by its name.

Parameters:
name - entity name
Returns:
entity

entityCode

public int entityCode(java.lang.String name)
Returns the entity code for the given entity name.

Parameters:
name - entity name
Returns:
entity code or 0 for unknown entity names

entityName

public java.lang.String entityName(short code)
Returns the entity name for the given entity code.

Parameters:
code - entity code
Returns:
entity name or null for unknown entity codes

getDefaultEntityTable

public static EntityTable getDefaultEntityTable()
Returns the default entity table instance.

Returns:
entity table instance