net.sf.xtvdclient.xtvd.datatypes
Class AbstractDataType

java.lang.Object
  extended by net.sf.xtvdclient.xtvd.datatypes.AbstractDataType
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
Crew, CrewMember, DateTime, Duration, Genre, Lineup, Map, Part, Program, ProgramGenre, Schedule, Station, Xtvd, XtvdDate

public abstract class AbstractDataType
extends java.lang.Object
implements java.lang.Comparable

An abstract super-class for all XML datatypes. This class provides default implementations for equals(Object) and compareTo(Object) methods. Also provides methods that will replace special characters with their XML equivalents.

Since:
ddclient version 1.3

Copyright 2004, Tribune Media Services

$Id: AbstractDataType.java,v 1.1 2004/03/19 21:58:02 rakesh Exp $


Field Summary
static java.lang.String END_OF_LINE
          The end of line character to be used for separating XML elements.
 
Constructor Summary
AbstractDataType()
           
 
Method Summary
 int compareTo(java.lang.Object object)
          Implementation of the Comparable interface.
 boolean equals(java.lang.Object object)
          Indicates whether some other object is "equal to" this one.
protected static java.lang.String replaceSpecialCharacters(java.lang.String data)
          Replace special characters (&, ...) in the string passed in with appropriate escape values.
protected static java.lang.StringBuffer replaceSpecialCharacters(java.lang.String data, java.lang.StringBuffer buffer)
          Replace special characters (&, ...) in the string passed in with appropriate escape values and add them to the StringBuffer passed in.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

END_OF_LINE

public static final java.lang.String END_OF_LINE
The end of line character to be used for separating XML elements.

Constructor Detail

AbstractDataType

public AbstractDataType()
Method Detail

replaceSpecialCharacters

protected static java.lang.String replaceSpecialCharacters(java.lang.String data)
Replace special characters (&, ...) in the string passed in with appropriate escape values.

Parameters:
data - The string that is to be processed.
Returns:
The modified String object.

replaceSpecialCharacters

protected static java.lang.StringBuffer replaceSpecialCharacters(java.lang.String data,
                                                                 java.lang.StringBuffer buffer)
Replace special characters (&, ...) in the string passed in with appropriate escape values and add them to the StringBuffer passed in.

Parameters:
data - The string that is to be processed.
buffer - The buffer to which the properly escaped string values are to be written.
Returns:
The modified StringBuffer.

equals

public boolean equals(java.lang.Object object)
Indicates whether some other object is "equal to" this one. Returns true if the specified object is of the same class type, and has the same Object.hashCode() value.

Overrides:
equals in class java.lang.Object
Parameters:
object - The reference object with which to compare.
Returns:
Return true if the match succeeds.
Since:
ddclient version 1.3

compareTo

public int compareTo(java.lang.Object object)
Implementation of the Comparable interface. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The comparison is done by comparing the Object.hashCode() values of the objects.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - The object with which this class is to be compared. No class type checking is done.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Since:
ddclient version 1.3