org.specrunner.util.xom
Class AbstractType<T extends AbstractType<T>>

java.lang.Object
  extended by org.specrunner.util.xom.AbstractType<T>
Type Parameters:
T - The type.
All Implemented Interfaces:
Comparable<T>, IPresentation
Direct Known Subclasses:
ActionType, Status

public class AbstractType<T extends AbstractType<T>>
extends Object
implements Comparable<T>, IPresentation

A type with importance.

Author:
Thiago Santos

Field Summary
protected  double importance
          Its priority, for example, ASSERTION has higher priority than ACTION, which has higher priority than UNDEF.
protected  String name
          The type name.
 
Constructor Summary
protected AbstractType(String name, double importance)
          Creates a type.
 
Method Summary
 nu.xom.Node asNode()
          The object representation as node.
 String asString()
          The object representation as string.
 int compareTo(T o)
           
 boolean equals(Object obj)
           
 String getCssName()
          The CSS which represents the type.
 String getName()
          The type name.
 int hashCode()
           
 T max(T obj)
          Compares the status with another returning the most significant.
 void setName(String name)
          Set the name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name
The type name.


importance

protected double importance
Its priority, for example, ASSERTION has higher priority than ACTION, which has higher priority than UNDEF.

Constructor Detail

AbstractType

protected AbstractType(String name,
                       double importance)
Creates a type.

Parameters:
name - The name.
importance - The importance.
Method Detail

getName

public String getName()
The type name.

Returns:
The name.

getCssName

public String getCssName()
The CSS which represents the type.

Returns:
The CSS name.

setName

public void setName(String name)
Set the name.

Parameters:
name - The new name.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

compareTo

public int compareTo(T o)
Specified by:
compareTo in interface Comparable<T extends AbstractType<T>>

max

public T max(T obj)
Compares the status with another returning the most significant.

Parameters:
obj - The comparing status.
Returns:
The resulting status.

asString

public String asString()
Description copied from interface: IPresentation
The object representation as string.

Specified by:
asString in interface IPresentation
Returns:
String representation.

asNode

public nu.xom.Node asNode()
Description copied from interface: IPresentation
The object representation as node.

Specified by:
asNode in interface IPresentation
Returns:
Node representation.


Copyright © 2014. All rights reserved.