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 voidaddDefaultScoreRules()voidaddPropertyChangeListener(PropertyChangeListener propertyChangeListener)voidaddPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)ScoreRuleaddScoreRule(String id)Creates a new instance of the rule with the given id and adds it to this set.voidaddSongFilter(SongPropertyFilter songFilter)static MatchRuleSetcreate(BeaTunes beaTunes)static MatchRuleSetcreate(BeaTunes beaTunes, long id)longgetId()StringgetName()List<ScoreRule>getQuickMatchScoreRules()The sorted list of score rules contained in this set, minus rules that shouldn't be used for quick matching.ScoreRulegetScoreRule(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()floatgetThreshold()List<ScoreRule>getUnusedScoreRules()booleanhasNonQuickMatchScoreRules()booleanisDeleted()voidremovePropertyChangeListener(PropertyChangeListener propertyChangeListener)voidremoveScoreRule(ScoreRule scoreRule)Removes a score rule should it exist.voidremoveSongFilter(SongPropertyFilter songFilter)voidsetDeleted(boolean deleted)voidsetId(long id)voidsetName(String name)voidsetThreshold(float threshold)StringtoString()
-
-
-
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()
-
-