Class Category
public class Category
{
// Constructors
public Category(String name);
// Methods
public boolean equals(Category other);
public boolean equals(Object other);
public String getName();
public int hashCode();
public String toString();
}
This class provides an abstract type identity. Category objects are used to describe the types of objects that are supported by a MetaObject.
public Category(String name);
Creates a new Category object with the specified name.
Parameter | Description |
name
| The name for the new category.
|
public boolean equals(Category other);
Tests a category for equality with another category. Two categories are equal if they have the same name.
Return Value:
Returns true if other is not null and the two categories have the same name; otherwise, returns false.
Parameter | Description |
other
| The other Category object to test for equality.
|
public boolean equals(Object other);
Tests a category for equality with another object.
Return Value:
Returns true if the other object is a category and the two categories are equal; otherwise, returns false.
Parameter | Description |
other
| The other object to test for equality.
|
public String getName();
Retrieves the name of the category.
Return Value:
Returns a String that identifies the category.
public int hashCode();
Retrieves the category's hash code.
Return Value:
Returns an integer hash code for the category.
public String toString();
Produces a summary string for the category.
Return Value:
Returns a String that describes the category by using the name of the category.