text.scala

来自「JAVA 语言的函数式编程扩展」· SCALA 代码 · 共 44 行

SCALA
44
字号
/*                     __                                               *\**     ________ ___   / /  ___     Scala API                            ****    / __/ __// _ | / /  / _ |    (c) 2003-2007, LAMP/EPFL             ****  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **** /____/\___/_/ |_/____/_/ | |                                         ****                          |/                                          **\*                                                                      */// $Id: Text.scala 14555 2008-04-08 15:42:54Z washburn $package scala.xml/** The class <code>Text</code> implements 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 null. */case class Text(_data: String) extends Atom[String](_data) {  if (null == data)    throw new java.lang.NullPointerException("tried to construct Text with null")  final override def equals(x: Any) = x match {    case s:String  => s == data    case s:Text    => data == s.data    case s:Atom[_] => data == s.data    case _ => false  }  /** Returns text, with some characters escaped according to the XML   *  specification.   *   *  @param  sb ...   *  @return ...    */  override def toString(sb: StringBuilder) =    Utility.escape(data, sb)}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?