Class Method


public class Method extends TypeMember
UML representation of a method.
Author:
Sjoerd Talsma
  • Field Details

    • isAbstract

      public boolean isAbstract
      If this method is an abstract method.
  • Constructor Details

    • Method

      public Method(Type containingType, String name, TypeName returnType)
      Create a new method in the containing type with a specific name and return type.
      Parameters:
      containingType - The containing type the member is part of.
      name - The name of the method.
      returnType - The name of the return type.
  • Method Details

    • addParameter

      public void addParameter(String name, TypeName type)
      Add a parameter to this method.
      Parameters:
      name - The name of the parameter.
      type - The type of the parameter.
    • writeTo

      public <IPW extends IndentingPrintWriter> IPW writeTo(IPW output)
      Description copied from class: UMLNode
      Renders this object to the given indenting output.
      Overrides:
      writeTo in class TypeMember
      Type Parameters:
      IPW - The subclass of indenting print writer being written to.
      Parameters:
      output - The output to render this object to.
      Returns:
      A reference to the output for method chaining purposes.
    • writeParametersTo

      protected <IPW extends IndentingPrintWriter> IPW writeParametersTo(IPW output)
      Overrides:
      writeParametersTo in class TypeMember
    • writeTypeTo

      protected <IPW extends IndentingPrintWriter> IPW writeTypeTo(IPW output)
      Overrides:
      writeTypeTo in class TypeMember
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class TypeMember
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class TypeMember