GXPARSE hosted by SourceForge.net Logo

ca.gorman.xml.parse.toolkit
Class AbstractEntity

java.lang.Object
  extended by ca.gorman.xml.parse.toolkit.AbstractEntity
All Implemented Interfaces:
Entity
Direct Known Subclasses:
CoroutineEntity, MutableEntity

public abstract class AbstractEntity
extends Object
implements Entity

Abstract realization of Entity.

This is a common base class for the parser's internal view of entities objects and the application programmer's external view of Entity objects. Entities are presented to the application programmer as immutable objects, but are treated as mutable objects inside the parser. The mutable version is created by subclassing to expose the setters.


Constructor Summary
protected AbstractEntity()
           Create an uninitialized AbstractEntity.
protected AbstractEntity(String name)
           Create an initialized AbstractEntity.
 
Method Summary
 boolean equals(Object obj)
           Defines the equality of two Entity objects as equality of their names.
 String getName()
           Get entity name
 int hashCode()
           Returns hash code of the String entity name.
 AbstractEntity newInstance(String name)
           Create an immutable AbstractEntity.
protected  void setName(String name)
           Set name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEntity

protected AbstractEntity(String name)

Create an initialized AbstractEntity.


AbstractEntity

protected AbstractEntity()

Create an uninitialized AbstractEntity.

Method Detail

newInstance

public AbstractEntity newInstance(String name)

Create an immutable AbstractEntity.


getName

public final String getName()
Description copied from interface: Entity

Get entity name

Specified by:
getName in interface Entity

setName

protected void setName(String name)

Set name.


equals

public boolean equals(Object obj)

Defines the equality of two Entity objects as equality of their names. An Entity with a null name is not equal to anything, not even another Entity with a null name.

Specified by:
equals in interface Entity
Overrides:
equals in class Object

hashCode

public int hashCode()
Description copied from interface: Entity

Returns hash code of the String entity name.

Specified by:
hashCode in interface Entity
Overrides:
hashCode in class Object

GXPARSE download

GXPARSE Generic XML Stream Parser API and supporting tools.   Release $Name: gxparse-sf-alpha-2_0 $
Copyright 2003-2004 Ian E. Gorman
Released under GNU Lesser General Public License