Java JSArray类代码示例(java中jsarray类的具体用法)

本文整理汇总了Java中org.teavm.jso.core.JSArray的典型用法代码示例。如果您正苦于以下问题:Java JSArray类的具体用法?Java JSArray怎么用?Java JSArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Java JSArray类代码示例(java中jsarray类的具体用法)

JSArray类属于org.teavm.jso.core包,在下文中一共展示了JSArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDeclaredFields

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
public TField[] getDeclaredFields() throws TSecurityException {
    if (isPrimitive() || isArray()) {
        return new TField[0];
    }
    if (declaredFields == null) {
        initReflection();
        JSClass jsClass = (JSClass) getPlatformClass().getMetadata();
        JSArray<JSField> jsFields = jsClass.getFields();
        declaredFields = new TField[jsFields.getLength()];
        for (int i = 0; i < jsFields.getLength(); ++i) {
            JSField jsField = jsFields.get(i);
            declaredFields[i] = new TField(this, jsField.getName(), jsField.getModifiers(),
                    jsField.getAccessLevel(), TClass.getClass(jsField.getType()), jsField.getGetter(),
                    jsField.getSetter());
        }
    }
    return declaredFields.clone();
} 
开发者ID:konsoletyper,项目名称:teavm,代码行数:19,代码来源:TClass.java

示例2: parseDate

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
public static long parseDate(String text) {
    JSRegExp regex = JSRegExp.create("(\\d{4})-(\\d{2})-(\\d{2})(T(\\d{2}):(\\d{2}):(\\d{2}))?");
    JSArray<JSString> groups = regex.exec(JSString.valueOf(text));
    JSDate date = JSDate.create(parseInt(groups.get(1)), parseInt(groups.get(2)) - 1, parseInt(groups.get(3)),
            parseInt(groups.get(5)), parseInt(groups.get(6)), parseInt(groups.get(7)));
    return (long) date.getTime();
} 
开发者ID:konsoletyper,项目名称:teavm-flavour,代码行数:8,代码来源:RoutingImpl.java

示例3: wrap

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
public static <T extends JSObject> JSArray<T> wrap(T[] array) {
    if (array == null) {
        return null;
    }
    JSArray<T> result = JSArray.create(array.length);
    for (int i = 0; i < array.length; ++i) {
        result.set(i, array[i]);
    }
    return result;
} 
开发者ID:konsoletyper,项目名称:teavm,代码行数:11,代码来源:JS.java

示例4: map

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
public static <T extends JSObject, S> JSArray<T> map(S[] array, Function<S, T> f) {
    if (array == null) {
        return null;
    }
    JSArray<T> result = JSArray.create(array.length);
    for (int i = 0; i < array.length; ++i) {
        result.set(i, f.apply(array[i]));
    }
    return result;
} 
开发者ID:konsoletyper,项目名称:teavm,代码行数:11,代码来源:JS.java

示例5: getWrapperType

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
private ValueType getWrapperType(ValueType type) {
    if (type instanceof ValueType.Array) {
        return ValueType.parse(JSArray.class);
    } else {
        return ValueType.parse(JSObject.class);
    }
} 
开发者ID:konsoletyper,项目名称:teavm,代码行数:8,代码来源:JSValueMarshaller.java

示例6: getDeclaredConstructors

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
@SuppressWarnings({ "raw", "unchecked" })
public TConstructor<?>[] getDeclaredConstructors() throws TSecurityException {
    if (isPrimitive() || isArray()) {
        return new TConstructor<?>[0];
    }

    if (declaredConstructors == null) {
        initReflection();
        JSClass jsClass = (JSClass) getPlatformClass().getMetadata();
        JSArray<JSMethodMember> jsMethods = jsClass.getMethods();
        declaredConstructors = new TConstructor[jsMethods.getLength()];
        int count = 0;
        for (int i = 0; i < jsMethods.getLength(); ++i) {
            JSMethodMember jsMethod = jsMethods.get(i);
            if (!jsMethod.getName().equals("<init>")) {
                continue;
            }
            PlatformSequence<PlatformClass> jsParameterTypes = jsMethod.getParameterTypes();
            TClass<?>[] parameterTypes = new TClass<?>[jsParameterTypes.getLength()];
            for (int j = 0; j < parameterTypes.length; ++j) {
                parameterTypes[j] = getClass(jsParameterTypes.get(j));
            }
            declaredConstructors[count++] = new TConstructor<T>(this, jsMethod.getName(), jsMethod.getModifiers(),
                    jsMethod.getAccessLevel(), parameterTypes, jsMethod.getCallable());
        }
        declaredConstructors = Arrays.copyOf(declaredConstructors, count);
    }
    return declaredConstructors.clone();
} 
开发者ID:konsoletyper,项目名称:teavm,代码行数:30,代码来源:TClass.java

