public class FurnitureCategory extends Object implements Comparable<FurnitureCategory>
Constructor and Description |
---|
FurnitureCategory(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(Object obj)
Returns
true if this category and the one in parameter have the same name. |
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. |
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(String name)
name
- the name of the category.public String getName()
public List<CatalogPieceOfFurniture> getFurniture()
public int getFurnitureCount()
public CatalogPieceOfFurniture getPieceOfFurniture(int index)
index
.public int getIndexOfPieceOfFurniture(CatalogPieceOfFurniture piece)
piece
of furniture.public boolean equals(Object obj)
true
if this category and the one in parameter have the same name.public int compareTo(FurnitureCategory category)
compareTo
in interface Comparable<FurnitureCategory>
© Copyrights 2006-2016 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License