mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
27291367b7
|
@ -157,7 +157,9 @@ public class HashtableTest {
|
||||||
|
|
||||||
String okey, ckey;
|
String okey, ckey;
|
||||||
while (org.hasMoreElements()) {
|
while (org.hasMoreElements()) {
|
||||||
assertTrue("Key comparison failed", (okey = org.nextElement()).equals(ckey = cpy.nextElement()));
|
okey = org.nextElement();
|
||||||
|
ckey = cpy.nextElement();
|
||||||
|
assertTrue("Key comparison failed", okey.equals(ckey));
|
||||||
assertTrue("Value comparison failed", (htfull.get(okey)).equals(h.get(ckey)));
|
assertTrue("Value comparison failed", (htfull.get(okey)).equals(h.get(ckey)));
|
||||||
}
|
}
|
||||||
assertTrue("Copy has more keys than original", !cpy.hasMoreElements());
|
assertTrue("Copy has more keys than original", !cpy.hasMoreElements());
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package org.teavm.dom.browser;
|
package org.teavm.dom.browser;
|
||||||
|
|
||||||
import org.teavm.dom.core.Document;
|
import org.teavm.dom.html.HTMLDocument;
|
||||||
import org.teavm.jso.JSGlobal;
|
import org.teavm.jso.JSGlobal;
|
||||||
import org.teavm.jso.JSObject;
|
import org.teavm.jso.JSObject;
|
||||||
import org.teavm.jso.JSProperty;
|
import org.teavm.jso.JSProperty;
|
||||||
|
@ -26,7 +26,7 @@ import org.teavm.jso.JSProperty;
|
||||||
*/
|
*/
|
||||||
public interface Window extends JSGlobal {
|
public interface Window extends JSGlobal {
|
||||||
@JSProperty
|
@JSProperty
|
||||||
Document getDocument();
|
HTMLDocument getDocument();
|
||||||
|
|
||||||
void alert(JSObject message);
|
void alert(JSObject message);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public interface Element extends Node {
|
||||||
|
|
||||||
Attr removeAttributeNode(Attr oldAttr);
|
Attr removeAttributeNode(Attr oldAttr);
|
||||||
|
|
||||||
NodeList<Element> getElementsByTagName(String name);
|
NodeList<? extends Element> getElementsByTagName(String name);
|
||||||
|
|
||||||
String getAttributeNS(String namespaceURI, String localName);
|
String getAttributeNS(String namespaceURI, String localName);
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public interface Element extends Node {
|
||||||
|
|
||||||
Attr setAttributeNodeNS(Attr newAttr);
|
Attr setAttributeNodeNS(Attr newAttr);
|
||||||
|
|
||||||
NodeList<Element> getElementsByTagNameNS(String namespaceURI, String localName);
|
NodeList<? extends Element> getElementsByTagNameNS(String namespaceURI, String localName);
|
||||||
|
|
||||||
boolean hasAttribute(String name);
|
boolean hasAttribute(String name);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package org.teavm.dom.core;
|
package org.teavm.dom.core;
|
||||||
|
|
||||||
import org.teavm.jso.JSArray;
|
import org.teavm.jso.JSArrayReader;
|
||||||
import org.teavm.jso.JSObject;
|
import org.teavm.jso.JSObject;
|
||||||
import org.teavm.jso.JSProperty;
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ import org.teavm.jso.JSProperty;
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public interface NamedNodeMap<T extends Node> extends JSObject, JSArray<T> {
|
public interface NamedNodeMap<T extends Node> extends JSObject, JSArrayReader<T> {
|
||||||
T getNamedItem(String name);
|
T getNamedItem(String name);
|
||||||
|
|
||||||
T setNamedItem(T arg);
|
T setNamedItem(T arg);
|
||||||
|
|
|
@ -15,14 +15,14 @@
|
||||||
*/
|
*/
|
||||||
package org.teavm.dom.core;
|
package org.teavm.dom.core;
|
||||||
|
|
||||||
import org.teavm.jso.JSArray;
|
import org.teavm.jso.JSArrayReader;
|
||||||
import org.teavm.jso.JSProperty;
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public interface NodeList<T extends Node> extends JSArray<T> {
|
public interface NodeList<T extends Node> extends JSArrayReader<T> {
|
||||||
T item(int index);
|
T item(int index);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
* 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.dom.css;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSIndexer;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface CSSStyleDeclaration extends JSObject {
|
||||||
|
@JSProperty
|
||||||
|
String getCssText();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setCssText(String cssText);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getLength();
|
||||||
|
|
||||||
|
@JSIndexer
|
||||||
|
String item(int index);
|
||||||
|
|
||||||
|
String getPropertyValue(String property);
|
||||||
|
|
||||||
|
String getPropertyPriority(String property);
|
||||||
|
|
||||||
|
void setProperty(String property, String value);
|
||||||
|
|
||||||
|
void setProperty(String property, String value, String priority);
|
||||||
|
|
||||||
|
void setPropertyValue(String property, String value);
|
||||||
|
|
||||||
|
void setPropertyPriority(String property, String priority);
|
||||||
|
|
||||||
|
String removeProperty(String property);
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* 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.dom.css;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface ElementCSSInlineStyle extends JSObject {
|
||||||
|
@JSProperty
|
||||||
|
CSSStyleDeclaration getStyle();
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* 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.dom.html;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface HTMLBaseElement extends HTMLElement {
|
||||||
|
@JSProperty
|
||||||
|
String getHref();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setHref(String href);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getTarget();
|
||||||
|
|
||||||
|
void setTarget(String target);
|
||||||
|
}
|
35
teavm-dom/src/main/java/org/teavm/dom/html/HTMLDocument.java
Normal file
35
teavm-dom/src/main/java/org/teavm/dom/html/HTMLDocument.java
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* 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.dom.html;
|
||||||
|
|
||||||
|
import org.teavm.dom.core.Document;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface HTMLDocument extends Document {
|
||||||
|
@JSProperty
|
||||||
|
@Override
|
||||||
|
HTMLHtmlElement getDocumentElement();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
HTMLElement createElement(String tagName);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
HTMLElement getElementById(String elementId);
|
||||||
|
}
|
83
teavm-dom/src/main/java/org/teavm/dom/html/HTMLElement.java
Normal file
83
teavm-dom/src/main/java/org/teavm/dom/html/HTMLElement.java
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
/*
|
||||||
|
* 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.dom.html;
|
||||||
|
|
||||||
|
import org.teavm.dom.core.Element;
|
||||||
|
import org.teavm.dom.core.NodeList;
|
||||||
|
import org.teavm.dom.css.ElementCSSInlineStyle;
|
||||||
|
import org.teavm.dom.events.EventTarget;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface HTMLElement extends Element, ElementCSSInlineStyle, EventTarget {
|
||||||
|
@Override
|
||||||
|
@JSProperty
|
||||||
|
NodeList<? extends HTMLElement> getElementsByTagName(String name);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getTitle();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setTitle(String title);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getLang();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setLang(String lang);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
boolean isTranslate();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setTranslate(boolean translate);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getDir();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setDir(String dir);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
boolean isHidden();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setHidden(boolean hidden);
|
||||||
|
|
||||||
|
void click();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getTabIndex();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setTabIndex(int tabIndex);
|
||||||
|
|
||||||
|
void focus();
|
||||||
|
|
||||||
|
void blur();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getAccessKey();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setAccessKey(String accessKey);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getAccessKeyLabel();
|
||||||
|
}
|
|
@ -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.dom.html;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface HTMLHeadElement extends HTMLElement {
|
||||||
|
}
|
|
@ -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.dom.html;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface HTMLHtmlElement extends HTMLElement {
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* 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.dom.html;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface HTMLLinkElement extends HTMLElement {
|
||||||
|
@JSProperty
|
||||||
|
String getHref();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setHref(String href);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getCrossOrigin();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setCrossOrigin(String crossOrigin);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getRel();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setRel(String rel);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getMedia();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setMedia(String media);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getHreflang();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setHreflang(String hreflang);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getType();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setType(String property);
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* 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.dom.html;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface HTMLMetaElement extends HTMLElement {
|
||||||
|
@JSProperty
|
||||||
|
String getName();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setName(String name);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getHttpEquiv();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setHttpEquiv(String httpEquiv);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getContent();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setContent(String content);
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* 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.dom.html;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface HTMLTitleElement extends HTMLElement {
|
||||||
|
@JSProperty
|
||||||
|
String getText();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setText(String text);
|
||||||
|
}
|
|
@ -19,15 +19,59 @@ package org.teavm.jso;
|
||||||
*
|
*
|
||||||
* @author Alexey Andreev
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public interface JSArray<T extends JSObject> extends JSObject {
|
public interface JSArray<T extends JSObject> extends JSArrayReader<T> {
|
||||||
@JSProperty
|
|
||||||
int getLength();
|
|
||||||
|
|
||||||
@JSIndexer
|
|
||||||
T get(int index);
|
|
||||||
|
|
||||||
@JSIndexer
|
@JSIndexer
|
||||||
void set(int index, T value);
|
void set(int index, T value);
|
||||||
|
|
||||||
void push(T value);
|
int push(T a);
|
||||||
|
|
||||||
|
int push(T a, T b);
|
||||||
|
|
||||||
|
int push(T a, T b, T c);
|
||||||
|
|
||||||
|
int push(T a, T b, T c, T d);
|
||||||
|
|
||||||
|
T shift();
|
||||||
|
|
||||||
|
String join(String separator);
|
||||||
|
|
||||||
|
String join();
|
||||||
|
|
||||||
|
JSArray<T> concat(JSArray<T> a);
|
||||||
|
|
||||||
|
JSArray<T> concat(JSArray<T> a, JSArray<T> b);
|
||||||
|
|
||||||
|
JSArray<T> concat(JSArray<T> a, JSArray<T> b, JSArray<T> c);
|
||||||
|
|
||||||
|
JSArray<T> concat(JSArray<T> a, JSArray<T> b, JSArray<T> c, JSArray<T> d);
|
||||||
|
|
||||||
|
T pop();
|
||||||
|
|
||||||
|
int unshift(T a);
|
||||||
|
|
||||||
|
int unshift(T a, T b);
|
||||||
|
|
||||||
|
int unshift(T a, T b, T c);
|
||||||
|
|
||||||
|
int unshift(T a, T b, T c, T d);
|
||||||
|
|
||||||
|
JSArray<T> slice(int start);
|
||||||
|
|
||||||
|
JSArray<T> slice(int start, int end);
|
||||||
|
|
||||||
|
JSArray<T> reverse();
|
||||||
|
|
||||||
|
JSArray<T> sort(JSSortFunction<T> function);
|
||||||
|
|
||||||
|
JSArray<T> sort();
|
||||||
|
|
||||||
|
JSArray<T> splice(int start, int count);
|
||||||
|
|
||||||
|
JSArray<T> splice(int start, int count, T a);
|
||||||
|
|
||||||
|
JSArray<T> splice(int start, int count, T a, T b);
|
||||||
|
|
||||||
|
JSArray<T> splice(int start, int count, T a, T b, T c);
|
||||||
|
|
||||||
|
JSArray<T> splice(int start, int count, T a, T b, T c, T d);
|
||||||
}
|
}
|
||||||
|
|
28
teavm-jso/src/main/java/org/teavm/jso/JSArrayReader.java
Normal file
28
teavm-jso/src/main/java/org/teavm/jso/JSArrayReader.java
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* 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.jso;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
public interface JSArrayReader<T extends JSObject> extends JSObject {
|
||||||
|
@JSProperty
|
||||||
|
int getLength();
|
||||||
|
|
||||||
|
@JSIndexer
|
||||||
|
T get(int index);
|
||||||
|
}
|
25
teavm-jso/src/main/java/org/teavm/jso/JSSortFunction.java
Normal file
25
teavm-jso/src/main/java/org/teavm/jso/JSSortFunction.java
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* 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.jso;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||||
|
*/
|
||||||
|
@JSFunctor
|
||||||
|
public interface JSSortFunction<T extends JSObject> {
|
||||||
|
int compare(T a, T b);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user