atom.scala
来自「JAVA 语言的函数式编程扩展」· SCALA 代码 · 共 54 行
SCALA
54 行
/* __ *\** ________ ___ / / ___ Scala API **** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL **** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **** /____/\___/_/ |_/____/_/ | | **** |/ **\* */// $Id: Atom.scala 12905 2007-09-18 09:13:45Z michelou $package scala.xml/** 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>. */@serializableclass Atom[+A](val data: A) extends SpecialNode { data.asInstanceOf[AnyRef] match { case null => new IllegalArgumentException("cannot construct Atom(null)") case _ => } final override def typeTag$: Int = -1 /** the constant "#PCDATA" */ def label = "#PCDATA" override def equals(x: Any) = x match { case s:Atom[_] => data == s.data case _ => false } /** hashcode for this Text */ override def hashCode() = 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) override def text: String = data.toString()}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?