Class Overview
An entity is described in a DTD using the ENTITY construct.
It defines the type and value of the the entity.
Summary
Public Constructors |
|
Entity(String name, int type, char[] data)
Creates an entity.
|
Public Methods |
char[]
|
getData()
Returns the data .
|
String
|
getName()
Gets the name of the entity.
|
String
|
getString()
Returns the data as a String .
|
int
|
getType()
Gets the type of the entity.
|
boolean
|
isGeneral()
Returns true if it is a general entity.
|
boolean
|
isParameter()
Returns true if it is a parameter entity.
|
static
int
|
name2type(String nm)
Converts nm string to the corresponding
entity type.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Fields
Public Constructors
public
Entity
(String name, int type, char[] data)
Parameters
name
| the name of the entity |
type
| the type of the entity |
data
| the char array of data
|
Public Methods
public
String
getName
()
Gets the name of the entity.
Returns
- the name of the entity, as a
String
public
String
getString
()
Returns the data as a String
.
public
int
getType
()
Gets the type of the entity.
public
boolean
isGeneral
()
Returns true
if it is a general entity.
Returns
true
if it is a general entity
public
boolean
isParameter
()
Returns true
if it is a parameter entity.
Returns
true
if it is a parameter entity
public
static
int
name2type
(String nm)
Converts nm
string to the corresponding
entity type. If the string does not have a corresponding
entity type, returns the type corresponding to "CDATA".
Valid entity types are: "PUBLIC", "CDATA", "SDATA", "PI",
"STARTTAG", "ENDTAG", "MS", "MD", "SYSTEM".
Parameters
nm
| the string to be converted |
Returns
- the corresponding entity type, or the type corresponding
to "CDATA", if none exists