diff options
author | michelou <michelou@epfl.ch> | 2006-12-22 10:13:58 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2006-12-22 10:13:58 +0000 |
commit | 7ed033caf35f31a021b847b45ce519318daccaf9 (patch) | |
tree | 2e428008e0ec8a7713c76ccdae80334c3bae6833 /src/library/scala/xml/Atom.scala | |
parent | c633e28b40ec2f7e195842a75dc98fa6b953d898 (diff) | |
download | scala-7ed033caf35f31a021b847b45ce519318daccaf9.tar.gz scala-7ed033caf35f31a021b847b45ce519318daccaf9.tar.bz2 scala-7ed033caf35f31a021b847b45ce519318daccaf9.zip |
small cleanups in xml/*.scala
Diffstat (limited to 'src/library/scala/xml/Atom.scala')
-rw-r--r-- | src/library/scala/xml/Atom.scala | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/library/scala/xml/Atom.scala b/src/library/scala/xml/Atom.scala index 0bbf65f979..7f45458101 100644 --- a/src/library/scala/xml/Atom.scala +++ b/src/library/scala/xml/Atom.scala @@ -1,6 +1,6 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** @@ -9,41 +9,47 @@ // $Id$ -package scala.xml; +package scala.xml -import compat.StringBuilder; +import compat.StringBuilder -/** an XML node for text (PCDATA). Used in both non-bound and bound XML - * representations - * @author Burak Emir - * @param text the text contained in this node, may not be null. +/** The class <code>Atom</code> provides an XML node for text (PCDATA). + * It is used in both non-bound and bound XML representations. + * + * @author Burak Emir + * @param text the text contained in this node, may not be <code>null</code>. */ [serializable] -class Atom[+A]( val data: A ) extends SpecialNode { +class Atom[+A](val data: A) extends SpecialNode { data match { case null => new IllegalArgumentException("cannot construct Atom(null)") case _ => } - final override def typeTag$:Int = -1; + final override def typeTag$: Int = -1 /** the constant "#PCDATA" - */ - def label = "#PCDATA"; + */ + def label = "#PCDATA" - override def equals(x:Any) = x match { + override def equals(x: Any) = x match { case s:Atom[_] => data == s.data - case _ => false; + case _ => false } /** hashcode for this Text */ override def hashCode() = - data.hashCode(); - - /** returns text, with some characters escaped according to XML spec */ + data.hashCode() + + /** Returns text, with some characters escaped according to the XML + * specification. + * + * @param sb ... + * @return ... + */ def toString(sb: StringBuilder) = - Utility.escape( data.toString(), sb ); + Utility.escape(data.toString(), sb) - override def text: String = data.toString(); + override def text: String = data.toString() } |