diff options
author | buraq <buraq@epfl.ch> | 2003-11-21 15:45:44 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-11-21 15:45:44 +0000 |
commit | ed02ff19e9b7c81622fa8047039cbc6e5c454865 (patch) | |
tree | caff528fc0f3edc0bbda13953d42762da4847d7c | |
parent | e81d53a7e6cbcd8139410830ec163cde016215a4 (diff) | |
download | scala-ed02ff19e9b7c81622fa8047039cbc6e5c454865.tar.gz scala-ed02ff19e9b7c81622fa8047039cbc6e5c454865.tar.bz2 scala-ed02ff19e9b7c81622fa8047039cbc6e5c454865.zip |
attributes...
-rw-r--r-- | sources/scala/xml/Node.scala | 2 | ||||
-rw-r--r-- | sources/scala/xml/Text.scala | 2 | ||||
-rw-r--r-- | sources/scala/xml/nobinding/Element.scala | 1 | ||||
-rw-r--r-- | sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala | 1 | ||||
-rw-r--r-- | sources/scala/xml/nobinding/XML.scala | 2 |
5 files changed, 4 insertions, 4 deletions
diff --git a/sources/scala/xml/Node.scala b/sources/scala/xml/Node.scala index 0ae73a7618..13d29613ce 100644 --- a/sources/scala/xml/Node.scala +++ b/sources/scala/xml/Node.scala @@ -13,7 +13,7 @@ abstract class Node { /** returns a mapping from all present attributes to values */ def attributes: Map[String,String]; - protected val attribHashCode: int; + protected val attribHashCode = attributes.toList.hashCode(); /** hashcode for this node*/ override def hashCode() = Utility.hashCode( label, attribHashCode, children ); diff --git a/sources/scala/xml/Text.scala b/sources/scala/xml/Text.scala index 7e46603b34..a44c5e55e4 100644 --- a/sources/scala/xml/Text.scala +++ b/sources/scala/xml/Text.scala @@ -13,7 +13,7 @@ case class Text( text:String ) extends Node { def children = Nil; def attributes = null; - protected val attribHashCode = 0; + protected override val attribHashCode = 0; override def toXML = Utility.escape( text ); diff --git a/sources/scala/xml/nobinding/Element.scala b/sources/scala/xml/nobinding/Element.scala index 5213ee8944..1fb072c79b 100644 --- a/sources/scala/xml/nobinding/Element.scala +++ b/sources/scala/xml/nobinding/Element.scala @@ -10,7 +10,6 @@ case class Element( symbol: Symbol, ch: List[Node] ) extends Node { def label = symbol.name; def children = ch; - protected val attribHashCode = 0; /* overriden at parse time */ def attributes : Map[String,String] = null ; /* overriden at parse time */ } diff --git a/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala b/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala index 5bd011a3d6..84a51066c4 100644 --- a/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala +++ b/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala @@ -19,7 +19,6 @@ class NoBindingFactoryAdapter extends FactoryAdapter { children: List[Node] ):Element = { val el = new Element( Symbol( label ), children ) { - override val attribHashCode = attrs.toList.hashCode(); /*set eagerly*/ override def attributes = attrs; }; diff --git a/sources/scala/xml/nobinding/XML.scala b/sources/scala/xml/nobinding/XML.scala index 2c2dfe3385..a0334b45d5 100644 --- a/sources/scala/xml/nobinding/XML.scala +++ b/sources/scala/xml/nobinding/XML.scala @@ -10,6 +10,8 @@ import scala.xml.Utility ; **/ object XML { + def < (def s:Symbol) = s; + // functions for generic xml loading, saving /** loads XML from a given file*/ |