public class FurnitureCategory extends java.lang.Object implements java.lang.Comparable<FurnitureCategory>
Constructor and Description |
---|
FurnitureCategory(java.lang.String name)
Create a category.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(FurnitureCategory category)
Compares the names of this category and the one in parameter.
|
boolean |
equals(java.lang.Object obj)
Returns
true if this category and the one in parameter have the same name. |
java.util.List<CatalogPieceOfFurniture> |
getFurniture()
Returns the furniture list of this category sorted by name.
|
int |
getFurnitureCount()
Returns the count of furniture in this category.
|
int |
getIndexOfPieceOfFurniture(CatalogPieceOfFurniture piece)
Returns the index of the given
piece of furniture. |
java.lang.String |
getName()
Returns the name of this category.
|
CatalogPieceOfFurniture |
getPieceOfFurniture(int index)
Returns the piece of furniture at a given
index . |
int |
hashCode() |
public FurnitureCategory(java.lang.String name)
name
- the name of the category.public java.lang.String getName()
public java.util.List<CatalogPieceOfFurniture> getFurniture()
public int getFurnitureCount()
public CatalogPieceOfFurniture getPieceOfFurniture(int index)
index
.public int getIndexOfPieceOfFurniture(CatalogPieceOfFurniture piece)
piece
of furniture.public boolean equals(java.lang.Object obj)
true
if this category and the one in parameter have the same name.equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(FurnitureCategory category)
compareTo
in interface java.lang.Comparable<FurnitureCategory>
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License