Class VariableList

java.lang.Object
me.topchetoeu.j2s.compilation.scope.VariableList
All Implemented Interfaces:
Iterable<Variable>

public final class VariableList extends Object implements Iterable<Variable>
  • Field Details

  • Constructor Details

  • Method Details

    • add

      public Variable add(Variable val)
      Adds the given variable to this list. If it already exists, does nothing
      Returns:
      val
    • remove

      public Variable remove(Variable var)
      If the variable is not in the list, does nothing. Otherwise, removes the variable from the list
      Returns:
      null if nothing was done, else the deleted variable (should be var)
    • has

      public boolean has(Variable var)
      Checks if the list has the given variable
    • indexer

      public Supplier<VariableIndex> indexer(Variable var)
      Returns an indexer for the given variable
    • size

      public int size()
    • iterator

      public Iterator<Variable> iterator()
      Specified by:
      iterator in interface Iterable<Variable>