diff options
author | michelou <michelou@epfl.ch> | 2006-10-04 17:20:38 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2006-10-04 17:20:38 +0000 |
commit | 054f9fcc98382ba420e75382ae6fb9d5c3cd4ce8 (patch) | |
tree | 57db908f00866ee559e1fa1bfed644bc3bc15926 /src/library | |
parent | 8b2e339813de1cc0dbbb2275fbc733d1ea571d08 (diff) | |
download | scala-054f9fcc98382ba420e75382ae6fb9d5c3cd4ce8.tar.gz scala-054f9fcc98382ba420e75382ae6fb9d5c3cd4ce8.tar.bz2 scala-054f9fcc98382ba420e75382ae6fb9d5c3cd4ce8.zip |
updated man page for scaladoc, improved Scala c...
updated man page for scaladoc, improved Scala comments
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/BigInt.scala | 24 | ||||
-rw-r--r-- | src/library/scala/xml/Parsing.scala | 111 |
2 files changed, 71 insertions, 64 deletions
diff --git a/src/library/scala/BigInt.scala b/src/library/scala/BigInt.scala index be2d00d5e5..8efad433b1 100644 --- a/src/library/scala/BigInt.scala +++ b/src/library/scala/BigInt.scala @@ -109,6 +109,10 @@ object BigInt { } } +/** + * @author Martin Odersky + * @version 1.0, 15/07/2003 + */ [serializable] class BigInt(val bigInteger: BigInteger) extends runtime.BoxedNumber { @@ -312,28 +316,32 @@ class BigInt(val bigInteger: BigInteger) extends runtime.BoxedNumber { def charValue = intValue.toChar /** Converts this BigInt to an <tt>int</tt>. - * If the BigInt is too big to fit in a char, only the low-order 32 bits are returned. - * Note that this conversion can lose information about the overall magnitude of the - * BigInt value as well as return a result with the opposite sign. + * If the BigInt is too big to fit in a char, only the low-order 32 bits + * are returned. Note that this conversion can lose information about the + * overall magnitude of the BigInt value as well as return a result with + * the opposite sign. */ def intValue = this.bigInteger.intValue /** Converts this BigInt to a <tt>long</tt>. - * If the BigInt is too big to fit in a char, only the low-order 64 bits are returned. - * Note that this conversion can lose information about the overall magnitude of the - * BigInt value as well as return a result with the opposite sign. + * If the BigInt is too big to fit in a char, only the low-order 64 bits + * are returned. Note that this conversion can lose information about the + * overall magnitude of the BigInt value as well as return a result with + * the opposite sign. */ def longValue = this.bigInteger.longValue /** Converts this BigInt to a <tt>float</tt>. * if this BigInt has too great a magnitude to represent as a float, - * it will be converted to Float.NEGATIVE_INFINITY or Float.POSITIVE_INFINITY as appropriate. + * it will be converted to <code>Float.NEGATIVE_INFINITY</code> or + * <code>Float.POSITIVE_INFINITY</code> as appropriate. */ def floatValue = this.bigInteger.floatValue /** Converts this BigInt to a <tt>double</tt>. * if this BigInt has too great a magnitude to represent as a float, - * it will be converted to Float.NEGATIVE_INFINITY or Float.POSITIVE_INFINITY as appropriate. + * it will be converted to <code>Float.NEGATIVE_INFINITY</code> or + * <code>Float.POSITIVE_INFINITY</code> as appropriate. */ def doubleValue = this.bigInteger.doubleValue diff --git a/src/library/scala/xml/Parsing.scala b/src/library/scala/xml/Parsing.scala index c19fb022f5..17bf4567b4 100644 --- a/src/library/scala/xml/Parsing.scala +++ b/src/library/scala/xml/Parsing.scala @@ -9,98 +9,97 @@ // $Id$ -package scala.xml; +package scala.xml -/** DEPRECATED - use either parsing.TokenTests, or Utilty (helper functions - * for parsing XML fragments ). +/** The object <code>Parsing</code> ... + * + * @author Burak Emir + * @version 1.0 + * + * @deprecated use either <code>parsing.TokenTests</code> or + * <code>Utilty</code> (helper functions for parsing XML fragments). */ object Parsing { - /** (#x20 | #x9 | #xD | #xA) */ - final def isSpace( ch:Char ):Boolean = ch match { + /** <pre>(#x20 | #x9 | #xD | #xA)</pre> */ + final def isSpace(ch: Char): Boolean = ch match { case '\u0009' | '\u000A' | '\u000D' | '\u0020' => true - case _ => false; + case _ => false } - /** (#x20 | #x9 | #xD | #xA)+ */ - final def isSpace( cs:Seq[Char] ):Boolean = { - val it = cs.elements; - it.hasNext && it.forall { isSpace }; + /** <pre>(#x20 | #x9 | #xD | #xA)+</pre> */ + final def isSpace(cs: Seq[Char]): Boolean = { + val it = cs.elements + it.hasNext && it.forall { isSpace } } - /** NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' - * | CombiningChar | Extender + /** <pre>NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' + * | CombiningChar | Extender</pre> * * see [4] and Appendix B of XML 1.0 specification - */ - def isNameChar( ch:Char ) = isNameStart( ch ) || (ch match { - case '.' | '-' | ':' => true; - case _ => java.lang.Character.getType( ch ).asInstanceOf[Byte] match { - case java.lang.Character.COMBINING_SPACING_MARK => true; // Mc - case java.lang.Character.ENCLOSING_MARK => true; // Me - case java.lang.Character.NON_SPACING_MARK => true; // Mn - case java.lang.Character.MODIFIER_LETTER => true; // Lm - case java.lang.Character.DECIMAL_DIGIT_NUMBER => true; // Nd - case _ => false; + */ + def isNameChar(ch: Char) = isNameStart(ch) || (ch match { + case '.' | '-' | ':' => true + case _ => java.lang.Character.getType(ch).asInstanceOf[Byte] match { + case java.lang.Character.COMBINING_SPACING_MARK => true // Mc + case java.lang.Character.ENCLOSING_MARK => true // Me + case java.lang.Character.NON_SPACING_MARK => true // Mn + case java.lang.Character.MODIFIER_LETTER => true // Lm + case java.lang.Character.DECIMAL_DIGIT_NUMBER => true // Nd + case _ => false } }); - /** NameStart ::= ( Letter | '_' ) + /** <pre>NameStart ::= ( Letter | '_' )</pre> * where Letter means in one of the Unicode general * categories { Ll, Lu, Lo, Lt, Nl } * * We do not allow a name to start with ':'. * see [3] and Appendix B of XML 1.0 specification */ - def isNameStart( ch:Char ) = - java.lang.Character.getType( ch ).asInstanceOf[Byte] match { - case java.lang.Character.LOWERCASE_LETTER => true; - case java.lang.Character.UPPERCASE_LETTER => true; - case java.lang.Character.OTHER_LETTER => true; - case java.lang.Character.TITLECASE_LETTER => true; - case java.lang.Character.LETTER_NUMBER => true; - case _ => ch match { - case '_' => true - case _ => false; - } + def isNameStart(ch: Char) = + java.lang.Character.getType(ch).asInstanceOf[Byte] match { + case java.lang.Character.LOWERCASE_LETTER => true + case java.lang.Character.UPPERCASE_LETTER => true + case java.lang.Character.OTHER_LETTER => true + case java.lang.Character.TITLECASE_LETTER => true + case java.lang.Character.LETTER_NUMBER => true + case _ => ch == '_' } - /** Name ::= ( Letter | '_' ) (NameChar)* + /** <pre>Name ::= ( Letter | '_' ) (NameChar)*</pre> * * see [5] of XML 1.0 specification */ - def isName( s:String ): Boolean = { - if( s.length() > 0 ) { - val z:Seq[Char] = s; - val y = z.elements; - if( isNameStart( y.next ) ) { - while( y.hasNext && isNameChar( y.next ) ) {}; + def isName(s: String): Boolean = + if (s.length() > 0) { + val z: Seq[Char] = s + val y = z.elements + if (isNameStart(y.next)) { + while (y.hasNext && isNameChar(y.next)) {} !y.hasNext - } else false; - } else false; - } + } else false + } else false - def isPubIDChar( c:Char ) = c match { - case '\u0020' | '\u000D' | '\u000A' => true; + def isPubIDChar(c: Char) = c match { + case '\u0020' | '\u000D' | '\u000A' => true case _ if - ('0' < c && c < '9')||('a' < c && c < 'z')||('A' < c && c < 'Z') => true; + ('0' < c && c < '9')||('a' < c && c < 'z')||('A' < c && c < 'Z') => true case '-' | '\''| '(' | ')' | '+' | ',' | '.' | '/' | ':' | '=' | '?' | ';' | '!' | '*' | '#' | '@' | '$' | '_' | '%' => true - case _ => false; + case _ => false } - def checkSysID(s: String): Boolean = { + def checkSysID(s: String): Boolean = s.indexOf('"') == -1 || s.indexOf('\'') == -1 - } - def checkPubID(s: String): Boolean = { - if( s.length() > 0 ) { - val z:Seq[Char] = s; - val y = z.elements; - while( y.hasNext && isPubIDChar( y.next ) ){}; + def checkPubID(s: String): Boolean = + if (s.length() > 0) { + val z:Seq[Char] = s + val y = z.elements + while (y.hasNext && isPubIDChar(y.next)) {} !y.hasNext } else true - } } |