Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Rhino JavaScript Java Library Source Code
Rhino JavaScript Java Library is an open-source implementation of JavaScript
written entirely in Java.
Rhino JavaScript Java Library Source Code files are provided in binary package (rhino-1.7.14.zip).
You can also browse the source code below:
✍: FYIcenter.com
⏎ org/mozilla/javascript/NativeCollectionIterator.java
package org.mozilla.javascript;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Collections;
import java.util.Iterator;
public class NativeCollectionIterator extends ES6Iterator {
private static final long serialVersionUID = 7094840979404373443L;
private String className;
private Type type;
private transient Iterator<Hashtable.Entry> iterator = Collections.emptyIterator();
enum Type { KEYS, VALUES, BOTH }
static void init(ScriptableObject scope, String tag, boolean sealed) {
ES6Iterator.init(scope, sealed, new NativeCollectionIterator(tag), tag);
}
public NativeCollectionIterator(String tag)
{
this.className = tag;
this.iterator = Collections.emptyIterator();
this.type = Type.BOTH;
}
public NativeCollectionIterator(
Scriptable scope, String className,
Type type, Iterator<Hashtable.Entry> iterator)
{
super(scope, className);
this.className = className;
this.iterator = iterator;
this.type = type;
}
@Override
public String getClassName() {
return className;
}
@Override
protected boolean isDone(Context cx, Scriptable scope) {
return !iterator.hasNext();
}
@Override
protected Object nextValue(Context cx, Scriptable scope) {
final Hashtable.Entry e = iterator.next();
switch (type) {
case KEYS:
return e.key;
case VALUES:
return e.value;
case BOTH:
return cx.newArray(scope, new Object[] { e.key, e.value });
default:
throw new AssertionError();
}
}
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException
{
stream.defaultReadObject();
className = (String) stream.readObject();
type = (Type) stream.readObject();
iterator = Collections.emptyIterator();
}
private void writeObject(ObjectOutputStream stream)
throws IOException
{
stream.defaultWriteObject();
stream.writeObject(className);
stream.writeObject(type);
}
}
⏎ org/mozilla/javascript/NativeCollectionIterator.java
Or download all of them as a single archive file:
File name: rhino-1.7.14-sources.jar File size: 1029165 bytes Release date: 2022-01-06 Download
⇒ Example code to Test rhino-runtime-1.7.14.jar
⇐ Download Rhino JavaScript Binary Package
2022-05-03, ≈171🔥, 1💬
Popular Posts:
JDK 11 jdk.crypto.ec.jmod is the JMOD file for JDK 11 Crypto EC module. JDK 11 Crypto EC module comp...
jlGui is a music player for the Java platform. It is based on Java Sound 1.0 (i.e. JDK 1.3+). It sup...
layout.jar is a component in iText Java library to provide layout functionalities. iText Java librar...
How to download and install ojdbc7.jar for Oracle 12c R1? ojdbc8.jar for Oracle 12c R1 is a Java 7 a...
What Is jsse.jar (JDK 6) Java Secure Socket Extension? jsse.jar, Java Secure Socket Extension, is Ja...