示例7: getDeclaredMethods

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
public TMethod[] getDeclaredMethods() {
    if (isPrimitive() || isArray()) {
        return new TMethod[0];
    }
    if (declaredMethods == null) {
        initReflection();
        JSClass jsClass = (JSClass) getPlatformClass().getMetadata();
        JSArray<JSMethodMember> jsMethods = jsClass.getMethods();
        declaredMethods = new TMethod[jsMethods.getLength()];
        int count = 0;
        for (int i = 0; i < jsMethods.getLength(); ++i) {
            JSMethodMember jsMethod = jsMethods.get(i);
            if (jsMethod.getName().equals("<init>") || jsMethod.getName().equals("<clinit>")) {
                continue;
            }
            PlatformSequence<PlatformClass> jsParameterTypes = jsMethod.getParameterTypes();
            TClass<?>[] parameterTypes = new TClass<?>[jsParameterTypes.getLength()];
            for (int j = 0; j < parameterTypes.length; ++j) {
                parameterTypes[j] = getClass(jsParameterTypes.get(j));
            }
            TClass<?> returnType = getClass(jsMethod.getReturnType());
            declaredMethods[count++] = new TMethod(this, jsMethod.getName(), jsMethod.getModifiers(),
                    jsMethod.getAccessLevel(), returnType, parameterTypes, jsMethod.getCallable());
        }
        declaredMethods = Arrays.copyOf(declaredMethods, count);
    }
    return declaredMethods.clone();
} 
开发者ID:konsoletyper,项目名称:teavm,代码行数:29,代码来源:TClass.java

示例8: log

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
@JSBody(params = { "objs" }, script = "return console.log.apply(this, objs)")
public static native void log(JSArray<JSObject> objs); 
开发者ID:leobm,项目名称:teavm-console,代码行数:3,代码来源:Console.java

示例9: build

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
public JSArray<JSObject> build() {
    return this.args;
} 
开发者ID:leobm,项目名称:teavm-console,代码行数:4,代码来源:ValuesBuilder.java

示例10: getAllNodes

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
@Override
void getAllNodes(JSArray<Node> nodes) {
    nodes.push(node);
} 
开发者ID:konsoletyper,项目名称:teavm-flavour,代码行数:5,代码来源:NodeHolder.java

示例11: insertBefore

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
public void insertBefore(Space space, Space successor) {
    if (space.getParent() != null) {
        throw new IllegalArgumentException("The given space is already hosted by a slot");
    }
    if (successor != null && successor.getParent() != this) {
        throw new IllegalArgumentException("Successor does not belong to this slot");
    }

    space.parent = this;
    if (successor == null) {
        space.previous = last;
        if (last != null) {
            last.next = space;
        } else {
            first = space;
        }
        last = space;
    } else {
        space.next = successor;
        space.previous = successor.previous;
        if (space.next != null) {
            space.next.previous = space;
        } else {
            last = space;
        }
        if (space.previous != null) {
            space.previous.next = space;
        } else {
            first = space;
        }
    }

    RootSlot root = getRoot();
    if (root == null) {
        return;
    }

    JSArray<Node> domNodes = JSArray.create();
    space.getAllNodes(domNodes);
    if (domNodes.getLength() == 0) {
        return;
    }
    Node successorDomNode;
    if (successor != null) {
        successorDomNode = successor.getFirstNode();
    } else {
        Space ancestor = this;
        successorDomNode = null;
        while (ancestor != null) {
            if (ancestor.next != null) {
                successorDomNode = ancestor.next.getFirstNode();
                break;
            }
            ancestor = ancestor.parent;
        }
    }
    for (int i = 0; i < domNodes.getLength(); ++i) {
        root.domNode.insertBefore(domNodes.get(i), successorDomNode);
    }
} 
开发者ID:konsoletyper,项目名称:teavm-flavour,代码行数:61,代码来源:Slot.java

示例12: getAllNodes

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
@Override
void getAllNodes(JSArray<Node> nodes) {
    for (Space child = first; child != null; child = child.getNext()) {
        child.getAllNodes(nodes);
    }
} 
开发者ID:konsoletyper,项目名称:teavm-flavour,代码行数:7,代码来源:Slot.java

示例13: nativePollGamepads

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
@JSBody(script =
    "return rawGamepads = (navigator.webkitGetGamepads && navigator.webkitGetGamepads()) || " +
            "navigator.webkitGamepads;")
private static native JSArray<Gamepad> nativePollGamepads(); 
开发者ID:konsoletyper,项目名称:teavm-libgdx,代码行数:5,代码来源:GamepadSupport.java

示例14: postMessage

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
public final void postMessage(JSObject message, String targetOrigin, JSObject... transfer) {
    postMessage(message, targetOrigin, JSArray.of(transfer));
} 
开发者ID:konsoletyper,项目名称:teavm,代码行数:4,代码来源:Window.java

示例15: getInputs

import org.teavm.jso.core.JSArray; //导入依赖的package包/类
@JSProperty
JSArray getInputs(); 
开发者ID:konsoletyper,项目名称:teavm,代码行数:3,代码来源:AudioWorkerNodeCreationEvent.java

本文标签属性:

示例:示例图

代码:代码编程

java:java模拟器

JSArray:jsarray方法

上一篇:为什么女性遇害,第一嫌疑人且凶手大概率是老公?(古天乐主演电影《犯罪现场》中,到底是谁杀了叶警官的线人大雄?)(古天乐主演电影《犯罪现场》中的杀妻案,下场惨烈)
下一篇:Java JavaVersion类代码示例

为您推荐