Package sc2002.FCS1.grp2
Enum Class ListingFilter
- All Implemented Interfaces:
Serializable,Comparable<ListingFilter>,Constable
Enum representing different filters for listing.
Each enum value corresponds to a specific filter.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDefault constructor for ListingFilter.privateListingFilter(String keyword) Constructor for ListingFilter with a specific keyword. -
Method Summary
Modifier and TypeMethodDescriptionstatic ListingFilterfromString(String value) Converts a string to a ListingFilter enum value.Returns the keyword associated with this enum value.voidsetKeyword(String keyword) Sets the keyword for this enum value.toString()static ListingFilterReturns the enum constant of this class with the specified name.static ListingFilter[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
-
TWO_ROOM
-
THREE_ROOM
-
NAME
-
NEIGHBORHOOD
-
-
Field Details
-
keyword
The keyword associated with this enum value.
-
-
Constructor Details
-
ListingFilter
private ListingFilter()Default constructor for ListingFilter. Initializes the keyword to null. -
ListingFilter
Constructor for ListingFilter with a specific keyword.- Parameters:
keyword- the keyword associated with this enum value
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
setKeyword
Sets the keyword for this enum value.- Parameters:
keyword- the keyword to set
-
getKeyword
Returns the keyword associated with this enum value.- Returns:
- the keyword
-
toString
- Overrides:
toStringin classEnum<ListingFilter>
-
fromString
Converts a string to a ListingFilter enum value.- Parameters:
value-- Returns:
-