Skip to content

Commit e6dc0c7

Browse files
committed
Docs for Simplifiable
1 parent cf7fdb6 commit e6dc0c7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/main/java/org/skriptlang/skript/lang/simplification/Simplifiable.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
import ch.njol.skript.lang.SyntaxElement;
55
import org.bukkit.event.Event;
66

7+
/**
8+
* Represents an object that can be simplified to a simpler {@link SyntaxElement}. For example, a complex math equation
9+
* can be simplified to a single number {@link ch.njol.skript.lang.Literal} if all the inputs are
10+
* {@link ch.njol.skript.lang.Literal}s.
11+
* <br>
12+
* Simplification should never invalidate contracts. For example, any simplified expression should take care to return
13+
* the same or a more specific type than the original expression, never a more generic type. Likewise, be sure to
14+
* maintain the behavior of change() and acceptsChange(). Failure to do so can result in unexpected behavior and
15+
* tricky bugs.
16+
* @param <S> the type of the simplified object
17+
*/
718
public interface Simplifiable<S extends SyntaxElement> {
819

920
/**

0 commit comments

Comments
 (0)