Package ntnu.team1.backend.objects
Class Category
java.lang.Object
ntnu.team1.backend.objects.Category
- All Implemented Interfaces:
Serializable
A class that represents a category
Implements serializable to be able to store the data
- See Also:
- Serialized Form
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
The method checks similarity: two Category objects are equal if their name and color are identical Identical similarity - two references to the same object Content similarity - the content of two objects is compared by category name and colorjavafx.scene.paint.Color
getColor()
Gets the category colorint
getID()
Gets the category idgetName()
Gets the namevoid
setColor(javafx.scene.paint.Color color)
Update the color of the category, sets it to int values.void
updates the name of the categorytoString()
To string for object
-
Constructor Details
-
Category
- Parameters:
ID
- Integer that represents the category`s IDcolor
- Color object that represents the color of the categoryname
- String that represents the name of the category
-
-
Method Details
-
getID
public int getID()Gets the category id- Returns:
- returns the ID of the category
-
getColor
public javafx.scene.paint.Color getColor()Gets the category color- Returns:
- returns the color of the category
-
getName
Gets the name- Returns:
- returns the name of the category.
-
setColor
public void setColor(javafx.scene.paint.Color color)Update the color of the category, sets it to int values. This gives us the ability to serialize the object- Parameters:
color
- Color
-
setName
updates the name of the category- Parameters:
name
- Name as a string
-
equals
The method checks similarity: two Category objects are equal if their name and color are identical Identical similarity - two references to the same object Content similarity - the content of two objects is compared by category name and color -
toString
To string for object
-