Class GlslFunctionNode

java.lang.Object
io.github.ocelot.glslprocessor.api.node.function.GlslFunctionNode
All Implemented Interfaces:
GlslNode, GlslRootNode

public final class GlslFunctionNode extends Object implements GlslRootNode
Defines a function in a GLSL file with an optional body.
Since:
1.0.0
  • Constructor Details

  • Method Details

    • 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
    • getHeader

      public GlslFunctionHeader getHeader()
      Returns:
      The full signature of this function
    • getName

      @NotNull public @NotNull String getName()
      Specified by:
      getName in interface GlslRootNode
    • getReturnType

      public GlslSpecifiedType getReturnType()
      Returns:
      The return type of the function
    • getParameters

      public List<GlslParameterDeclaration> getParameters()
      Returns:
      The parameters of the function
    • getBody

      @Nullable public @Nullable GlslNodeList getBody()
      Specified by:
      getBody in interface GlslNode
      Returns:
      The body of this node or null if there is no sub-body in this node
    • setHeader

      public void setHeader(GlslFunctionHeader header)
      Sets the function header of this function to the specified value.
      Parameters:
      header - The new header
    • setName

      public GlslFunctionNode setName(@Nullable @Nullable String name)
      Specified by:
      setName in interface GlslRootNode
    • setBody

      public boolean setBody(@Nullable @Nullable Collection<GlslNode> body)
      Sets the body of this function or null to make this a function prototype.
      Specified by:
      setBody in interface GlslNode
      Parameters:
      body - The new function body
      Returns:
      Whether the action was successful
    • 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