Sweet Home 3D 4.1

com.eteks.sweethome3d.model
Class FurnitureCategory

java.lang.Object
  extended by com.eteks.sweethome3d.model.FurnitureCategory
All Implemented Interfaces:
Comparable<FurnitureCategory>

public class FurnitureCategory
extends Object
implements Comparable<FurnitureCategory>

Category of furniture.

Author:
Emmanuel Puybaret

Constructor Summary
FurnitureCategory(String name)
          Create a category.
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FurnitureCategory

public FurnitureCategory(String name)
Create a category.

Parameters:
name - the name of the category.
Method Detail

getName

public String getName()
Returns the name of this category.


getFurniture

public List<CatalogPieceOfFurniture> getFurniture()
Returns the furniture list of this category sorted by name.

Returns:
an unmodifiable list of furniture.

getFurnitureCount

public int getFurnitureCount()
Returns the count of furniture in this category.


getPieceOfFurniture

public CatalogPieceOfFurniture getPieceOfFurniture(int index)
Returns the piece of furniture at a given index.


getIndexOfPieceOfFurniture

public int getIndexOfPieceOfFurniture(CatalogPieceOfFurniture piece)
Returns the index of the given piece of furniture.

Since:
3.6

equals

public boolean equals(Object obj)
Returns true if this category and the one in parameter have the same name.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(FurnitureCategory category)
Compares the names of this category and the one in parameter.

Specified by:
compareTo in interface Comparable<FurnitureCategory>

Sweet Home 3D 4.1

© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License