Class MemberRef

java.lang.Object
EDU.purdue.cs.bloat.editor.MemberRef

public class MemberRef extends Object
MemberRef represents a method or field (as a NameAndType) and the class (as a Type) in which it is declared.
  • Constructor Details

    • MemberRef

      public MemberRef(Type declaringClass, NameAndType nameAndType)
      Constructor.
      Parameters:
      declaringClass - The type of the class which declared the member.
      nameAndType - The name and type of the member.
  • Method Details

    • declaringClass

      public Type declaringClass()
      Get the type of the class which declared the member.
      Returns:
      The type of the class which declared the member.
    • name

      public String name()
      Get the name of the member.
      Returns:
      The name of the member.
    • type

      public Type type()
      Get the type of the member.
      Returns:
      The type of the member.
    • nameAndType

      public NameAndType nameAndType()
      Get the name and type of the member.
      Returns:
      The name and type of the member.
    • toString

      public String toString()
      Convert the reference to a string.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the reference.
    • equals

      public boolean equals(Object obj)
      Check if an object is equal to this reference.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare against.
      Returns:
      true if equal, false if not.
    • hashCode

      public int hashCode()
      Hash the member reference.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.