org.encog.parse.tags
Class Tag

java.lang.Object
  extended by org.encog.parse.tags.Tag
All Implemented Interfaces:
Cloneable

public class Tag
extends Object
implements Cloneable

HTMLTag: This class holds a single HTML tag. This class subclasses the AttributeList class. This allows the HTMLTag class to hold a collection of attributes, just as an actual HTML tag does.


Nested Class Summary
static class Tag.Type
          Tag types.
 
Constructor Summary
Tag()
           
 
Method Summary
 void clear()
          Clear the name, type and attributes.
 Tag clone()
           
 int getAttributeInt(String attributeId)
          Get the specified attribute as an integer.
 Map<String,String> getAttributes()
          Get a map of all attributes.
 String getAttributeValue(String name)
          Get the value of the specified attribute.
 String getName()
           
 Tag.Type getType()
           
 void setAttribute(String name, String value)
          Set a HTML attribute.
 void setName(String s)
          Set the tag name.
 void setType(Tag.Type type)
          Set the tag type.
 String toString()
          Convert this tag back into string form, with the beginning < and ending >.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tag

public Tag()
Method Detail

clear

public void clear()
Clear the name, type and attributes.


clone

public Tag clone()
Overrides:
clone in class Object
Returns:
A cloned copy of the object.

getAttributeInt

public int getAttributeInt(String attributeId)
Get the specified attribute as an integer.

Parameters:
attributeId - The attribute name.
Returns:
The attribute value.

getAttributes

public Map<String,String> getAttributes()
Get a map of all attributes.

Returns:
The attributes.

getAttributeValue

public String getAttributeValue(String name)
Get the value of the specified attribute.

Parameters:
name - The name of an attribute.
Returns:
The value of the specified attribute.

getName

public String getName()
Returns:
Get the tag name.

getType

public Tag.Type getType()
Returns:
Get the tag type.

setAttribute

public void setAttribute(String name,
                         String value)
Set a HTML attribute.

Parameters:
name - The name of the attribute.
value - The value of the attribute.

setName

public void setName(String s)
Set the tag name.

Parameters:
s - The name.

setType

public void setType(Tag.Type type)
Set the tag type.

Parameters:
type - The tag type.

toString

public String toString()
Convert this tag back into string form, with the beginning < and ending >.

Overrides:
toString in class Object
Returns:
The Attribute object that was found.


Copyright © 2014. All Rights Reserved.