- All Implemented Interfaces:
Serializable,Comparable<WeightUnit>,Constable
The unit of a
WeightEntry, which helps determine how the weight is calculated. This unit is associated with
a number also in the weight entry.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe weight, which must represent a track, will show up a given number of times in the collection playing the weights, then played or shuffled as normal.The weight will be chosen a given percent of time every song is chosen from the collection playing the weight. -
Method Summary
Modifier and TypeMethodDescriptionstatic WeightUnitfromSymbol(String text) Gets theWeightUnitthat would be returned bygetStringUnit().Gets the string after the number of the weight unit, either"%"or"x".static WeightUnitReturns the enum constant of this class with the specified name.static WeightUnit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PERCENT
The weight will be chosen a given percent of time every song is chosen from the collection playing the weight. If all the weight entries in aweightsexpression have this unit, the percent must add up to exactly 100%. -
MULTIPLIER
The weight, which must represent a track, will show up a given number of times in the collection playing the weights, then played or shuffled as normal. This simply lets a track be played more often in a playlist than it usually would.
-
-
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
-
getStringUnit
Gets the string after the number of the weight unit, either"%"or"x".- Returns:
- The string unit of the weight
-
fromSymbol
Gets theWeightUnitthat would be returned bygetStringUnit(). An exception is thrown if it is not either"%"or"x".- Parameters:
text- The string unit of the weight, either"%"or"x"- Returns:
- The
WeightUnitfound
-