From 4047801c1e7514ce2a984f788e80f8165f634e64 Mon Sep 17 00:00:00 2001 From: michelou Date: Tue, 8 Nov 2005 12:42:14 +0000 Subject: - updated header. - improved comments. --- sources/scala/xml/Node.scala | 63 ++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/sources/scala/xml/Node.scala b/sources/scala/xml/Node.scala index 1aea168ff6..9dfd1c3e6c 100644 --- a/sources/scala/xml/Node.scala +++ b/sources/scala/xml/Node.scala @@ -1,17 +1,20 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2004, LAMP/EPFL ** +** / __/ __// _ | / / / _ | (c) 2003-2005, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** -** $Id$ \* */ +// $Id$ + package scala.xml; import scala.collection.Map; -import scala.collection.immutable; +/** + * This object provides methods + */ object Node { /** the constant empty attribute sequence */ @@ -23,8 +26,11 @@ object Node { } /** - * Trait for representing XML using nodes of a labelled tree. - * This trait contains an implementation of a subset of XPath for navigation. + * An abstract class representing XML with nodes of a labelled tree. + * This class contains an implementation of a subset of XPath for navigation. + * + * @author Burak Emir and others + * @version 1.1 */ abstract class Node extends NodeSeq { @@ -43,27 +49,32 @@ abstract class Node extends NodeSeq { def namespace = getNamespace(prefix); def getNamespace(_pre: String) = - if(scope == null) null else scope.getURI(_pre); + if (scope == null) null else scope.getURI(_pre); - /** looks up an unprefixed attribute in attributes of this node. - * @param key of queried attribute. - * @return value of UnprefixedAttribute with given key in attributes, if - * it exists, otherwise null. + /** + * Looks up an unprefixed attribute in attributes of this node. + * + * @param key of queried attribute. + * @return value of UnprefixedAttribute with given key + * in attributes, if it exists, otherwise null. */ final def attribute(key: String) = attributes.getValue(key); - /** looks up a prefixed attribute in attributes of this node. - * @param uri namespace of queried attribute (may not be null). - * @param key of queried attribute. - * @return value of PrefixedAttribute with given namespace and - * given key, otherwise null. + /** + * Looks up a prefixed attribute in attributes of this node. + * + * @param uri namespace of queried attribute (may not be null). + * @param key of queried attribute. + * @return value of PrefixedAttribute with given namespace + * and given key, otherwise null. */ - final def attribute(uri:String, key: String) = + final def attribute(uri: String, key: String) = attributes.getValue(uri, this, key); - /** attribute axis - all attributes of this node, in order defined by attrib - */ + /** + * Attribute axis - all attributes of this node, in order defined by attrib + */ def attributes: MetaData = Null; @@ -102,23 +113,31 @@ abstract class Node extends NodeSeq { def toString(stripComment: Boolean): String = Utility.toXML(this, stripComment); - /** same as toString(false). + /** + * Same as toString(false). + * * @see "toString(Boolean)" */ override def toString(): String = toString(false); - /** appends qualified name of this node to StringBuffer + /** + * Appends qualified name of this node to StringBuffer. + * + * @param sb + * @return .. */ def nameToString(sb: StringBuffer): StringBuffer = { - if(null != prefix) { + if (null != prefix) { sb.append(prefix); sb.append(':'); } sb.append(label); } - /** returns a type symbol (e.g. DTD, XSD), default null */ + /** + * Returns a type symbol (e.g. DTD, XSD), default null. + */ def xmlType(): TypeSymbol = null; override def text: String; -- cgit v1.2.3