com.tensegrity.graphics.text
Class CharacterElement

java.lang.Object
  extended bycom.tensegrity.graphics.text.AbstractElement
      extended bycom.tensegrity.graphics.text.CharacterElement
All Implemented Interfaces:
Element

public class CharacterElement
extends AbstractElement

A CharacterElement represents the atomic element of a text.

Version:
$Id: CharacterElement.java,v 1.5 2004/07/14 16:15:33 GillesIachelini Exp $
Author:
Gilles Iachelini

Nested Class Summary
 
Nested classes inherited from class com.tensegrity.graphics.text.Element
Element.ElementIterator
 
Constructor Summary
CharacterElement(char c)
          Constructor for CharacterElement.
 
Method Summary
 void addElement(Element element)
          Method addElement adds an element to this Element.
 java.util.List getCharacters()
          Method getCharacters should return a List with all CharacterElements of this Element implementation.
 Element getElement(int index)
          Method getElement returns the Element at position index.
 int getElementCount()
          Returns 1 by default, since this class represents a single character.
 java.lang.String getText()
          Concats all containing Elements and returns it as String.
 java.util.Iterator iterator()
          No iterator will be returned since instances of this class consist of only one character.
 java.lang.String toString()
           
 
Methods inherited from class com.tensegrity.graphics.text.AbstractElement
getFontFormat, getHtmlText, isEmpty, remove, removeTextElements, setFontFormat, setText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharacterElement

public CharacterElement(char c)
Constructor for CharacterElement.

Parameters:
c - the Character to represent by this CharacterElement instance.
Method Detail

getElement

public Element getElement(int index)
Description copied from interface: Element
Method getElement returns the Element at position index. within this Element.

Specified by:
getElement in interface Element
Overrides:
getElement in class AbstractElement

getElementCount

public int getElementCount()
Returns 1 by default, since this class represents a single character.

Specified by:
getElementCount in interface Element
Overrides:
getElementCount in class AbstractElement
See Also:
Element.getElementCount()

iterator

public java.util.Iterator iterator()
No iterator will be returned since instances of this class consist of only one character.

Specified by:
iterator in interface Element
Overrides:
iterator in class AbstractElement

getText

public java.lang.String getText()
Description copied from class: AbstractElement
Concats all containing Elements and returns it as String.

Specified by:
getText in interface Element
Overrides:
getText in class AbstractElement
See Also:
Element.getText()

addElement

public void addElement(Element element)
Description copied from interface: Element
Method addElement adds an element to this Element.

Specified by:
addElement in interface Element
Overrides:
addElement in class AbstractElement

toString

public java.lang.String toString()

getCharacters

public java.util.List getCharacters()
Description copied from class: AbstractElement
Method getCharacters should return a List with all CharacterElements of this Element implementation.

Specified by:
getCharacters in class AbstractElement
Returns:
List with all CharacterElements within this Element and all of its subelements.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.