Package com.tagtraum.beatunes.matchtable
Class MatchRuleSet
- java.lang.Object
-
- com.tagtraum.beatunes.matchtable.MatchRuleSet
-
public class MatchRuleSet extends Object
MatchRuleSet.- Author:
- Hendrik Schreiber
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDefaultScoreRules()
void
addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
void
addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
ScoreRule
addScoreRule(String id)
Creates a new instance of the rule with the given id and adds it to this set.void
addSongFilter(SongPropertyFilter songFilter)
static MatchRuleSet
create(BeaTunes beaTunes)
static MatchRuleSet
create(BeaTunes beaTunes, long id)
long
getId()
String
getName()
List<ScoreRule>
getQuickMatchScoreRules()
The sorted list of score rules contained in this set, minus rules that shouldn't be used for quick matching.ScoreRule
getScoreRule(String id)
Get a rule for its id.List<ScoreRule>
getScoreRules()
The sorted list of score rules contained in this set.List<ScoreRule>
getScoreRulesInInsertionOrder()
Set<SongPropertyFilter>
getSongFilters()
float
getThreshold()
List<ScoreRule>
getUnusedScoreRules()
boolean
hasNonQuickMatchScoreRules()
boolean
isDeleted()
void
removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
void
removeScoreRule(ScoreRule scoreRule)
Removes a score rule should it exist.void
removeSongFilter(SongPropertyFilter songFilter)
void
setDeleted(boolean deleted)
void
setId(long id)
void
setName(String name)
void
setThreshold(float threshold)
String
toString()
-
-
-
Method Detail
-
getId
public long getId()
-
setId
public void setId(long id)
-
isDeleted
public boolean isDeleted()
-
setDeleted
public void setDeleted(boolean deleted)
-
create
public static MatchRuleSet create(BeaTunes beaTunes)
-
create
public static MatchRuleSet create(BeaTunes beaTunes, long id)
-
addScoreRule
public ScoreRule addScoreRule(String id)
Creates a new instance of the rule with the given id and adds it to this set.- Parameters:
id
- rule id- Returns:
- the newly created rule or null if the id does not refer to a valid rule.
-
removeScoreRule
public void removeScoreRule(ScoreRule scoreRule)
Removes a score rule should it exist. As sideeffect of the removal, a weight property change event is fired. The new weight is 0.- Parameters:
scoreRule
- score rule to remove
-
addPropertyChangeListener
public void addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
-
getName
public String getName()
-
setName
public void setName(String name)
-
getThreshold
public float getThreshold()
-
setThreshold
public void setThreshold(float threshold)
-
addSongFilter
public void addSongFilter(SongPropertyFilter songFilter)
- Parameters:
songFilter
- songfilter
-
removeSongFilter
public void removeSongFilter(SongPropertyFilter songFilter)
- Parameters:
songFilter
- songfilter
-
getSongFilters
public Set<SongPropertyFilter> getSongFilters()
-
getScoreRule
public ScoreRule getScoreRule(String id)
Get a rule for its id.- Parameters:
id
- rule id- Returns:
- rule or null
- See Also:
ScoreRule.getId()
-
getScoreRules
public List<ScoreRule> getScoreRules()
The sorted list of score rules contained in this set.- Returns:
- a list of scorerules sorted by their absolute weight, heaviest first.
-
getQuickMatchScoreRules
public List<ScoreRule> getQuickMatchScoreRules()
The sorted list of score rules contained in this set, minus rules that shouldn't be used for quick matching.- Returns:
- a list of scorerules sorted by their absolute weight, heaviest first.
- See Also:
ScoreRule.isIgnoredWhileQuickMatching()
-
hasNonQuickMatchScoreRules
public boolean hasNonQuickMatchScoreRules()
-
addDefaultScoreRules
public void addDefaultScoreRules()
-
-