net.sf.jplist.core
Class Element<E>

java.lang.Object
  extended by net.sf.jplist.core.Element<E>
All Implemented Interfaces:
IElement<E>
Direct Known Subclasses:
ArrayElement, DataElement, DictionaryElement, Document, StringElement

public class Element<E>
extends java.lang.Object
implements IElement<E>

Generic implementation of an IElement object. This is the generic supertype for all the core objects that represent PList data types.

Version:
$Revision: 1.1 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
protected Element(Type type)
          Instantiate a concrete subclass with the specified type enumeration.
 
Method Summary
 void addContent(E obj)
          Add an object of type E to the container.
 java.util.List<E> getContent()
          Return a List of objects of type E.
 Type getType()
          Returns the Type of the IElement object.
 void setContent(java.util.List<E> list)
          Set the underlying List object for this generic container.
 int typeOf()
          Returns the type of the IElement object as an int.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Element

protected Element(Type type)
Instantiate a concrete subclass with the specified type enumeration. This can only be called from subclasses to prevent the client from being able to instantiate the generic object directly.

Parameters:
type - an element of the Type enumeration.
Method Detail

getContent

public java.util.List<E> getContent()
Return a List of objects of type E.

Specified by:
getContent in interface IElement<E>
Returns:
a List.

addContent

public void addContent(E obj)
Add an object of type E to the container.

Specified by:
addContent in interface IElement<E>
Parameters:
obj - an object of type E.

setContent

public void setContent(java.util.List<E> list)
Set the underlying List object for this generic container.

Specified by:
setContent in interface IElement<E>
Parameters:
list - a List.

typeOf

public int typeOf()
Returns the type of the IElement object as an int. Note that this method has been retained for backward compatibility with for JPList users who wish to use the JPList library for Java 1.5 but who are calling it using Java 1.4. Clients written in Java 1.5 should use the getType()::Type method instead.

Specified by:
typeOf in interface IElement<E>
Returns:
the type of IElement object an int.
See Also:
IElement.typeOf()

getType

public Type getType()
Returns the Type of the IElement object.

Specified by:
getType in interface IElement<E>
Returns:
the Type of IElement object.
See Also:
IElement.getType()