mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-23 08:34:11 -08:00
Merge origin/master
This commit is contained in:
commit
bcbdb5e4f9
3
pom.xml
3
pom.xml
|
@ -66,7 +66,7 @@
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<sonatypeOssDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
|
<sonatypeOssDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
|
||||||
<html4j.version>1.0</html4j.version>
|
<html4j.version>1.1</html4j.version>
|
||||||
<jetty.version>9.2.1.v20140609</jetty.version>
|
<jetty.version>9.2.1.v20140609</jetty.version>
|
||||||
<slf4j.version>1.7.7</slf4j.version>
|
<slf4j.version>1.7.7</slf4j.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
@ -83,6 +83,7 @@
|
||||||
<module>teavm-cli</module>
|
<module>teavm-cli</module>
|
||||||
<module>teavm-chrome-rdp</module>
|
<module>teavm-chrome-rdp</module>
|
||||||
<module>teavm-tests</module>
|
<module>teavm-tests</module>
|
||||||
|
<module>teavm-extras-slf4j</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.teavm.debugging.javascript.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class ChromeRDPDebugger implements JavaScriptDebugger, ChromeRDPExchangeConsumer {
|
public class ChromeRDPDebugger implements JavaScriptDebugger, ChromeRDPExchangeConsumer {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ChromeRDPDebugger.class);
|
private static final Logger logger = LoggerFactory.getLogger(ChromeRDPDebugger.class);
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.chromerdp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public interface ChromeRDPExchange {
|
public interface ChromeRDPExchange {
|
||||||
void send(String message);
|
void send(String message);
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.chromerdp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public interface ChromeRDPExchangeConsumer {
|
public interface ChromeRDPExchangeConsumer {
|
||||||
void setExchange(ChromeRDPExchange exchange);
|
void setExchange(ChromeRDPExchange exchange);
|
||||||
|
|
|
@ -19,7 +19,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public interface ChromeRDPExchangeListener {
|
public interface ChromeRDPExchangeListener {
|
||||||
void received(String message) throws IOException;
|
void received(String message) throws IOException;
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.teavm.debugging.javascript.JavaScriptVariable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class RDPLocalVariable implements JavaScriptVariable {
|
public class RDPLocalVariable implements JavaScriptVariable {
|
||||||
private String name;
|
private String name;
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class RDPScope extends AbstractMap<String, RDPLocalVariable> {
|
public class RDPScope extends AbstractMap<String, RDPLocalVariable> {
|
||||||
private AtomicReference<Map<String, RDPLocalVariable>> backingMap = new AtomicReference<>();
|
private AtomicReference<Map<String, RDPLocalVariable>> backingMap = new AtomicReference<>();
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.teavm.debugging.javascript.JavaScriptVariable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class RDPValue implements JavaScriptValue {
|
public class RDPValue implements JavaScriptValue {
|
||||||
private AtomicReference<String> representation = new AtomicReference<>();
|
private AtomicReference<String> representation = new AtomicReference<>();
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class CallArgumentDTO {
|
public class CallArgumentDTO {
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class PropertyDescriptorDTO {
|
public class PropertyDescriptorDTO {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class RemoteObjectDTO {
|
public class RemoteObjectDTO {
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class ScopeDTO {
|
public class ScopeDTO {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.teavm.chromerdp.data.CallArgumentDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class CallFunctionCommand {
|
public class CallFunctionCommand {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.teavm.chromerdp.data.RemoteObjectDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class CallFunctionResponse {
|
public class CallFunctionResponse {
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class GetPropertiesCommand {
|
public class GetPropertiesCommand {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.teavm.chromerdp.data.PropertyDescriptorDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class GetPropertiesResponse {
|
public class GetPropertiesResponse {
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.teavm.platform.metadata.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class DeclaringClassMetadataGenerator implements ClassScopedMetadataGenerator {
|
public class DeclaringClassMetadataGenerator implements ClassScopedMetadataGenerator {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.teavm.classlib.impl.unicode.CLDRReader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class FirstDayOfWeekMetadataGenerator extends WeekMetadataGenerator {
|
public class FirstDayOfWeekMetadataGenerator extends WeekMetadataGenerator {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -24,7 +24,7 @@ import org.teavm.model.instructions.InvokeInstruction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class JavacSupport implements ClassHolderTransformer {
|
public class JavacSupport implements ClassHolderTransformer {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.teavm.classlib.impl.unicode.CLDRReader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class MinimalDaysInFirstWeekMetadataGenerator extends WeekMetadataGenerator {
|
public class MinimalDaysInFirstWeekMetadataGenerator extends WeekMetadataGenerator {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.teavm.model.ValueType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class ServiceLoaderSupport implements Generator, DependencyListener {
|
public class ServiceLoaderSupport implements Generator, DependencyListener {
|
||||||
private Set<String> achievedClasses = new HashSet<>();
|
private Set<String> achievedClasses = new HashSet<>();
|
||||||
|
@ -129,7 +129,7 @@ public class ServiceLoaderSupport implements Generator, DependencyListener {
|
||||||
method.getResult().propagate(agent.getType("[java.lang.Object"));
|
method.getResult().propagate(agent.getType("[java.lang.Object"));
|
||||||
allClassesNode.connect(method.getResult().getArrayItem());
|
allClassesNode.connect(method.getResult().getArrayItem());
|
||||||
method.getResult().getArrayItem().addConsumer(new DependencyConsumer() {
|
method.getResult().getArrayItem().addConsumer(new DependencyConsumer() {
|
||||||
@Override public void consume(DependencyAgentType type) {
|
@Override public void consume(DependencyType type) {
|
||||||
initConstructor(agent, type.getName(), location);
|
initConstructor(agent, type.getName(), location);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.teavm.platform.metadata.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public abstract class WeekMetadataGenerator implements MetadataGenerator {
|
public abstract class WeekMetadataGenerator implements MetadataGenerator {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class JCLClass {
|
class JCLClass {
|
||||||
public final String name;
|
public final String name;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.impl.report;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class JCLItem {
|
class JCLItem {
|
||||||
public final JCLItemType type;
|
public final JCLItemType type;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.impl.report;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
enum JCLItemType {
|
enum JCLItemType {
|
||||||
FIELD,
|
FIELD,
|
||||||
|
|
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class JCLPackage {
|
class JCLPackage {
|
||||||
public final String name;
|
public final String name;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.impl.report;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
enum JCLStatus {
|
enum JCLStatus {
|
||||||
FOUND,
|
FOUND,
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.teavm.platform.metadata.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class AvailableLocalesMetadataGenerator implements MetadataGenerator {
|
public class AvailableLocalesMetadataGenerator implements MetadataGenerator {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.teavm.platform.metadata.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class CLDRHelper {
|
public class CLDRHelper {
|
||||||
public static String getCode(String language, String country) {
|
public static String getCode(String language, String country) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.teavm.platform.metadata.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class LikelySubtagsMetadataGenerator implements MetadataGenerator {
|
public class LikelySubtagsMetadataGenerator implements MetadataGenerator {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.teavm.classlib.java.lang.TString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public interface TDataInput {
|
public interface TDataInput {
|
||||||
void readFully(byte[] b) throws TIOException;
|
void readFully(byte[] b) throws TIOException;
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.teavm.classlib.java.lang.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TDataInputStream extends TFilterInputStream implements TDataInput {
|
public class TDataInputStream extends TFilterInputStream implements TDataInput {
|
||||||
byte[] buff;
|
byte[] buff;
|
||||||
|
|
|
@ -1,113 +1,49 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, Codename One and/or its affiliates. All rights reserved.
|
* Copyright 2015 Alexey Andreev.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
* you may not use this file except in compliance with the License.
|
||||||
* published by the Free Software Foundation. Codename One designates this
|
* You may obtain a copy of the License at
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
*
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
* See the License for the specific language governing permissions and
|
||||||
* accompanied this code).
|
* limitations under the License.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Codename One through http://www.codenameone.com/ if you
|
|
||||||
* need additional information or have any questions.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.teavm.classlib.java.io;
|
package org.teavm.classlib.java.io;
|
||||||
import org.teavm.classlib.java.lang.*;
|
|
||||||
/**
|
import org.teavm.classlib.java.lang.TString;
|
||||||
* The DataOutput interface provides for converting data from any of the Java primitive types to a series of bytes and writing these bytes to a binary stream. There is also a facility for converting a String into Java modified UTF-8 format and writing the resulting series of bytes.
|
|
||||||
* For all the methods in this interface that write bytes, it is generally true that if a byte cannot be written for any reason, an IOException is thrown.
|
|
||||||
* Since: JDK1.0, CLDC 1.0 See Also:DataInput, DataOutputStream
|
|
||||||
*/
|
|
||||||
public interface TDataOutput{
|
public interface TDataOutput{
|
||||||
/**
|
void write(int b) throws TIOException;
|
||||||
* Writes to the output stream all the bytes in array b. If b is null, a NullPointerException is thrown. If b.length is zero, then no bytes are written. Otherwise, the byte b[0] is written first, then b[1], and so on; the last byte written is b[b.length-1].
|
|
||||||
*/
|
|
||||||
public abstract void write(byte[] b) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void write(byte[] b) throws TIOException;
|
||||||
* Writes len bytes from array b, in order, to the output stream. If b is null, a NullPointerException is thrown. If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown. If len is zero, then no bytes are written. Otherwise, the byte b[off] is written first, then b[off+1], and so on; the last byte written is b[off+len-1].
|
|
||||||
*/
|
|
||||||
public abstract void write(byte[] b, int off, int len) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void write(byte[] b, int off, int len) throws TIOException;
|
||||||
* Writes to the output stream the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.
|
|
||||||
*/
|
|
||||||
public abstract void write(int b) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void writeBoolean(boolean v) throws TIOException;
|
||||||
* Writes a boolean value to this output stream. If the argument v is true, the value (byte)1 is written; if v is false, the value (byte)0 is written. The byte written by this method may be read by the readBoolean method of interface DataInput, which will then return a boolean equal to v.
|
|
||||||
*/
|
|
||||||
public abstract void writeBoolean(boolean v) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void writeByte(int v) throws TIOException;
|
||||||
* Writes to the output stream the eight low- order bits of the argument v. The 24 high-order bits of v are ignored. (This means that writeByte does exactly the same thing as write for an integer argument.) The byte written by this method may be read by the readByte method of interface DataInput, which will then return a byte equal to (byte)v.
|
|
||||||
*/
|
|
||||||
public abstract void writeByte(int v) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void writeShort(int v) throws TIOException;
|
||||||
* Writes a char value, which is comprised of two bytes, to the output stream. The byte values to be written, in the order shown, are:
|
|
||||||
* (byte)(0xff (v 8)) (byte)(0xff v)
|
|
||||||
* The bytes written by this method may be read by the readChar method of interface DataInput, which will then return a char equal to (char)v.
|
|
||||||
*/
|
|
||||||
public abstract void writeChar(int v) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void writeChar(int v) throws TIOException;
|
||||||
* Writes every character in the string s, to the output stream, in order, two bytes per character. If s is null, a NullPointerException is thrown. If s.length is zero, then no characters are written. Otherwise, the character s[0] is written first, then s[1], and so on; the last character written is s[s.length-1]. For each character, two bytes are actually written, high-order byte first, in exactly the manner of the writeChar method.
|
|
||||||
*/
|
|
||||||
public abstract void writeChars(TString s) throws java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
void writeInt(int v) throws TIOException;
|
||||||
* Writes a double value, which is comprised of eight bytes, to the output stream. It does this as if it first converts this double value to a long in exactly the manner of the Double.doubleToLongBits method and then writes the long value in exactly the manner of the writeLong method. The bytes written by this method may be read by the readDouble method of interface DataInput, which will then return a double equal to v.
|
|
||||||
*/
|
|
||||||
public abstract void writeDouble(double v) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void writeLong(long v) throws TIOException;
|
||||||
* Writes a float value, which is comprised of four bytes, to the output stream. It does this as if it first converts this float value to an int in exactly the manner of the Float.floatToIntBits method and then writes the int value in exactly the manner of the writeInt method. The bytes written by this method may be read by the readFloat method of interface DataInput, which will then return a float equal to v.
|
|
||||||
*/
|
|
||||||
public abstract void writeFloat(float v) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void writeFloat(float v) throws TIOException;
|
||||||
* Writes an int value, which is comprised of four bytes, to the output stream. The byte values to be written, in the order shown, are:
|
|
||||||
* (byte)(0xff (v 24)) (byte)(0xff (v 16)) (byte)(0xff (v 8)) (byte)(0xff v)
|
|
||||||
* The bytes written by this method may be read by the readInt method of interface DataInput, which will then return an int equal to v.
|
|
||||||
*/
|
|
||||||
public abstract void writeInt(int v) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void writeDouble(double v) throws TIOException;
|
||||||
* Writes an long value, which is comprised of four bytes, to the output stream. The byte values to be written, in the order shown, are:
|
|
||||||
* (byte)(0xff (v 56)) (byte)(0xff (v 48)) (byte)(0xff (v 40)) (byte)(0xff (v 32)) (byte)(0xff (v 24)) (byte)(0xff (v 16)) (byte)(0xff (v 8)) (byte)(0xff v)
|
|
||||||
* The bytes written by this method may be read by the readLong method of interface DataInput, which will then return a long equal to v.
|
|
||||||
*/
|
|
||||||
public abstract void writeLong(long v) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void writeBytes(TString s) throws TIOException;
|
||||||
* Writes two bytes to the output stream to represent the value of the argument. The byte values to be written, in the order shown, are:
|
|
||||||
* (byte)(0xff (v 8)) (byte)(0xff v)
|
|
||||||
* The bytes written by this method may be read by the readShort method of interface DataInput, which will then return a short equal to (short)v.
|
|
||||||
*/
|
|
||||||
public abstract void writeShort(int v) throws TIOException;
|
|
||||||
|
|
||||||
/**
|
void writeChars(TString s) throws TIOException;
|
||||||
* Writes two bytes of length information to the output stream, followed by the Java modified UTF representation of every character in the string s. If s is null, a NullPointerException is thrown. Each character in the string s is converted to a group of one, two, or three bytes, depending on the value of the character.
|
|
||||||
* If a character c is in the range u0001 through u007f, it is represented by one byte:
|
|
||||||
* (byte)c
|
|
||||||
* If a character c is u0000 or is in the range u0080 through u07ff, then it is represented by two bytes, to be written in the order shown:
|
|
||||||
* (byte)(0xc0 | (0x1f (c 6))) (byte)(0x80 | (0x3f c))
|
|
||||||
* If a character c is in the range u0800 through uffff, then it is represented by three bytes, to be written in the order shown:
|
|
||||||
* (byte)(0xe0 | (0x0f (c 12))) (byte)(0x80 | (0x3f (c 6))) (byte)(0x80 | (0x3f c))
|
|
||||||
* First, the total number of bytes needed to represent all the characters of s is calculated. If this number is larger than 65535, then a UTFDataFormatError is thrown. Otherwise, this length is written to the output stream in exactly the manner of the writeShort method; after this, the one-, two-, or three-byte representation of each character in the string s is written.
|
|
||||||
* The bytes written by this method may be read by the readUTF method of interface DataInput, which will then return a String equal to s.
|
|
||||||
*/
|
|
||||||
public abstract void writeUTF(TString s) throws TIOException;
|
|
||||||
|
|
||||||
|
void writeUTF(TString s) throws TIOException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,6 @@
|
||||||
package org.teavm.classlib.java.io;
|
package org.teavm.classlib.java.io;
|
||||||
import org.teavm.classlib.java.lang.*;
|
import org.teavm.classlib.java.lang.*;
|
||||||
|
|
||||||
/**
|
|
||||||
* A data output stream lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in.
|
|
||||||
* Since: JDK1.0, CLDC 1.0 See Also:DataInputStream
|
|
||||||
*/
|
|
||||||
public class TDataOutputStream extends TFilterOutputStream implements TDataOutput{
|
public class TDataOutputStream extends TFilterOutputStream implements TDataOutput{
|
||||||
/**
|
/**
|
||||||
* The number of bytes written out so far.
|
* The number of bytes written out so far.
|
||||||
|
@ -29,37 +25,16 @@ public class TDataOutputStream extends TFilterOutputStream implements TDataOutpu
|
||||||
protected int written;
|
protected int written;
|
||||||
byte buff[];
|
byte buff[];
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code DataOutputStream} on the {@code OutputStream}
|
|
||||||
* {@code out}. Note that data written by this stream is not in a human
|
|
||||||
* readable form but can be reconstructed by using a {@link DataInputStream}
|
|
||||||
* on the resulting output.
|
|
||||||
*
|
|
||||||
* @param out
|
|
||||||
* the target stream for writing.
|
|
||||||
*/
|
|
||||||
public TDataOutputStream(TOutputStream out) {
|
public TDataOutputStream(TOutputStream out) {
|
||||||
super(out);
|
super(out);
|
||||||
buff = new byte[8];
|
buff = new byte[8];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Flushes this stream to ensure all pending data is sent out to the target
|
|
||||||
* stream. This implementation then also flushes the target stream.
|
|
||||||
*
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs attempting to flush this stream.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void flush() throws TIOException {
|
public void flush() throws TIOException {
|
||||||
super.flush();
|
super.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the total number of bytes written to the target stream so far.
|
|
||||||
*
|
|
||||||
* @return the number of bytes written to the target stream.
|
|
||||||
*/
|
|
||||||
public final int size() {
|
public final int size() {
|
||||||
if (written < 0) {
|
if (written < 0) {
|
||||||
written = TInteger.MAX_VALUE;
|
written = TInteger.MAX_VALUE;
|
||||||
|
@ -67,23 +42,6 @@ public class TDataOutputStream extends TFilterOutputStream implements TDataOutpu
|
||||||
return written;
|
return written;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes {@code count} bytes from the byte array {@code buffer} starting at
|
|
||||||
* {@code offset} to the target stream.
|
|
||||||
*
|
|
||||||
* @param buffer
|
|
||||||
* the buffer to write to the target stream.
|
|
||||||
* @param offset
|
|
||||||
* the index of the first byte in {@code buffer} to write.
|
|
||||||
* @param count
|
|
||||||
* the number of bytes from the {@code buffer} to write.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @throws NullPointerException
|
|
||||||
* if {@code buffer} is {@code null}.
|
|
||||||
* @see DataInputStream#readFully(byte[])
|
|
||||||
* @see DataInputStream#readFully(byte[], int, int)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void write(byte buffer[], int offset, int count) throws TIOException {
|
public void write(byte buffer[], int offset, int count) throws TIOException {
|
||||||
if (buffer == null) {
|
if (buffer == null) {
|
||||||
|
@ -93,64 +51,25 @@ public class TDataOutputStream extends TFilterOutputStream implements TDataOutpu
|
||||||
written += count;
|
written += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes a byte to the target stream. Only the least significant byte of
|
|
||||||
* the integer {@code oneByte} is written.
|
|
||||||
*
|
|
||||||
* @param oneByte
|
|
||||||
* the byte to write to the target stream.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readByte()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void write(int oneByte) throws TIOException {
|
public void write(int oneByte) throws TIOException {
|
||||||
out.write(oneByte);
|
out.write(oneByte);
|
||||||
written++;
|
written++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes a boolean to the target stream.
|
|
||||||
*
|
|
||||||
* @param val
|
|
||||||
* the boolean value to write to the target stream.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readBoolean()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final void writeBoolean(boolean val) throws TIOException {
|
public final void writeBoolean(boolean val) throws TIOException {
|
||||||
out.write(val ? 1 : 0);
|
out.write(val ? 1 : 0);
|
||||||
written++;
|
written++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes an 8-bit byte to the target stream. Only the least significant
|
|
||||||
* byte of the integer {@code val} is written.
|
|
||||||
*
|
|
||||||
* @param val
|
|
||||||
* the byte value to write to the target stream.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readByte()
|
|
||||||
* @see DataInputStream#readUnsignedByte()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final void writeByte(int val) throws TIOException {
|
public final void writeByte(int val) throws TIOException {
|
||||||
out.write(val);
|
out.write(val);
|
||||||
written++;
|
written++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Writes the low order bytes from a string to the target stream.
|
|
||||||
*
|
|
||||||
* @param str
|
|
||||||
* the string containing the bytes to write to the target stream.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readFully(byte[])
|
|
||||||
* @see DataInputStream#readFully(byte[],int,int)
|
|
||||||
*/
|
|
||||||
public final void writeBytes(TString str) throws TIOException {
|
public final void writeBytes(TString str) throws TIOException {
|
||||||
if (str.length() == 0) {
|
if (str.length() == 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -163,17 +82,6 @@ public class TDataOutputStream extends TFilterOutputStream implements TDataOutpu
|
||||||
written += bytes.length;
|
written += bytes.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes a 16-bit character to the target stream. Only the two lower bytes
|
|
||||||
* of the integer {@code val} are written, with the higher one written
|
|
||||||
* first. This corresponds to the Unicode value of {@code val}.
|
|
||||||
*
|
|
||||||
* @param val
|
|
||||||
* the character to write to the target stream
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readChar()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final void writeChar(int val) throws TIOException {
|
public final void writeChar(int val) throws TIOException {
|
||||||
buff[0] = (byte) (val >> 8);
|
buff[0] = (byte) (val >> 8);
|
||||||
|
@ -182,17 +90,6 @@ public class TDataOutputStream extends TFilterOutputStream implements TDataOutpu
|
||||||
written += 2;
|
written += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes the 16-bit characters contained in {@code str} to the target
|
|
||||||
* stream.
|
|
||||||
*
|
|
||||||
* @param str
|
|
||||||
* the string that contains the characters to write to this
|
|
||||||
* stream.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readChar()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final void writeChars(TString str) throws TIOException {
|
public final void writeChars(TString str) throws TIOException {
|
||||||
byte newBytes[] = new byte[str.length() * 2];
|
byte newBytes[] = new byte[str.length() * 2];
|
||||||
|
@ -205,46 +102,16 @@ public class TDataOutputStream extends TFilterOutputStream implements TDataOutpu
|
||||||
written += newBytes.length;
|
written += newBytes.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes a 64-bit double to the target stream. The resulting output is the
|
|
||||||
* eight bytes resulting from calling Double.doubleToLongBits().
|
|
||||||
*
|
|
||||||
* @param val
|
|
||||||
* the double to write to the target stream.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readDouble()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final void writeDouble(double val) throws TIOException {
|
public final void writeDouble(double val) throws TIOException {
|
||||||
writeLong(TDouble.doubleToLongBits(val));
|
writeLong(TDouble.doubleToLongBits(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes a 32-bit float to the target stream. The resulting output is the
|
|
||||||
* four bytes resulting from calling Float.floatToIntBits().
|
|
||||||
*
|
|
||||||
* @param val
|
|
||||||
* the float to write to the target stream.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readFloat()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final void writeFloat(float val) throws TIOException {
|
public final void writeFloat(float val) throws TIOException {
|
||||||
writeInt(TFloat.floatToIntBits(val));
|
writeInt(TFloat.floatToIntBits(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes a 32-bit int to the target stream. The resulting output is the
|
|
||||||
* four bytes, highest order first, of {@code val}.
|
|
||||||
*
|
|
||||||
* @param val
|
|
||||||
* the int to write to the target stream.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readInt()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final void writeInt(int val) throws TIOException {
|
public final void writeInt(int val) throws TIOException {
|
||||||
buff[0] = (byte) (val >> 24);
|
buff[0] = (byte) (val >> 24);
|
||||||
|
@ -255,16 +122,6 @@ public class TDataOutputStream extends TFilterOutputStream implements TDataOutpu
|
||||||
written += 4;
|
written += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes a 64-bit long to the target stream. The resulting output is the
|
|
||||||
* eight bytes, highest order first, of {@code val}.
|
|
||||||
*
|
|
||||||
* @param val
|
|
||||||
* the long to write to the target stream.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readLong()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final void writeLong(long val) throws TIOException {
|
public final void writeLong(long val) throws TIOException {
|
||||||
buff[0] = (byte) (val >> 56);
|
buff[0] = (byte) (val >> 56);
|
||||||
|
@ -292,18 +149,6 @@ public class TDataOutputStream extends TFilterOutputStream implements TDataOutpu
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes the specified 16-bit short to the target stream. Only the lower
|
|
||||||
* two bytes of the integer {@code val} are written, with the higher one
|
|
||||||
* written first.
|
|
||||||
*
|
|
||||||
* @param val
|
|
||||||
* the short to write to the target stream.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @see DataInputStream#readShort()
|
|
||||||
* @see DataInputStream#readUnsignedShort()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final void writeShort(int val) throws TIOException {
|
public final void writeShort(int val) throws TIOException {
|
||||||
buff[0] = (byte) (val >> 8);
|
buff[0] = (byte) (val >> 8);
|
||||||
|
@ -319,19 +164,6 @@ public class TDataOutputStream extends TFilterOutputStream implements TDataOutpu
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes the specified encoded in {@link DataInput modified UTF-8} to this
|
|
||||||
* stream.
|
|
||||||
*
|
|
||||||
* @param str
|
|
||||||
* the string to write to the target stream encoded in
|
|
||||||
* {@link DataInput modified UTF-8}.
|
|
||||||
* @throws IOException
|
|
||||||
* if an error occurs while writing to the target stream.
|
|
||||||
* @throws UTFDataFormatException
|
|
||||||
* if the encoded string is longer than 65535 bytes.
|
|
||||||
* @see DataInputStream#readUTF()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final void writeUTF(TString str) throws TIOException {
|
public final void writeUTF(TString str) throws TIOException {
|
||||||
long utfCount = countUTFBytes(str);
|
long utfCount = countUTFBytes(str);
|
||||||
|
@ -377,5 +209,4 @@ public class TDataOutputStream extends TFilterOutputStream implements TDataOutpu
|
||||||
}
|
}
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public abstract class TInputStream extends TObject implements TCloseable {
|
||||||
for (int i = 0; i < len; ++i) {
|
for (int i = 0; i < len; ++i) {
|
||||||
int bt = read();
|
int bt = read();
|
||||||
if (bt < 0) {
|
if (bt < 0) {
|
||||||
return i;
|
return i == 0 ? -1 : i;
|
||||||
}
|
}
|
||||||
b[off++] = (byte)bt;
|
b[off++] = (byte)bt;
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,6 +166,11 @@ public class TPrintStream extends TFilterOutputStream {
|
||||||
printSB();
|
printSB();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void println(double d) {
|
||||||
|
sb.append(d).append('\n');
|
||||||
|
printSB();
|
||||||
|
}
|
||||||
|
|
||||||
public void print(TString s) {
|
public void print(TString s) {
|
||||||
sb.append(s);
|
sb.append(s);
|
||||||
printSB();
|
printSB();
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.teavm.classlib.java.lang.TString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TPushbackInputStream extends TFilterInputStream {
|
public class TPushbackInputStream extends TFilterInputStream {
|
||||||
protected byte[] buf;
|
protected byte[] buf;
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.teavm.classlib.java.lang.TString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TUTFDataFormatException extends TIOException {
|
public class TUTFDataFormatException extends TIOException {
|
||||||
private static final long serialVersionUID = -6383472574962319733L;
|
private static final long serialVersionUID = -6383472574962319733L;
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.teavm.model.MethodReference;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class LongNativeGenerator implements Generator {
|
public class LongNativeGenerator implements Generator {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TArrayIndexOutOfBoundsException extends TIndexOutOfBoundsException {
|
public class TArrayIndexOutOfBoundsException extends TIndexOutOfBoundsException {
|
||||||
private static final long serialVersionUID = 5221353436321708950L;
|
private static final long serialVersionUID = 5221353436321708950L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TArrayStoreException extends TRuntimeException {
|
public class TArrayStoreException extends TRuntimeException {
|
||||||
private static final long serialVersionUID = 3911921304974631232L;
|
private static final long serialVersionUID = 3911921304974631232L;
|
||||||
|
|
|
@ -23,7 +23,8 @@ import org.teavm.platform.metadata.ClassScopedMetadataProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
|
* @param <T> class type.
|
||||||
*/
|
*/
|
||||||
public class TClass<T> extends TObject {
|
public class TClass<T> extends TObject {
|
||||||
TString name;
|
TString name;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public abstract class TClassLoader extends TObject {
|
public abstract class TClassLoader extends TObject {
|
||||||
private TClassLoader parent;
|
private TClassLoader parent;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TClassNotFoundException extends TReflectiveOperationException {
|
public class TClassNotFoundException extends TReflectiveOperationException {
|
||||||
private static final long serialVersionUID = -1162632869775788325L;
|
private static final long serialVersionUID = -1162632869775788325L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TCloneNotSupportedException extends TException {
|
public class TCloneNotSupportedException extends TException {
|
||||||
private static final long serialVersionUID = 4908200987785128012L;
|
private static final long serialVersionUID = 4908200987785128012L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public interface TCloneable {
|
public interface TCloneable {
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ package org.teavm.classlib.java.lang;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev
|
* @author Alexey Andreev
|
||||||
|
* @param <T> type this object is comparable to.
|
||||||
*/
|
*/
|
||||||
public interface TComparable<T> {
|
public interface TComparable<T> {
|
||||||
int compareTo(T other);
|
int compareTo(T other);
|
||||||
|
|
|
@ -20,7 +20,8 @@ import org.teavm.javascript.spi.Rename;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
|
* @param <E> type of enum.
|
||||||
*/
|
*/
|
||||||
public abstract class TEnum<E extends TEnum<E>> extends TObject implements TComparable<E>, TSerializable {
|
public abstract class TEnum<E extends TEnum<E>> extends TObject implements TComparable<E>, TSerializable {
|
||||||
private TString name;
|
private TString name;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TIllegalAccessException extends ReflectiveOperationException {
|
public class TIllegalAccessException extends ReflectiveOperationException {
|
||||||
private static final long serialVersionUID = 8240407889170934565L;
|
private static final long serialVersionUID = 8240407889170934565L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TIllegalMonitorStateException extends TRuntimeException {
|
public class TIllegalMonitorStateException extends TRuntimeException {
|
||||||
private static final long serialVersionUID = 7694307746228488658L;
|
private static final long serialVersionUID = 7694307746228488658L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TIncompatibleClassChangeError extends TLinkageError {
|
public class TIncompatibleClassChangeError extends TLinkageError {
|
||||||
private static final long serialVersionUID = 366119408566298082L;
|
private static final long serialVersionUID = 366119408566298082L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TInstantiationException extends ReflectiveOperationException {
|
public class TInstantiationException extends ReflectiveOperationException {
|
||||||
private static final long serialVersionUID = 8771605296206833516L;
|
private static final long serialVersionUID = 8771605296206833516L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TInterruptedException extends Exception {
|
public class TInterruptedException extends Exception {
|
||||||
private static final long serialVersionUID = -7832805114281254695L;
|
private static final long serialVersionUID = -7832805114281254695L;
|
||||||
|
|
|
@ -19,7 +19,8 @@ import org.teavm.classlib.java.util.TIterator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
|
* @param <T> type this collection returns.
|
||||||
*/
|
*/
|
||||||
public interface TIterable<T> {
|
public interface TIterable<T> {
|
||||||
TIterator<T> iterator();
|
TIterator<T> iterator();
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TLinkageError extends TError {
|
public class TLinkageError extends TError {
|
||||||
private static final long serialVersionUID = 9176544705010852435L;
|
private static final long serialVersionUID = 9176544705010852435L;
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.teavm.javascript.spi.GeneratedBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TLong extends TNumber implements TComparable<TLong> {
|
public class TLong extends TNumber implements TComparable<TLong> {
|
||||||
public static final long MIN_VALUE = -0x8000000000000000L;
|
public static final long MIN_VALUE = -0x8000000000000000L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TNegativeArraySizeException extends TRuntimeException {
|
public class TNegativeArraySizeException extends TRuntimeException {
|
||||||
private static final long serialVersionUID = 4838944281468611671L;
|
private static final long serialVersionUID = 4838944281468611671L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TNoSuchFieldError extends TIncompatibleClassChangeError {
|
public class TNoSuchFieldError extends TIncompatibleClassChangeError {
|
||||||
private static final long serialVersionUID = 7907885242472547035L;
|
private static final long serialVersionUID = 7907885242472547035L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TNoSuchMethodError extends TIncompatibleClassChangeError {
|
public class TNoSuchMethodError extends TIncompatibleClassChangeError {
|
||||||
private static final long serialVersionUID = 7907885242472547035L;
|
private static final long serialVersionUID = 7907885242472547035L;
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.teavm.platform.async.AsyncCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
@Superclass("")
|
@Superclass("")
|
||||||
public class TObject {
|
public class TObject {
|
||||||
|
@ -72,10 +72,7 @@ public class TObject {
|
||||||
monitorEnter(o, 1);
|
monitorEnter(o, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Async
|
static void monitorEnter(TObject o, int count) {
|
||||||
static native void monitorEnter(TObject o, int count);
|
|
||||||
|
|
||||||
static void monitorEnter(final TObject o, final int count, final AsyncCallback<Void> callback) {
|
|
||||||
if (o.monitor == null) {
|
if (o.monitor == null) {
|
||||||
o.monitor = new Monitor();
|
o.monitor = new Monitor();
|
||||||
}
|
}
|
||||||
|
@ -83,21 +80,40 @@ public class TObject {
|
||||||
o.monitor.owner = TThread.currentThread();
|
o.monitor.owner = TThread.currentThread();
|
||||||
}
|
}
|
||||||
if (o.monitor.owner != TThread.currentThread()) {
|
if (o.monitor.owner != TThread.currentThread()) {
|
||||||
final TThread thread = TThread.currentThread();
|
monitorEnterWait(o, count);
|
||||||
o.monitor.enteringThreads.add(new PlatformRunnable() {
|
|
||||||
@Override public void run() {
|
|
||||||
TThread.setCurrentThread(thread);
|
|
||||||
o.monitor.owner = thread;
|
|
||||||
o.monitor.count += count;
|
|
||||||
callback.complete(null);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
o.monitor.count += count;
|
o.monitor.count += count;
|
||||||
callback.complete(null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
static native void monitorEnterWait(TObject o, int count);
|
||||||
|
|
||||||
|
static void monitorEnterWait(final TObject o, final int count, final AsyncCallback<Void> callback) {
|
||||||
|
final TThread thread = TThread.currentThread();
|
||||||
|
if (o.monitor == null) {
|
||||||
|
o.monitor = new Monitor();
|
||||||
|
TThread.setCurrentThread(thread);
|
||||||
|
o.monitor.count += count;
|
||||||
|
callback.complete(null);
|
||||||
|
return;
|
||||||
|
} else if (o.monitor.owner == null) {
|
||||||
|
o.monitor.owner = thread;
|
||||||
|
TThread.setCurrentThread(thread);
|
||||||
|
o.monitor.count += count;
|
||||||
|
callback.complete(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
o.monitor.enteringThreads.add(new PlatformRunnable() {
|
||||||
|
@Override public void run() {
|
||||||
|
TThread.setCurrentThread(thread);
|
||||||
|
o.monitor.owner = thread;
|
||||||
|
o.monitor.count += count;
|
||||||
|
callback.complete(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Sync
|
@Sync
|
||||||
static void monitorExit(final TObject o) {
|
static void monitorExit(final TObject o) {
|
||||||
monitorExit(o, 1);
|
monitorExit(o, 1);
|
||||||
|
@ -115,7 +131,7 @@ public class TObject {
|
||||||
|
|
||||||
o.monitor.owner = null;
|
o.monitor.owner = null;
|
||||||
if (!o.monitor.enteringThreads.isEmpty()) {
|
if (!o.monitor.enteringThreads.isEmpty()) {
|
||||||
Platform.startThread(new PlatformRunnable() {
|
Platform.postpone(new PlatformRunnable() {
|
||||||
@Override public void run() {
|
@Override public void run() {
|
||||||
if (o.isEmptyMonitor() || o.monitor.owner != null) {
|
if (o.isEmptyMonitor() || o.monitor.owner != null) {
|
||||||
return;
|
return;
|
||||||
|
@ -196,16 +212,14 @@ public class TObject {
|
||||||
if (!holdsLock(this)) {
|
if (!holdsLock(this)) {
|
||||||
throw new TIllegalMonitorStateException();
|
throw new TIllegalMonitorStateException();
|
||||||
}
|
}
|
||||||
TThread thread = TThread.currentThread();
|
|
||||||
PlatformQueue<NotifyListener> listeners = monitor.notifyListeners;
|
PlatformQueue<NotifyListener> listeners = monitor.notifyListeners;
|
||||||
while (!listeners.isEmpty()) {
|
while (!listeners.isEmpty()) {
|
||||||
NotifyListener listener = listeners.remove();
|
NotifyListener listener = listeners.remove();
|
||||||
if (!listener.expired()) {
|
if (!listener.expired()) {
|
||||||
Platform.startThread(listener);
|
Platform.postpone(listener);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TThread.setCurrentThread(thread);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Sync
|
@Sync
|
||||||
|
@ -218,7 +232,7 @@ public class TObject {
|
||||||
while (!listeners.isEmpty()) {
|
while (!listeners.isEmpty()) {
|
||||||
NotifyListener listener = listeners.remove();
|
NotifyListener listener = listeners.remove();
|
||||||
if (!listener.expired()) {
|
if (!listener.expired()) {
|
||||||
Platform.startThread(listener);
|
Platform.postpone(listener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,15 +246,18 @@ public class TObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Async
|
|
||||||
@Rename("wait")
|
@Rename("wait")
|
||||||
private native final void wait0(long timeout, int nanos) throws TInterruptedException;
|
private final void wait0(long timeout, int nanos) throws TInterruptedException {
|
||||||
|
|
||||||
@Rename("wait")
|
|
||||||
public final void wait0(long timeout, int nanos, final AsyncCallback<Void> callback) {
|
|
||||||
if (!holdsLock(this)) {
|
if (!holdsLock(this)) {
|
||||||
throw new TIllegalMonitorStateException();
|
throw new TIllegalMonitorStateException();
|
||||||
}
|
}
|
||||||
|
waitImpl(timeout, nanos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
private native final void waitImpl(long timeout, int nanos) throws TInterruptedException;
|
||||||
|
|
||||||
|
public final void waitImpl(long timeout, int nanos, final AsyncCallback<Void> callback) {
|
||||||
final NotifyListenerImpl listener = new NotifyListenerImpl(this, callback, monitor.count);
|
final NotifyListenerImpl listener = new NotifyListenerImpl(this, callback, monitor.count);
|
||||||
monitor.notifyListeners.add(listener);
|
monitor.notifyListeners.add(listener);
|
||||||
if (timeout > 0 || nanos > 0) {
|
if (timeout > 0 || nanos > 0) {
|
||||||
|
@ -256,6 +273,7 @@ public class TObject {
|
||||||
final TThread currentThread = TThread.currentThread();
|
final TThread currentThread = TThread.currentThread();
|
||||||
int timerId = -1;
|
int timerId = -1;
|
||||||
boolean expired;
|
boolean expired;
|
||||||
|
boolean performed;
|
||||||
int lockCount;
|
int lockCount;
|
||||||
|
|
||||||
public NotifyListenerImpl(TObject obj, AsyncCallback<Void> callback, int lockCount) {
|
public NotifyListenerImpl(TObject obj, AsyncCallback<Void> callback, int lockCount) {
|
||||||
|
@ -274,18 +292,22 @@ public class TObject {
|
||||||
@Override
|
@Override
|
||||||
public void onTimer() {
|
public void onTimer() {
|
||||||
if (!expired()) {
|
if (!expired()) {
|
||||||
Platform.startThread(this);
|
run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (performed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
performed = true;
|
||||||
if (timerId >= 0) {
|
if (timerId >= 0) {
|
||||||
Platform.killSchedule(timerId);
|
Platform.killSchedule(timerId);
|
||||||
timerId = -1;
|
timerId = -1;
|
||||||
}
|
}
|
||||||
TThread.setCurrentThread(currentThread);
|
TThread.setCurrentThread(currentThread);
|
||||||
monitorEnter(obj, lockCount, callback);
|
monitorEnterWait(obj, lockCount, callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2015 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev
|
||||||
|
*/
|
||||||
|
public class TOutOfMemoryError extends TVirtualMachineError {
|
||||||
|
private static final long serialVersionUID = -1891949851728458692L;
|
||||||
|
|
||||||
|
public TOutOfMemoryError() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TOutOfMemoryError(TString message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,7 +20,7 @@ import org.teavm.classlib.java.nio.TCharBuffer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public interface TReadable {
|
public interface TReadable {
|
||||||
int read(TCharBuffer cb) throws TIOException;
|
int read(TCharBuffer cb) throws TIOException;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TReflectiveOperationException extends TException {
|
public class TReflectiveOperationException extends TException {
|
||||||
private static final long serialVersionUID = -455785869284249992L;
|
private static final long serialVersionUID = -455785869284249992L;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public final class TStrictMath extends TObject {
|
public final class TStrictMath extends TObject {
|
||||||
public static double E = 2.71828182845904523536;
|
public static double E = 2.71828182845904523536;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.teavm.classlib.java.util.regex.TPattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public class TString extends TObject implements TSerializable, TComparable<TString>, TCharSequence {
|
public class TString extends TObject implements TSerializable, TComparable<TString>, TCharSequence {
|
||||||
public static final TComparator<TString> CASE_INSENSITIVE_ORDER = new TComparator<TString>() {
|
public static final TComparator<TString> CASE_INSENSITIVE_ORDER = new TComparator<TString>() {
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TSystemClassLoader extends TClassLoader {
|
class TSystemClassLoader extends TClassLoader {
|
||||||
TSystemClassLoader() {
|
TSystemClassLoader() {
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
*/
|
*/
|
||||||
package org.teavm.classlib.java.lang;
|
package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
import org.teavm.dom.browser.TimerHandler;
|
|
||||||
import org.teavm.dom.browser.Window;
|
import org.teavm.dom.browser.Window;
|
||||||
import org.teavm.javascript.spi.Async;
|
import org.teavm.javascript.spi.Async;
|
||||||
import org.teavm.jso.JS;
|
import org.teavm.jso.JS;
|
||||||
|
@ -23,7 +22,6 @@ import org.teavm.platform.Platform;
|
||||||
import org.teavm.platform.PlatformRunnable;
|
import org.teavm.platform.PlatformRunnable;
|
||||||
import org.teavm.platform.async.AsyncCallback;
|
import org.teavm.platform.async.AsyncCallback;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev
|
* @author Alexey Andreev
|
||||||
|
@ -36,6 +34,8 @@ public class TThread extends TObject implements TRunnable {
|
||||||
private static int activeCount = 1;
|
private static int activeCount = 1;
|
||||||
private long id;
|
private long id;
|
||||||
private int priority = 0;
|
private int priority = 0;
|
||||||
|
private long timeSliceStart;
|
||||||
|
private int yieldCount;
|
||||||
|
|
||||||
private TString name;
|
private TString name;
|
||||||
TRunnable target;
|
TRunnable target;
|
||||||
|
@ -55,10 +55,10 @@ public class TThread extends TObject implements TRunnable {
|
||||||
public TThread(TRunnable target, TString name ) {
|
public TThread(TRunnable target, TString name ) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.target = target;
|
this.target = target;
|
||||||
id=nextId++;
|
id = nextId++;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start(){
|
public void start() {
|
||||||
Platform.startThread(new PlatformRunnable() {
|
Platform.startThread(new PlatformRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -74,9 +74,13 @@ public class TThread extends TObject implements TRunnable {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setCurrentThread(TThread thread){
|
static void setCurrentThread(TThread thread) {
|
||||||
currentThread = thread;
|
if (currentThread != thread) {
|
||||||
|
currentThread = thread;
|
||||||
|
}
|
||||||
|
currentThread.timeSliceStart = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
static TThread getMainThread(){
|
static TThread getMainThread(){
|
||||||
return mainThread;
|
return mainThread;
|
||||||
}
|
}
|
||||||
|
@ -96,11 +100,26 @@ public class TThread extends TObject implements TRunnable {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Async
|
public static void yield() {
|
||||||
public static native void yield();
|
if (++currentThread.yieldCount < 30) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
currentThread.yieldCount = 0;
|
||||||
|
if (currentThread.timeSliceStart + 100 < System.currentTimeMillis()) {
|
||||||
|
switchContext(currentThread);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void yield(final AsyncCallback<Void> callback) {
|
@Async
|
||||||
callback.complete(null);
|
static native void switchContext(TThread thread);
|
||||||
|
|
||||||
|
private static void switchContext(final TThread thread, final AsyncCallback<Void> callback) {
|
||||||
|
Platform.postpone(new PlatformRunnable() {
|
||||||
|
@Override public void run() {
|
||||||
|
setCurrentThread(thread);
|
||||||
|
callback.complete(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void interrupt() {
|
public void interrupt() {
|
||||||
|
@ -131,20 +150,20 @@ public class TThread extends TObject implements TRunnable {
|
||||||
|
|
||||||
private static void sleep(long millis, final AsyncCallback<Void> callback) {
|
private static void sleep(long millis, final AsyncCallback<Void> callback) {
|
||||||
final TThread current = currentThread();
|
final TThread current = currentThread();
|
||||||
window.setTimeout(new TimerHandler() {
|
int intMillis = millis < Integer.MAX_VALUE ? (int)millis : Integer.MAX_VALUE;
|
||||||
@Override public void onTimer() {
|
Platform.schedule(new PlatformRunnable() {
|
||||||
|
@Override public void run() {
|
||||||
setCurrentThread(current);
|
setCurrentThread(current);
|
||||||
callback.complete(null);
|
callback.complete(null);
|
||||||
}
|
}
|
||||||
}, millis);
|
}, intMillis);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setPriority(int newPriority){
|
public final void setPriority(int newPriority){
|
||||||
this.priority = newPriority;
|
this.priority = newPriority;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getPriority(){
|
public final int getPriority(){
|
||||||
return this.priority;
|
return this.priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ package org.teavm.classlib.java.lang;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev
|
* @author Alexey Andreev
|
||||||
|
* @param <T> type of a value stored by thread local.
|
||||||
*/
|
*/
|
||||||
public class TThreadLocal<T> extends TObject {
|
public class TThreadLocal<T> extends TObject {
|
||||||
private boolean initialized;
|
private boolean initialized;
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.teavm.javascript.spi.Superclass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
@Superclass("java.lang.Object")
|
@Superclass("java.lang.Object")
|
||||||
public class TThrowable extends RuntimeException {
|
public class TThrowable extends RuntimeException {
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2015 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev
|
||||||
|
*/
|
||||||
|
public class TVirtualMachineError extends TError {
|
||||||
|
private static final long serialVersionUID = -4246822614122675559L;
|
||||||
|
|
||||||
|
public TVirtualMachineError() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TVirtualMachineError(TString message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public final class TVoid extends TObject {
|
public final class TVoid extends TObject {
|
||||||
public static final TClass<TVoid> TYPE = TClass.voidClass();
|
public static final TClass<TVoid> TYPE = TClass.voidClass();
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.teavm.classlib.java.lang.TObject;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev
|
* @author Alexey Andreev
|
||||||
|
* @param <T> type of an object to which this reference points.
|
||||||
*/
|
*/
|
||||||
public abstract class TReference<T> extends TObject {
|
public abstract class TReference<T> extends TObject {
|
||||||
public T get() {
|
public T get() {
|
||||||
|
|
|
@ -18,6 +18,7 @@ package org.teavm.classlib.java.lang.ref;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev
|
* @author Alexey Andreev
|
||||||
|
* @param <T>
|
||||||
*/
|
*/
|
||||||
public class TReferenceQueue<T> {
|
public class TReferenceQueue<T> {
|
||||||
public TReference<T> poll() {
|
public TReference<T> poll() {
|
||||||
|
|
|
@ -18,6 +18,7 @@ package org.teavm.classlib.java.lang.ref;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev
|
* @author Alexey Andreev
|
||||||
|
* @param <T>
|
||||||
*/
|
*/
|
||||||
public class TWeakReference<T> extends TReference<T> {
|
public class TWeakReference<T> extends TReference<T> {
|
||||||
private T value;
|
private T value;
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class ArrayNativeGenerator implements Generator, DependencyPlugin {
|
||||||
writer.append("if (" + array + " === null || " + array + ".constructor.$meta.item === undefined) {")
|
writer.append("if (" + array + " === null || " + array + ".constructor.$meta.item === undefined) {")
|
||||||
.softNewLine().indent();
|
.softNewLine().indent();
|
||||||
String clsName = "java.lang.IllegalArgumentException";
|
String clsName = "java.lang.IllegalArgumentException";
|
||||||
MethodReference cons = new MethodReference(clsName, new MethodDescriptor("<init>", ValueType.VOID));
|
MethodDescriptor cons = new MethodDescriptor("<init>", ValueType.VOID);
|
||||||
writer.append("$rt_throw(").appendClass(clsName).append(".").appendMethod(cons).append("());").softNewLine();
|
writer.append("$rt_throw(").appendClass(clsName).append(".").appendMethod(cons).append("());").softNewLine();
|
||||||
writer.outdent().append("}").softNewLine();
|
writer.outdent().append("}").softNewLine();
|
||||||
writer.append("return " + array + ".data.length;").softNewLine();
|
writer.append("return " + array + ".data.length;").softNewLine();
|
||||||
|
@ -81,7 +81,7 @@ public class ArrayNativeGenerator implements Generator, DependencyPlugin {
|
||||||
|
|
||||||
private void achieveGetLength(final DependencyAgent agent, final MethodDependency method) {
|
private void achieveGetLength(final DependencyAgent agent, final MethodDependency method) {
|
||||||
method.getVariable(1).addConsumer(new DependencyConsumer() {
|
method.getVariable(1).addConsumer(new DependencyConsumer() {
|
||||||
@Override public void consume(DependencyAgentType type) {
|
@Override public void consume(DependencyType type) {
|
||||||
if (!type.getName().startsWith("[")) {
|
if (!type.getName().startsWith("[")) {
|
||||||
MethodReference cons = new MethodReference(IllegalArgumentException.class, "<init>", void.class);
|
MethodReference cons = new MethodReference(IllegalArgumentException.class, "<init>", void.class);
|
||||||
agent.linkMethod(cons, null).use();
|
agent.linkMethod(cons, null).use();
|
||||||
|
@ -128,7 +128,7 @@ public class ArrayNativeGenerator implements Generator, DependencyPlugin {
|
||||||
private void achieveGet(final DependencyAgent agent, final MethodDependency method) {
|
private void achieveGet(final DependencyAgent agent, final MethodDependency method) {
|
||||||
method.getVariable(1).getArrayItem().connect(method.getResult());
|
method.getVariable(1).getArrayItem().connect(method.getResult());
|
||||||
method.getVariable(1).addConsumer(new DependencyConsumer() {
|
method.getVariable(1).addConsumer(new DependencyConsumer() {
|
||||||
@Override public void consume(DependencyAgentType type) {
|
@Override public void consume(DependencyType type) {
|
||||||
if (type.getName().startsWith("[")) {
|
if (type.getName().startsWith("[")) {
|
||||||
String typeName = type.getName().substring(1);
|
String typeName = type.getName().substring(1);
|
||||||
for (int i = 0; i < primitiveTypes.length; ++i) {
|
for (int i = 0; i < primitiveTypes.length; ++i) {
|
||||||
|
|
|
@ -874,8 +874,8 @@ class TDivision {
|
||||||
/**
|
/**
|
||||||
* Performs the final reduction of the Montgomery algorithm.
|
* Performs the final reduction of the Montgomery algorithm.
|
||||||
*
|
*
|
||||||
* @see monPro(BigInteger, BigInteger, BigInteger, long)
|
* @see #monPro(TBigInteger, TBigInteger, TBigInteger, long)
|
||||||
* @see monSquare(BigInteger, BigInteger, long)
|
* @see #monSquare(TBigInteger, TBigInteger, long)
|
||||||
*/
|
*/
|
||||||
static TBigInteger finalSubtraction(int res[], TBigInteger modulus) {
|
static TBigInteger finalSubtraction(int res[], TBigInteger modulus) {
|
||||||
|
|
||||||
|
|
|
@ -348,8 +348,7 @@ class TElementary {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as
|
* Same as
|
||||||
*
|
* {@link #inplaceSubtract(TBigInteger, TBigInteger)}, but without the
|
||||||
* @link #inplaceSubtract(BigInteger, BigInteger), but without the
|
|
||||||
* restriction of non-positive values
|
* restriction of non-positive values
|
||||||
* @param op1
|
* @param op1
|
||||||
* should have enough space to save the result
|
* should have enough space to save the result
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.teavm.classlib.java.lang.TReadable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public abstract class TCharBuffer extends TBuffer implements Comparable<TCharBuffer>, Appendable,
|
public abstract class TCharBuffer extends TBuffer implements Comparable<TCharBuffer>, Appendable,
|
||||||
CharSequence, TReadable {
|
CharSequence, TReadable {
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
abstract class TCharBufferImpl extends TCharBuffer {
|
abstract class TCharBufferImpl extends TCharBuffer {
|
||||||
public TCharBufferImpl(int capacity, int position, int limit) {
|
public TCharBufferImpl(int capacity, int position, int limit) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TCharBufferOverArray extends TCharBufferImpl {
|
class TCharBufferOverArray extends TCharBufferImpl {
|
||||||
boolean readOnly;
|
boolean readOnly;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
abstract class TCharBufferOverByteBuffer extends TCharBufferImpl {
|
abstract class TCharBufferOverByteBuffer extends TCharBufferImpl {
|
||||||
TByteBufferImpl byteByffer;
|
TByteBufferImpl byteByffer;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TCharBufferOverByteBufferBigEndian extends TCharBufferOverByteBuffer {
|
class TCharBufferOverByteBufferBigEndian extends TCharBufferOverByteBuffer {
|
||||||
public TCharBufferOverByteBufferBigEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
public TCharBufferOverByteBufferBigEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TCharBufferOverByteBufferLittleEndian extends TCharBufferOverByteBuffer {
|
class TCharBufferOverByteBufferLittleEndian extends TCharBufferOverByteBuffer {
|
||||||
public TCharBufferOverByteBufferLittleEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
public TCharBufferOverByteBufferLittleEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public abstract class TDoubleBuffer extends TBuffer implements Comparable<TDoubleBuffer> {
|
public abstract class TDoubleBuffer extends TBuffer implements Comparable<TDoubleBuffer> {
|
||||||
TDoubleBuffer(int capacity, int position, int limit) {
|
TDoubleBuffer(int capacity, int position, int limit) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
abstract class TDoubleBufferImpl extends TDoubleBuffer {
|
abstract class TDoubleBufferImpl extends TDoubleBuffer {
|
||||||
public TDoubleBufferImpl(int capacity, int position, int limit) {
|
public TDoubleBufferImpl(int capacity, int position, int limit) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TDoubleBufferOverArray extends TDoubleBufferImpl {
|
class TDoubleBufferOverArray extends TDoubleBufferImpl {
|
||||||
boolean readOnly;
|
boolean readOnly;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TDoubleBufferOverByteBuffer extends TDoubleBufferImpl {
|
class TDoubleBufferOverByteBuffer extends TDoubleBufferImpl {
|
||||||
private TByteBufferImpl byteByffer;
|
private TByteBufferImpl byteByffer;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public abstract class TFloatBuffer extends TBuffer implements Comparable<TFloatBuffer> {
|
public abstract class TFloatBuffer extends TBuffer implements Comparable<TFloatBuffer> {
|
||||||
TFloatBuffer(int capacity, int position, int limit) {
|
TFloatBuffer(int capacity, int position, int limit) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
abstract class TFloatBufferImpl extends TFloatBuffer {
|
abstract class TFloatBufferImpl extends TFloatBuffer {
|
||||||
public TFloatBufferImpl(int capacity, int position, int limit) {
|
public TFloatBufferImpl(int capacity, int position, int limit) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TFloatBufferOverArray extends TFloatBufferImpl {
|
class TFloatBufferOverArray extends TFloatBufferImpl {
|
||||||
boolean readOnly;
|
boolean readOnly;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
abstract class TFloatBufferOverByteBuffer extends TFloatBufferImpl {
|
abstract class TFloatBufferOverByteBuffer extends TFloatBufferImpl {
|
||||||
TByteBufferImpl byteByffer;
|
TByteBufferImpl byteByffer;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TFloatBufferOverByteBufferBigEndian extends TFloatBufferOverByteBuffer {
|
class TFloatBufferOverByteBufferBigEndian extends TFloatBufferOverByteBuffer {
|
||||||
public TFloatBufferOverByteBufferBigEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
public TFloatBufferOverByteBufferBigEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TFloatBufferOverByteBufferLittleEndian extends TFloatBufferOverByteBuffer {
|
class TFloatBufferOverByteBufferLittleEndian extends TFloatBufferOverByteBuffer {
|
||||||
public TFloatBufferOverByteBufferLittleEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
public TFloatBufferOverByteBufferLittleEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public abstract class TIntBuffer extends TBuffer implements Comparable<TIntBuffer> {
|
public abstract class TIntBuffer extends TBuffer implements Comparable<TIntBuffer> {
|
||||||
TIntBuffer(int capacity, int position, int limit) {
|
TIntBuffer(int capacity, int position, int limit) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
abstract class TIntBufferImpl extends TIntBuffer {
|
abstract class TIntBufferImpl extends TIntBuffer {
|
||||||
public TIntBufferImpl(int capacity, int position, int limit) {
|
public TIntBufferImpl(int capacity, int position, int limit) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TIntBufferOverArray extends TIntBufferImpl {
|
class TIntBufferOverArray extends TIntBufferImpl {
|
||||||
boolean readOnly;
|
boolean readOnly;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
abstract class TIntBufferOverByteBuffer extends TIntBufferImpl {
|
abstract class TIntBufferOverByteBuffer extends TIntBufferImpl {
|
||||||
TByteBufferImpl byteByffer;
|
TByteBufferImpl byteByffer;
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TIntBufferOverByteBufferBigEndian extends TIntBufferOverByteBuffer {
|
class TIntBufferOverByteBufferBigEndian extends TIntBufferOverByteBuffer {
|
||||||
public TIntBufferOverByteBufferBigEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
public TIntBufferOverByteBufferBigEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
class TIntBufferOverByteBufferLittleEndian extends TIntBufferOverByteBuffer {
|
class TIntBufferOverByteBufferLittleEndian extends TIntBufferOverByteBuffer {
|
||||||
public TIntBufferOverByteBufferLittleEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
public TIntBufferOverByteBufferLittleEndian(int start, int capacity, TByteBufferImpl byteBuffer, int position,
|
||||||
|
|
|
@ -17,7 +17,7 @@ package org.teavm.classlib.java.nio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public abstract class TLongBuffer extends TBuffer implements Comparable<TLongBuffer> {
|
public abstract class TLongBuffer extends TBuffer implements Comparable<TLongBuffer> {
|
||||||
TLongBuffer(int capacity, int position, int limit) {
|
TLongBuffer(int capacity, int position, int limit) {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user