Interface KeyedIterableExpression<T>

All Superinterfaces:
Debuggable, Expression<T>, Loopable<T>, Simplifiable<Expression<? extends T>>, SyntaxElement
All Known Subinterfaces:
KeyProviderExpression<T>
All Known Implementing Classes:
ConvertedKeyProviderExpression, Variable

public interface KeyedIterableExpression<T> extends Expression<T>
  • Method Details

    • canIterateWithKeys

      boolean canIterateWithKeys()
      Checks whether this expression can provide keys when iterated.
      Returns:
      true if this expression can provide keys, false otherwise
    • keyedIterator

      Iterator<KeyedValue<T>> keyedIterator(org.bukkit.event.Event event)
      Returns an iterator over the keyed values of this expression.
      This should only be called iff canIterateWithKeys() returns true.
      Parameters:
      event - The event context
      Returns:
      An iterator over the key-value pairs of this expression
    • keyedStream

      default Stream<KeyedValue<T>> keyedStream(org.bukkit.event.Event event)
    • isLoopOf

      default boolean isLoopOf(String input)
      Description copied from interface: Loopable
      Checks whether the given 'loop-...' expression should match this loop, e.g. loop-block matches any loops that loop through blocks and loop-argument matches an argument loop.

      You should usually just return false as e.g. loop-block will automatically match the expression if its returnType is Block or a subtype of it.

      Specified by:
      isLoopOf in interface Loopable<T>
      Parameters:
      input - The entered input string (the blank in loop-___)
      Returns:
      Whether this loop matches the given string
    • isIndexLoop

      default boolean isIndexLoop(String input)
      Checks whether the 'loop-...' expression should match this loop's index, e.g. loop-index matches the index of a loop that iterates over a list variable.
      Parameters:
      input - the input to check
      Returns:
      true if the input matches the index loop, false otherwise
    • canIterateWithKeys

      static boolean canIterateWithKeys(Expression<?> expression)
      Checks if the given expression can be iterated with keys.
      Parameters:
      expression - the expression to check
      Returns:
      true if the expression can be iterated with keys, false otherwise
      See Also: