java.lang.Object
org.jpo.datamodel.Category
- All Implemented Interfaces:
Serializable
A class which represents a Category
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
This status represents the category being both selected and unselected at the same time used for situations where we have more than one category selected at a timestatic final int
This status represents the category as being selectedstatic final int
this status represents the category as being unselectedstatic final int
This status represents the category as being in undefined state -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetKey()
Returns the key of the Categoryint
Call this method to find out if the Category is selectedgetValue()
Returns the value of the Categoryvoid
Sets the key of the Categoryvoid
setStatus
(int newState) Call this method to set the state of the Category to selected or not selected.void
Sets the value of the CategorytoString()
Returns the value of the Category.
-
Field Details
-
UNDEFINED
public static final int UNDEFINEDThis status represents the category as being in undefined state- See Also:
-
SELECTED
public static final int SELECTEDThis status represents the category as being selected- See Also:
-
UN_SELECTED
public static final int UN_SELECTEDthis status represents the category as being unselected- See Also:
-
BOTH
public static final int BOTHThis status represents the category being both selected and unselected at the same time used for situations where we have more than one category selected at a time- See Also:
-
-
Constructor Details
-
Category
Constructs a new category for the key and value- Parameters:
key
- The numeric key for the categoryvalue
- the value
-
-
Method Details
-
getKey
Returns the key of the Category- Returns:
- They key of the Category
-
setKey
Sets the key of the Category- Parameters:
key
- The new key
-
setStatus
public void setStatus(int newState) Call this method to set the state of the Category to selected or not selected.- Parameters:
newState
- The new state
-
getStatus
public int getStatus()Call this method to find out if the Category is selected- Returns:
- true if it is selected, false if it is not selected or partially selected
-
getValue
Returns the value of the Category- Returns:
- They value of the Category
-
setValue
Sets the value of the Category- Parameters:
value
- The new value
-
toString
Returns the value of the Category.
-