Package ch.njol.skript.lang
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
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether this expression can provide keys when iterated.static booleancanIterateWithKeys(Expression<?> expression) Checks if the given expression can be iterated with keys.default booleanisIndexLoop(String input) Checks whether the 'loop-...' expression should match this loop's index, e.g.default booleanChecks whether the given 'loop-...' expression should match this loop, e.g.keyedIterator(org.bukkit.event.Event event) Returns an iterator over the keyed values of this expression.default Stream<KeyedValue<T>> keyedStream(org.bukkit.event.Event event) Methods inherited from interface ch.njol.skript.lang.Debuggable
toString, toStringMethods inherited from interface ch.njol.skript.lang.Expression
acceptChange, beforeChange, canBeSingle, canReturn, change, changeInPlace, changeInPlace, check, check, getAcceptedChangeModes, getAll, getAnd, getArray, getConvertedExpression, getOptionalSingle, getReturnType, getSingle, getSource, getSyntaxTypeName, getTime, isDefault, isSingle, possibleReturnTypes, returnNestedStructures, returnsNestedStructures, setTime, simplify, stream, streamAllMethods inherited from interface ch.njol.skript.lang.Loopable
iterator, supportsLoopPeekingMethods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser, init, preInit
-
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
Returns an iterator over the keyed values of this expression.
This should only be called iffcanIterateWithKeys()returnstrue.- Parameters:
event- The event context- Returns:
- An iterator over the key-value pairs of this expression
-
keyedStream
-
isLoopOf
Description copied from interface:LoopableChecks 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.
-
isIndexLoop
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
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:
-