summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2006-10-20 12:32:22 +0000
committermichelou <michelou@epfl.ch>2006-10-20 12:32:22 +0000
commitd1053b01cde71a47dec8038a2bd0d94ba5482819 (patch)
tree87d149aaa52757a8e5a82ddc93949b9f00ce968b /src
parentf44bc6e0664c93d80673043bbf31ce436f872c94 (diff)
downloadscala-d1053b01cde71a47dec8038a2bd0d94ba5482819.tar.gz
scala-d1053b01cde71a47dec8038a2bd0d94ba5482819.tar.bz2
scala-d1053b01cde71a47dec8038a2bd0d94ba5482819.zip
added FJBG classes to doc/script.js
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/doc/script.js215
-rw-r--r--src/library/scala/collection/mutable/ListBuffer.scala84
2 files changed, 209 insertions, 90 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/script.js b/src/compiler/scala/tools/nsc/doc/script.js
index ee462b2139..95558fa691 100644
--- a/src/compiler/scala/tools/nsc/doc/script.js
+++ b/src/compiler/scala/tools/nsc/doc/script.js
@@ -3,82 +3,145 @@ function setWindowTitle(title) {
parent.document.title = title;
}
-var java_api_root = 'http://java.sun.com/j2se/1.5.0/docs/api/';
-//var java_api_root = 'http://lamp.epfl.ch/~linuxsoft/java/jdk1.5/docs/api/';
+const java_api_root = 'http://java.sun.com/j2se/1.5.0/docs/api/';
+//const java_api_root = 'http://lamp.epfl.ch/~linuxsoft/java/jdk1.5/docs/api/';
-var scala_doc_url = parent.document.URL;
-var scala_api_root = scala_doc_url.substring(0, scala_doc_url.lastIndexOf("/")+1);
+const scala_doc_url = parent.document.URL;
+const scala_api_root = scala_doc_url.substring(0, scala_doc_url.lastIndexOf("/")+1);
-var ant_api_root = 'http://lamp.epfl.ch/~linuxsoft/ant/manual/api/';
-//var ant_api_root = 'http://www.net-freaks.org/doc/ant-1.6.5/manual/api/';
+const ant_api_root = 'http://lamp.epfl.ch/~linuxsoft/ant/manual/api/';
+//const ant_api_root = 'http://www.net-freaks.org/doc/ant-1.6.5/manual/api/';
-var eclipse_api_root = 'http://help.eclipse.org/help32/topic/org.eclipse.platform.doc.isv/reference/api/';
+const eclipse_api_root = 'http://help.eclipse.org/help32/topic/org.eclipse.platform.doc.isv/reference/api/';
+
+const fjbg_api_root = 'http://lamp.epfl.ch/~linuxsoft/fjbg/api/';
// hashtable_classes
var table = new Array()
function init() {
// initialize Java classes
- table['java_io_BufferedReader'] = java_api_root;
- table['java_io_BufferedWriter'] = java_api_root;
- table['java_io_DataInputStream'] = java_api_root;
- table['java_io_DataOutputStream'] = java_api_root;
- table['java_io_File'] = java_api_root;
- table['java_io_FileDescriptor'] = java_api_root;
- table['java_io_FileReader'] = java_api_root;
- table['java_io_FileWriter'] = java_api_root;
- table['java_io_IOException'] = java_api_root;
- table['java_io_InputStream'] = java_api_root;
- table['java_io_OutputStream'] = java_api_root;
- table['java_io_PrintStream'] = java_api_root;
- table['java_io_PrintWriter'] = java_api_root;
- table['java_io_Reader'] = java_api_root;
- table['java_io_StringReader'] = java_api_root;
- table['java_io_StringWriter'] = java_api_root;
- table['java_io_Writer'] = java_api_root;
- table['java_lang_Exception'] = java_api_root;
- table['java_lang_Long'] = java_api_root;
- table['java_lang_Object'] = java_api_root;
- table['java_lang_String'] = java_api_root;
- table['java_math_BigDecimal'] = java_api_root;
- table['java_math_BigInteger'] = java_api_root;
- table['java_math_MathContext'] = java_api_root;
- table['java_net_InetAddress'] = java_api_root;
- table['java_net_ServerSocket'] = java_api_root;
- table['java_net_Socket'] = java_api_root;
- table['java_net_SocketPermission'] = java_api_root;
- table['java_net_URI'] = java_api_root;
- table['java_net_URL'] = java_api_root;
- table['java_sql_Connection'] = java_api_root;
- table['java_sql_ResultSet'] = java_api_root;
- table['java_sql_ResultSetMetaData'] = java_api_root;
- table['java_util_LinkedHashMap'] = java_api_root;
- table['java_util_LinkedHashSet'] = java_api_root;
- table['java_util_Map'] = java_api_root;
- table['java_util_Properties'] = java_api_root;
- table['java_util_Random'] = java_api_root;
- table['java_util_Set'] = java_api_root;
- table['java_util_WeakHashMap'] = java_api_root;
+ table['java_io_BufferedReader'] = java_api_root;
+ table['java_io_BufferedWriter'] = java_api_root;
+ table['java_io_DataInputStream'] = java_api_root;
+ table['java_io_DataOutputStream'] = java_api_root;
+ table['java_io_File'] = java_api_root;
+ table['java_io_FileDescriptor'] = java_api_root;
+ table['java_io_FileReader'] = java_api_root;
+ table['java_io_FileWriter'] = java_api_root;
+ table['java_io_IOException'] = java_api_root;
+ table['java_io_InputStream'] = java_api_root;
+ table['java_io_OutputStream'] = java_api_root;
+ table['java_io_PrintStream'] = java_api_root;
+ table['java_io_PrintWriter'] = java_api_root;
+ table['java_io_Reader'] = java_api_root;
+ table['java_io_StringReader'] = java_api_root;
+ table['java_io_StringWriter'] = java_api_root;
+ table['java_io_Writer'] = java_api_root;
+ table['java_lang_Boolean'] = java_api_root;
+ table['java_lang_Byte'] = java_api_root;
+ table['java_lang_Character'] = java_api_root;
+ table['java_lang_Class'] = java_api_root;
+ table['java_lang_Clonable'] = java_api_root; //interface
+ table['java_lang_Comparable'] = java_api_root; //interface
+ table['java_lang_Exception'] = java_api_root;
+ table['java_lang_Float'] = java_api_root;
+ table['java_lang_Long'] = java_api_root;
+ table['java_lang_Math'] = java_api_root;
+ table['java_lang_Object'] = java_api_root;
+ table['java_lang_Runnable'] = java_api_root; //interface
+ table['java_lang_Runtime'] = java_api_root;
+ table['java_lang_RuntimePermission'] = java_api_root;
+ table['java_lang_Short'] = java_api_root;
+ table['java_lang_StrictMath'] = java_api_root;
+ table['java_lang_String'] = java_api_root;
+ table['java_lang_System'] = java_api_root;
+ table['java_lang_Thread'] = java_api_root;
+ table['java_lang_ThreadGroup'] = java_api_root;
+ table['java_lang_ThreadLocal'] = java_api_root;
+ table['java_lang_Throwable'] = java_api_root;
+ table['java_lang_Void'] = java_api_root;
+ table['java_math_BigDecimal'] = java_api_root;
+ table['java_math_BigInteger'] = java_api_root;
+ table['java_math_MathContext'] = java_api_root;
+ table['java_net_InetAddress'] = java_api_root;
+ table['java_net_ServerSocket'] = java_api_root;
+ table['java_net_Socket'] = java_api_root;
+ table['java_net_SocketPermission'] = java_api_root;
+ table['java_net_URI'] = java_api_root;
+ table['java_net_URL'] = java_api_root;
+ table['java_nio_Buffer'] = java_api_root;
+ table['java_nio_ByteBuffer'] = java_api_root;
+ table['java_nio_BufferOverflowException'] = java_api_root;
+ table['java_nio_ByteOrder'] = java_api_root;
+ table['java_nio_CharBuffer'] = java_api_root;
+ table['java_nio_DoubleBuffer'] = java_api_root;
+ table['java_nio_FloatBuffer'] = java_api_root;
+ table['java_nio_IntBuffer'] = java_api_root;
+ table['java_nio_LongBuffer'] = java_api_root;
+ table['java_nio_MappedByteBuffer'] = java_api_root;
+ table['java_nio_ShortBuffer'] = java_api_root;
+ table['java_nio_channels_Channels'] = java_api_root;
+ table['java_nio_channels_DatagramChannel'] = java_api_root;
+ table['java_nio_channels_FileChannel'] = java_api_root;
+ table['java_nio_channels_FileLock'] = java_api_root;
+ table['java_nio_channels_Pipe'] = java_api_root;
+ table['java_nio_channels_ReadableByteChannel'] = java_api_root;
+ table['java_nio_channels_Selector'] = java_api_root;
+ table['java_nio_channels_ServerSocketChannel'] = java_api_root;
+ table['java_nio_channels_SocketChannel'] = java_api_root;
+ table['java_nio_charset_CharsetDecoder'] = java_api_root;
+ table['java_rmi_AccessException'] = java_api_root;
+ table['java_rmi_MarshalledObject'] = java_api_root;
+ table['java_rmi_Naming'] = java_api_root;
+ table['java_rmi_RMISecurityManager'] = java_api_root;
+ table['java_rmi_Remote'] = java_api_root; //interface
+ table['java_sql_Array'] = java_api_root; //interface
+ table['java_sql_Blob'] = java_api_root; //interface
+ table['java_sql_CallableStatement'] = java_api_root; //interface
+ table['java_sql_Connection'] = java_api_root; //interface
+ table['java_sql_Date'] = java_api_root;
+ table['java_sql_DriverManager'] = java_api_root;
+ table['java_sql_ResultSet'] = java_api_root; //interface
+ table['java_sql_ResultSetMetaData'] = java_api_root; //interface
+ table['java_sql_SQLPermission'] = java_api_root;
+ table['java_sql_Time'] = java_api_root;
+ table['java_sql_Timestamp'] = java_api_root;
+ table['java_sql_Types'] = java_api_root;
+ table['java_util_LinkedHashMap'] = java_api_root;
+ table['java_util_LinkedHashSet'] = java_api_root;
+ table['java_util_Map'] = java_api_root;
+ table['java_util_Properties'] = java_api_root;
+ table['java_util_Random'] = java_api_root;
+ table['java_util_Set'] = java_api_root;
+ table['java_util_WeakHashMap'] = java_api_root;
// initialize Scala primitive classes
- table['scala_Any'] = scala_api_root;
- table['scala_Boolean'] = scala_api_root;
- table['scala_Byte'] = scala_api_root;
- table['scala_Char'] = scala_api_root;
- table['scala_Double'] = scala_api_root;
- table['scala_Float'] = scala_api_root;
- table['scala_Int'] = scala_api_root;
- table['scala_Null'] = scala_api_root;
- table['scala_Long'] = scala_api_root;
- table['scala_Null'] = scala_api_root;
- table['scala_Short'] = scala_api_root;
- table['scala_Unit'] = scala_api_root;
- table['scala_runtime_BoxedInt'] = scala_api_root;
- table['scala_runtime_BoxeFloat'] = scala_api_root;
- table['scala_runtime_BoxedNumber'] = scala_api_root;
+ table['scala_Any'] = scala_api_root;
+ table['scala_Boolean'] = scala_api_root;
+ table['scala_Byte'] = scala_api_root;
+ table['scala_Char'] = scala_api_root;
+ table['scala_Double'] = scala_api_root;
+ table['scala_Float'] = scala_api_root;
+ table['scala_Int'] = scala_api_root;
+ table['scala_Null'] = scala_api_root;
+ table['scala_Long'] = scala_api_root;
+ table['scala_Null'] = scala_api_root;
+ table['scala_Short'] = scala_api_root;
+ table['scala_Unit'] = scala_api_root;
+ table['scala_runtime_BoxedInt'] = scala_api_root;
+ table['scala_runtime_BoxeFloat'] = scala_api_root;
+ table['scala_runtime_BoxedNumber'] = scala_api_root;
// initialize Ant classes
+ table['org_apache_tools_ant_AntClassLoader'] = ant_api_root;
+ table['org_apache_tools_ant_AntTypeDefinition'] = ant_api_root;
table['org_apache_tools_ant_BuildEvent'] = ant_api_root;
+ table['org_apache_tools_ant_ComponentHelper'] = ant_api_root;
+ table['org_apache_tools_ant_DefaultLogger'] = ant_api_root;
+ table['org_apache_tools_ant_DemuxInputStream'] = ant_api_root;
+ table['org_apache_tools_ant_DemuxOutputStream'] = ant_api_root;
+ table['org_apache_tools_ant_Diagnostics'] = ant_api_root;
table['org_apache_tools_ant_DirectoryScanner'] = ant_api_root;
table['org_apache_tools_ant_Project'] = ant_api_root;
table['org_apache_tools_ant_Target'] = ant_api_root;
@@ -138,6 +201,34 @@ function init() {
table['org_eclipse_jdt_launching_SocketUtil'] = eclipse_api_root;
table['org_eclipse_jdt_launching_VMStandin'] = eclipse_api_root;
+ // initialize FJBG classes
+ table['ch_epfl_lamp_fjbg_FJBGContext'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JAccessFlags'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JArrayType'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JAttribute'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JAttributeFactory'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JClass'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JCode'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JCodeAttribute'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JConstantPool'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JExtendedCode'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JField'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JFieldOrMethod'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JInnerClassesAttribute'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JLabel'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JLineNumberTableAttribute'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JLocalVariable'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JMember'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JMethod'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JMethodType'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JObjectType'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JOpcode'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JOtherAttribute'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JReferenceType'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JSourceFileAttribute'] = fjbg_api_root;
+ table['ch_epfl_lamp_fjbg_JType'] = fjbg_api_root;
+ table['ch_epfl_lamp_util_ByteArray'] = fjbg_api_root;
+
var elems = document.getElementsByTagName('a');
for (i = 0; i < elems.length; i++) {
try {
diff --git a/src/library/scala/collection/mutable/ListBuffer.scala b/src/library/scala/collection/mutable/ListBuffer.scala
index 5df2be342a..1f4a975288 100644
--- a/src/library/scala/collection/mutable/ListBuffer.scala
+++ b/src/library/scala/collection/mutable/ListBuffer.scala
@@ -14,16 +14,20 @@ package scala.collection.mutable
import Predef._
-/**
+/** The class <code>ListBuffer</code> ..
+ *
+ * @author Matthias Zenger
+ * @version 1.0, 15/03/2004
*/
final class ListBuffer[A] extends Buffer[A] {
private var start: List[A] = Nil
private var last: ::[A] = _
private var exported: boolean = false
- /** Prepend a single element to this buffer.
+ /** Prepends a single element to this buffer.
*
* @param x the element to prepend.
+ * @return this buffer.
*/
def +: (x: A): Buffer[A] = {
if (exported) copy()
@@ -33,7 +37,7 @@ final class ListBuffer[A] extends Buffer[A] {
this
}
- /** Append a single element to this buffer.
+ /** Appends a single element to this buffer.
*
* @param x the element to append.
*/
@@ -49,10 +53,11 @@ final class ListBuffer[A] extends Buffer[A] {
}
}
- /** Remove a single element from the buffer and return
- * the identity of the buffer. Same as ``this -= x; this''
+ /** Removes a single element from the buffer and return
+ * the identity of the buffer. Same as <code>this -= x; this</code>
*
* @param x the element to remove.
+ * @return this buffer.
*/
def - (x: A): Buffer[A] = { this -= x; this }
@@ -71,7 +76,7 @@ final class ListBuffer[A] extends Buffer[A] {
val z = cursor.asInstanceOf[scala.::[A]]
if(z.tl == last)
last = z
- z.tl = cursor.tail.tail
+ z.tl = cursor.tail.tail
}
}
}
@@ -110,23 +115,31 @@ final class ListBuffer[A] extends Buffer[A] {
}
/** Returns the length of this buffer.
+ *
+ * @return the length of this buffer.
*/
def length: int = start.length
- /** Returns the <code>n</code>th element of this list. This method
+ /** Returns the n-th element of this list. This method
* yields an error if the element does not exist.
+ *
+ * @param n the position of the element to be returned.
+ * @return the n-th element of this buffer.
+ * @throws IndexOutOfBoundsException
*/
def apply(n: Int): A = try {
start(n)
} catch {
- case ex: Exception => throw new IndexOutOfBoundsException(n.toString())
+ case ex: Exception =>
+ throw new IndexOutOfBoundsException(n.toString())
}
- /** Replace element at index <code>n</code> with the new element
+ /** Replaces element at index <code>n</code> with the new element
* <code>newelem</code>. Throws IndexOutOfBoundsException if
* n is out of bounds.
- * @param n the index of the element to replace.
- * @param x the new element.
+ *
+ * @param n the index of the element to replace.
+ * @param x the new element.
*/
def update(n: Int, x: A): unit = try {
if (exported) copy()
@@ -152,16 +165,17 @@ final class ListBuffer[A] extends Buffer[A] {
/** Inserts new elements at the index <code>n</code>. Opposed to method
* <code>update</code>, this method will not replace an element with a new
* one. Instead, it will insert a new element at index <code>n</code>.
- * Throws IndexOutOfBoundsException if n is out of bounds.
- * @param n the index where a new element will be inserted.
- * @param iter the iterable object providing all elements to insert.
+ *
+ * @param n the index where a new element will be inserted.
+ * @param iter the iterable object providing all elements to insert.
+ * @throws IndexOutOfBoundsException if <code>n</code> is out of bounds.
*/
def insertAll(n: Int, iter: Iterable[A]): unit = try {
if (exported) copy()
var elems = iter.elements.toList.reverse
if (n == 0) {
while (!elems.isEmpty) {
- val newElem = new scala.:: (elems.head, start);
+ val newElem = new scala.:: (elems.head, start)
if (start.isEmpty) last = newElem
start = newElem
elems = elems.tail
@@ -174,22 +188,24 @@ final class ListBuffer[A] extends Buffer[A] {
i = i + 1
}
while (!elems.isEmpty) {
- val newElem = new scala.:: (elems.head, cursor.tail);
+ val newElem = new scala.:: (elems.head, cursor.tail)
if (cursor.tail.isEmpty) last = newElem
cursor.asInstanceOf[scala.::[A]].tl = newElem
elems = elems.tail
}
}
} catch {
- case ex: Exception => throw new IndexOutOfBoundsException(n.toString())
+ case ex: Exception =>
+ throw new IndexOutOfBoundsException(n.toString())
}
/** Removes the element on a given index position.
*
- * @param n the index which refers to the element to delete.
- * @return n the element that was formerly at posiition `n'
- * @pre an element exists at position `n'
+ * @param n the index which refers to the element to delete.
+ * @return n the element that was formerly at position <code>n</code>.
+ * @pre an element exists at position <code>n</code>
+ * @throws IndexOutOfBoundsException if <code>n</code> is out of bounds.
*/
def remove(n: Int): A = try {
if (exported) copy()
@@ -209,13 +225,21 @@ final class ListBuffer[A] extends Buffer[A] {
}
old
} catch {
- case ex: Exception => throw new IndexOutOfBoundsException(n.toString())
+ case ex: Exception =>
+ throw new IndexOutOfBoundsException(n.toString())
}
- /** Returns an iterator over all elements of this list.
- * Note: the iterator can be affected by insertions, updates and deletions
- * that are performed afterwards on the buffer. To get iterator an over the current
- * buffer snapshot, use toList.elements
+ /** <p>
+ * Returns an iterator over all elements of this list.
+ * </p>
+ * <blockquote>
+ * Note: the iterator can be affected by insertions, updates and
+ * deletions that are performed afterwards on the buffer. To get
+ * iterator an over the current buffer snapshot, use
+ * <code>toList.elements</code>.
+ * </blockquote>
+ *
+ * @throws NoSuchElementException if buffer is empty
*/
override def elements = new Iterator[A] {
var cursor: List[A] = null
@@ -229,7 +253,7 @@ final class ListBuffer[A] extends Buffer[A] {
}
}
- /** Return a clone of this buffer.
+ /** Returns a clone of this buffer.
*
* @return a <code>ListBuffer</code> with the same elements.
*/
@@ -237,7 +261,8 @@ final class ListBuffer[A] extends Buffer[A] {
/** Checks if two buffers are structurally identical.
*
- * @return true, iff both buffers contain the same sequence of elements.
+ * @return <code>true</code>, iff both buffers contain the same sequence
+ * of elements.
*/
override def equals(obj: Any): Boolean = obj match {
case that: ListBuffer[A] =>
@@ -245,10 +270,13 @@ final class ListBuffer[A] extends Buffer[A] {
elements.zip(that.elements).forall {
case Pair(thiselem, thatelem) => thiselem == thatelem
})
- case _ => false
+ case _ =>
+ false
}
/** Defines the prefix of the string representation.
+ *
+ * @return the string representation of this buffer.
*/
override protected def stringPrefix: String = "ListBuffer"
}