java.lang.Object
ch.tocco.nice2.conditionals.api.tree.Node
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConditionNode, FactorNode, IntegrationNode, LogicalNode

public abstract class Node extends Object implements Serializable
See Also:
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      protected void toString(Node.ToString toString)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • appendHash

      protected static int appendHash(int hash, Object of)
    • appendHash

      protected static int appendHash(int hash, boolean of)
    • copy

      public abstract Node copy()
    • copyTo

      protected void copyTo(Node toNode)
    • getKind

      public Node.Kind getKind()
    • allChildren

      public Iterable<Node> allChildren()
    • get

      @Nullable public <T> T get(Class<T> type)
    • get

      @Nullable public <T> T get(Class<T> type, @Nullable @Nullable Object key)
    • require

      public <T> T require(Class<T> type)
    • require

      public <T> T require(Class<T> type, @Nullable @Nullable Object key)
    • annotate

      public <T> T annotate(T value)
    • annotate

      @Nullable public <T> T annotate(@Nullable @Nullable Class<T> type, @Nullable T value)
    • annotate

      @Nullable public <T> T annotate(@Nullable @Nullable Class<T> type, @Nullable T value, boolean equalityRelevant)
    • annotate

      @Nullable public <T> T annotate(@Nullable @Nullable Class<T> type, @Nullable @Nullable Object key, @Nullable T value)
    • annotate

      @Nullable public <T> T annotate(@Nullable @Nullable Class<T> type, @Nullable @Nullable Object key, @Nullable T value, boolean equalityRelevant)
    • getAnnotations

      public Map<Node.AnnotationKey,Object> getAnnotations()
    • setFlag

      public void setFlag(Enum<?> flag, boolean value)
    • isFlagged

      public boolean isFlagged(Enum<?> flag)
    • getSource

      public String getSource()
    • setSource

      public void setSource(String source)
    • getStartLocation

      public Location getStartLocation()
    • setStartLocation

      public void setStartLocation(Location startLocation)
    • getEndLocation

      public Location getEndLocation()
    • setEndLocation

      public void setEndLocation(Location endLocation)
    • updateLocations

      public void updateLocations()
    • markErroneous

      public void markErroneous()
    • isErroneous

      public boolean isErroneous()
    • containsErroneous

      public boolean containsErroneous()
    • process

      public Node process(NodeVisitor visitor)
    • visitThis

      protected void visitThis(ch.tocco.nice2.conditionals.api.tree.CursorImpl cursor, NodeVisitor visitor)
    • dump

      public void dump(Appendable out) throws IOException
      Throws:
      IOException
    • dump

      public void dump(Appendable out, int depth) throws IOException
      Throws:
      IOException
    • setDeserializationTypeManager

      public static void setDeserializationTypeManager(TypeManager deserializationTypeManager)
      This is a thread local used during deserialization of nodes containing a type.
      Parameters:
      deserializationTypeManager - The type manager to use while deserializing nodes.
    • writeType

      protected static void writeType(ObjectOutputStream output, Type<?> type) throws IOException
      Throws:
      IOException
    • readType

      protected static Type<?> readType(ObjectInputStream input) throws ClassNotFoundException, IOException
      Throws:
      ClassNotFoundException
      IOException
    • and

      public static AndNode and()
    • or

      public static OrNode or()
    • not

      public static NotNode not()
    • not

      public static NotNode not(Node child)
    • identifier

      public static IdentifierNode identifier()
    • identifier

      public static IdentifierNode identifier(String name)
    • identifier

      public static IdentifierNode identifier(String name, boolean quoted)
    • identifier

      public static IdentifierNode identifier(Enum keyword)
    • path

      public static PathNode path()
    • path

      public static PathNode path(IdentifierNode firstElement)
    • parameter

      public static ParameterNode parameter()
    • parameter

      public static ParameterNode parameter(String name)
    • parameter

      public static ParameterNode parameter(String name, Type<?> type)
    • funcall

      public static FuncallNode funcall()
    • funcall

      public static FuncallNode funcall(PathNode path)
    • funcall

      public static FuncallNode funcall(PathNode path, Type<?> type)
    • funcall

      public static FuncallNode funcall(IdentifierNode identifier)
    • funcall

      public static FuncallNode funcall(Enum keyword)
    • funcall

      public static FuncallNode funcall(IdentifierNode identifier, Type<?> type)
    • funcall

      public static FuncallNode funcall(Enum keyword, Type<?> type)
    • literal

      public static LiteralNode literal(Type<?> type, Object value)
    • literal

      public static LiteralNode literal(Type<?> type, Object value, boolean inlineLiteral)
    • nullLiteral

      public static LiteralNode nullLiteral(Type<Void> type)
    • equation

      public static EquationNode equation()
    • equation

      public static EquationNode equation(EquationNode.Operator op)
    • equation

      public static EquationNode equation(FactorNode left, EquationNode.Operator op, FactorNode right)
    • isTrue

      public static IsTrueNode isTrue()
    • isTrue

      public static IsTrueNode isTrue(FactorNode factor)
    • isAnd

      public static boolean isAnd(Node node)
    • isOr

      public static boolean isOr(Node node)
    • isNot

      public static boolean isNot(Node node)
    • isIsTrue

      public static boolean isIsTrue(Node node)
    • isEquation

      public static boolean isEquation(Node node)
    • isLiteral

      public static boolean isLiteral(Node node)
    • isIdentifier

      public static boolean isIdentifier(Node node)
    • isFuncall

      public static boolean isFuncall(Node node)