public class FurnitureCatalog
extends java.lang.Object
Constructor and Description |
---|
FurnitureCatalog() |
Modifier and Type | Method and Description |
---|---|
void |
add(FurnitureCategory category,
CatalogPieceOfFurniture piece)
Adds
piece of a given category to this catalog. |
void |
addFurnitureListener(CollectionListener<CatalogPieceOfFurniture> listener)
Adds the furniture
listener in parameter to this catalog. |
void |
delete(CatalogPieceOfFurniture piece)
Deletes the
piece from this catalog. |
java.util.List<FurnitureCategory> |
getCategories()
Returns the categories list sorted by name.
|
int |
getCategoriesCount()
Returns the count of categories in this catalog.
|
FurnitureCategory |
getCategory(int index)
Returns the category at a given
index . |
CatalogPieceOfFurniture |
getPieceOfFurnitureWithId(java.lang.String id)
Returns the piece of furniture with the given
id if it exists. |
void |
removeFurnitureListener(CollectionListener<CatalogPieceOfFurniture> listener)
Removes the furniture
listener in parameter from this catalog. |
public java.util.List<FurnitureCategory> getCategories()
public int getCategoriesCount()
public FurnitureCategory getCategory(int index)
index
.public void addFurnitureListener(CollectionListener<CatalogPieceOfFurniture> listener)
listener
in parameter to this catalog.public void removeFurnitureListener(CollectionListener<CatalogPieceOfFurniture> listener)
listener
in parameter from this catalog.public void add(FurnitureCategory category, CatalogPieceOfFurniture piece)
piece
of a given category
to this catalog.
Once the piece
is added, furniture listeners added to this catalog will receive a
collectionChanged
notification.category
- the category of the piece.piece
- a piece of furniture.public void delete(CatalogPieceOfFurniture piece)
piece
from this catalog.
If then piece category is empty, it will be removed from the categories of this catalog.
Once the piece
is deleted, furniture listeners added to this catalog will receive a
collectionChanged
notification.piece
- a piece of furniture in that category.public CatalogPieceOfFurniture getPieceOfFurnitureWithId(java.lang.String id)
id
if it exists.
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License