OpMath

com.opmath.util.html
Class HTMLEntity

java.lang.Object
  |
  +--com.opmath.util.html.HTMLEntity

public class HTMLEntity
extends Object

An object that serves as the representation of an HTML character 'entity'.

HTML 4.0 and its predecessors specify a collection of 'entities': these are specialised characters that are not representable by all fonts, and are not specifiable using simple latin text representations such as ASCII. HTML entities are normally represented within HTML texts as the string: '& + name + ;', for example ' ' for non-breaking space.

This class makes the assumption that all HTML entities are composed of three elements:

The class also assumes that HTML entities are imutable once created. More information on HTML entities is available at: http://www.w3.org/TR/1999/REC-html401-19991224/sgml/entities.html#h-24.1

Copyright: (c) 2002 The Open Math Company Limited

The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.

Version:
v1.0 (11 May 2002)
Author:
Bruno Beloff
See Also:
HTMLEncoder

Constructor Summary
HTMLEntity(char c, int i, String name)
          Constructs a new HTMLEntity instance.
 
Method Summary
 Character getChar()
          Returns the character representation of the entity.
 Integer getInteger()
          Returns the integer numeric form of the entity.
 String getName()
          Returns the descriptive name of the entity.
 String toString()
          Returns a string representation of the HTMLEntity.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTMLEntity

public HTMLEntity(char c,
                  int i,
                  String name)

Constructs a new HTMLEntity instance. The new instance has the given character representation, integer index value and string name representation.

Parameters:
c - the char character representation of the entity.
i - the int integer numeric form of the entity.
name - the String descriptive name of the entity.
Since:
J2SE 1.3
Method Detail

getChar

public Character getChar()

Returns the character representation of the entity.

Returns:
the full Character object for the entity.
Since:
J2SE 1.3

getInteger

public Integer getInteger()

Returns the integer numeric form of the entity.

Returns:
the full Integer object for the numeric form of the entity.
Since:
J2SE 1.3

getName

public String getName()

Returns the descriptive name of the entity.

Returns:
the String object for the descriptive name of the entity.
Since:
J2SE 1.3

toString

public String toString()

Returns a string representation of the HTMLEntity.

Overrides:
toString in class Object
Returns:
the String representation of the entity.
Since:
J2SE 1.3

OpMath

Submit a bug or feature to Open Math
Copyright © 2002 Open Math Company Limited, Brighton, UK