Package EDU.purdue.cs.bloat.editor
Class MemberRef
- java.lang.Object
-
- EDU.purdue.cs.bloat.editor.MemberRef
-
public class MemberRef extends java.lang.ObjectMemberRef represents a method or field (as a NameAndType) and the class (as a Type) in which it is declared.
-
-
Constructor Summary
Constructors Constructor Description MemberRef(Type declaringClass, NameAndType nameAndType)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypedeclaringClass()Get the type of the class which declared the member.booleanequals(java.lang.Object obj)Check if an object is equal to this reference.inthashCode()Hash the member reference.java.lang.Stringname()Get the name of the member.NameAndTypenameAndType()Get the name and type of the member.java.lang.StringtoString()Convert the reference to a string.Typetype()Get the type of the member.
-
-
-
Constructor Detail
-
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 Detail
-
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 java.lang.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 java.lang.String toString()
Convert the reference to a string.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the reference.
-
equals
public boolean equals(java.lang.Object obj)
Check if an object is equal to this reference.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- The object to compare against.- Returns:
- true if equal, false if not.
-
hashCode
public int hashCode()
Hash the member reference.- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code.
-
-