All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.deephaven.lang.api.AbstractChunkerInvokable Maven / Gradle / Ivy

There is a newer version: 0.36.1
Show newest version
/**
 * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
 */
package io.deephaven.lang.api;

import io.deephaven.lang.generated.Chunker;
import io.deephaven.lang.generated.Node;
import io.deephaven.lang.generated.ScopedNode;
import io.deephaven.lang.generated.Token;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 */
public abstract class AbstractChunkerInvokable extends ScopedNode implements ChunkerInvokable {

    private final List arguments;
    private Node scopeTarget;

    public AbstractChunkerInvokable(int i) {
        super(i);
        this.arguments = new ArrayList<>();
    }

    public AbstractChunkerInvokable(Chunker p, int i) {
        super(p, i);
        this.arguments = new ArrayList<>();
    }

    @Override
    public final void addArgument(Node argument) {
        arguments.add(argument);
    }

    @Override
    public final void addToken(Token token) {
        addToken(token, null);
    }

    public List getArguments() {
        return Collections.unmodifiableList(arguments);
    }

    public Node getArgument(int i) {
        return arguments.size() > i ? arguments.get(i) : null;
    }

    public int getArgumentCount() {
        return arguments.size();
    }

    @Override
    public Node getScopeTarget() {
        return scopeTarget;
    }

    @Override
    public void setScopeTarget(Node scopeTarget) {
        this.scopeTarget = scopeTarget;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy