Adds implementation of some JCL needed for graphhopper

This commit is contained in:
konsoletyper 2014-04-03 17:25:22 +04:00
parent 1c50bb9d0b
commit 7a0a2d6437
3 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,23 @@
/*
* Copyright 2014 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.io;
/**
*
* @author Alexey Andreev
*/
public interface TExternalizable {
}

View File

@ -504,6 +504,21 @@ public class TString extends TObject implements TSerializable, TComparable<TStri
return true;
}
public boolean equalsIgnoreCase(TString other) {
if (this == other) {
return true;
}
if (length() != other.length()) {
return false;
}
for (int i = 0; i < length(); ++i) {
if (TCharacter.toLowerCase(charAt(i)) != TCharacter.toLowerCase(other.charAt(i))) {
return false;
}
}
return true;
}
public byte[] getBytes(TString charsetName) throws TUnsupportedEncodingException {
Charset charset = Charset.get(charsetName.toString());
if (charset == null) {

View File

@ -0,0 +1,39 @@
/*
* Copyright 2014 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.nio;
/**
*
* @author Alexey Andreev
*/
public final class TByteOrder {
public static final TByteOrder BIG_ENDIAN = new TByteOrder("BIG_ENDIAN");
public static final TByteOrder LITTLE_ENDIAN = new TByteOrder("BIG_ENDIAN");
private String name;
private TByteOrder(String name) {
this.name = name;
}
public static TByteOrder nativeOrder() {
return BIG_ENDIAN;
}
@Override
public String toString() {
return name;
}
}