Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
Collections:
Other Resources:
JDK 11 jdk.scripting.nashorn.jmod - Scripting Nashorn Module
JDK 11 jdk.scripting.nashorn.jmod is the JMOD file for JDK 11 Scripting Nashorn module.
JDK 11 Scripting Nashorn module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.scripting.nashorn.jmod.
JDK 11 Scripting Nashorn module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Scripting Nashorn module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.scripting.nashorn.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/nashorn/internal/runtime/arrays/LengthNotWritableFilter.java
/* * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.nashorn.internal.runtime.arrays; import java.util.Iterator; import java.util.List; import java.util.SortedMap; import java.util.TreeMap; import jdk.nashorn.internal.runtime.JSType; import jdk.nashorn.internal.runtime.ScriptRuntime; /** * Filter to use for ArrayData where the length is not writable. * The default behavior is just to ignore {@link ArrayData#setLength} */ final class LengthNotWritableFilter extends ArrayFilter { private final SortedMap<Long, Object> extraElements; //elements with index >= length /** * Constructor * @param underlying array */ LengthNotWritableFilter(final ArrayData underlying) { this(underlying, new TreeMap<Long, Object>()); } private LengthNotWritableFilter(final ArrayData underlying, final SortedMap<Long, Object> extraElements) { super(underlying); this.extraElements = extraElements; } @Override public ArrayData copy() { return new LengthNotWritableFilter(underlying.copy(), new TreeMap<>(extraElements)); } @Override public boolean has(final int index) { return super.has(index) || extraElements.containsKey((long)index); } /** * Set the length of the data array * * @param length the new length for the data array */ @Override public void setLength(final long length) { //empty - setting length for a LengthNotWritableFilter is always a nop } @Override public ArrayData ensure(final long index) { return this; } @Override public ArrayData slice(final long from, final long to) { //return array[from...to), or array[from...length] if undefined, in this case not as we are an ArrayData return new LengthNotWritableFilter(underlying.slice(from, to), extraElements.subMap(from, to)); } private boolean checkAdd(final long index, final Object value) { if (index >= length()) { extraElements.put(index, value); return true; } return false; } private Object get(final long index) { final Object obj = extraElements.get(index); if (obj == null) { return ScriptRuntime.UNDEFINED; } return obj; } @Override public int getInt(final int index) { if (index >= length()) { return JSType.toInt32(get(index)); } return underlying.getInt(index); } @Override public int getIntOptimistic(final int index, final int programPoint) { if (index >= length()) { return JSType.toInt32Optimistic(get(index), programPoint); } return underlying.getIntOptimistic(index, programPoint); } @Override public double getDouble(final int index) { if (index >= length()) { return JSType.toNumber(get(index)); } return underlying.getDouble(index); } @Override public double getDoubleOptimistic(final int index, final int programPoint) { if (index >= length()) { return JSType.toNumberOptimistic(get(index), programPoint); } return underlying.getDoubleOptimistic(index, programPoint); } @Override public Object getObject(final int index) { if (index >= length()) { return get(index); } return underlying.getObject(index); } @Override public ArrayData set(final int index, final Object value, final boolean strict) { if (checkAdd(index, value)) { return this; } underlying = underlying.set(index, value, strict); return this; } @Override public ArrayData set(final int index, final int value, final boolean strict) { if (checkAdd(index, value)) { return this; } underlying = underlying.set(index, value, strict); return this; } @Override public ArrayData set(final int index, final double value, final boolean strict) { if (checkAdd(index, value)) { return this; } underlying = underlying.set(index, value, strict); return this; } @Override public ArrayData delete(final int index) { extraElements.remove(ArrayIndex.toLongIndex(index)); underlying = underlying.delete(index); return this; } @Override public ArrayData delete(final long fromIndex, final long toIndex) { for (final Iterator<Long> iter = extraElements.keySet().iterator(); iter.hasNext();) { final long next = iter.next(); if (next >= fromIndex && next <= toIndex) { iter.remove(); } if (next > toIndex) { //ordering guaranteed because TreeSet break; } } underlying = underlying.delete(fromIndex, toIndex); return this; } @Override public Iterator<Long> indexIterator() { final List<Long> keys = computeIteratorKeys(); keys.addAll(extraElements.keySet()); //even if they are outside length this is fine return keys.iterator(); } }
⏎ jdk/nashorn/internal/runtime/arrays/LengthNotWritableFilter.java
Or download all of them as a single archive file:
File name: jdk.scripting.nashorn-11.0.1-src.zip File size: 1390965 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.scripting.nashorn.shell.jmod - Scripting Nashorn Shell Module
2020-04-25, 82990👍, 0💬
Popular Posts:
JRE 8 plugin.jar is the JAR file for JRE 8 Java Control Panel Plugin interface and tools. JRE (Java ...
Java Architecture for XML Binding (JAXB) is a Java API that allows Java developers to map Java class...
The Jakarta-ORO Java classes are a set of text-processing Java classes that provide Perl5 compatible...
Apache Log4j API provides the interface that applications should code to and provides the adapter co...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...