Enum Class ItemSimilarityWeights
- All Implemented Interfaces:
Serializable, Comparable<ItemSimilarityWeights>, Constable
The
ItemSimilarityWeights enum defines the weights used for calculating item similarity based on different attributes. Each constant represents a specific attribute and its associated weight, which indicates the importance of that attribute in the similarity calculation.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe weight for the category attribute when calculating item similarity.The weight for the date added attribute when calculating item similarity.The weight for the description attribute when calculating item similarity.The weight for the name attribute when calculating item similarity.The weight for the photo author attribute when calculating item similarity.The weight for the price attribute when calculating item similarity.The weight for the publisher attribute when calculating item similarity.The weight for the review score attribute when calculating item similarity.The weight for the tags attribute when calculating item similarity. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatThe weight associated with the attribute for similarity calculation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateItemSimilarityWeights(float weight) Constructor for theItemSimilarityWeightsenum. -
Method Summary
Modifier and TypeMethodDescriptionfloatRetrieves the weight associated with the attribute for similarity calculation.static ItemSimilarityWeightsReturns the enum constant of this class with the specified name.static ItemSimilarityWeights[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NAME
The weight for the name attribute when calculating item similarity. -
PUBLISHER
The weight for the publisher attribute when calculating item similarity. -
DESCRIPTION
The weight for the description attribute when calculating item similarity. -
CATEGORY
The weight for the category attribute when calculating item similarity. -
TAGS
The weight for the tags attribute when calculating item similarity. -
PHOTO_AUTHOR
The weight for the photo author attribute when calculating item similarity. -
PRICE
The weight for the price attribute when calculating item similarity. -
REVIEW_SCORE
The weight for the review score attribute when calculating item similarity. -
DATE_ADDED
The weight for the date added attribute when calculating item similarity.
-
-
Field Details
-
weight
private final float weightThe weight associated with the attribute for similarity calculation.
-
-
Constructor Details
-
ItemSimilarityWeights
private ItemSimilarityWeights(float weight) Constructor for theItemSimilarityWeightsenum.- Parameters:
weight- The weight to associate with the attribute for similarity calculation.
-
-
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
-
getWeight
public float getWeight()Retrieves the weight associated with the attribute for similarity calculation.- Returns:
- The weight of the attribute for similarity calculation.
-