Class GlslSwitchNode

java.lang.Object
io.github.ocelot.glslprocessor.api.node.branch.GlslSwitchNode
All Implemented Interfaces:
GlslNode

public final class GlslSwitchNode extends Object implements GlslNode
Switch statement.
Since:
1.0.0
  • Constructor Details

  • Method Details

    • getCondition

      public GlslNode getCondition()
      Returns:
      The condition inside the switch switch(condition) {}
    • getBranches

      public List<GlslNode> getBranches()
      Returns:
      All code inside the switch, including all labels and code under those labels
    • setCondition

      public GlslSwitchNode setCondition(GlslNode condition)
      Sets the input condition for this switch statement.
      Parameters:
      condition - The new condition to use
    • setBranches

      public GlslSwitchNode setBranches(Collection<GlslNode> branches)
      Replaces all branches with the specified values.
      Parameters:
      branches - The new branches
    • setBranches

      public GlslSwitchNode setBranches(GlslNode... branches)
      Replaces all branches with the specified values.
      Parameters:
      branches - The new branches
    • visit

      public void visit(GlslNodeVisitor visitor)
      Description copied from interface: GlslNode
      Visits this node.
      Specified by:
      visit in interface GlslNode
      Parameters:
      visitor - The visitor visiting this node
    • getNodeType

      public GlslNodeType getNodeType()
      Specified by:
      getNodeType in interface GlslNode
      Returns:
      The type of node this class represents
    • stream

      public Stream<GlslNode> stream()
      Specified by:
      stream in interface GlslNode
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object