Package com.biglybt.core.tag.impl
Class TagPropertyConstraintHandler
- java.lang.Object
-
- com.biglybt.core.tag.impl.TagPropertyConstraintHandler
-
- All Implemented Interfaces:
TagTypeListener
,DownloadListener
public class TagPropertyConstraintHandler extends java.lang.Object implements TagTypeListener, DownloadListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
TagPropertyConstraintHandler.TagConstraint
-
Nested classes/interfaces inherited from interface com.biglybt.core.tag.TagTypeListener
TagTypeListener.TagEvent
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Map<Tag,java.util.Map<DownloadManager,java.lang.Long>>
apply_history
private static java.util.Map<java.lang.String,java.lang.String>
comp_op_map
private static java.util.regex.Pattern
comp_op_pattern
private static java.lang.String
CONFIG_FLOAT
private static java.util.Map<java.lang.String,java.lang.String[]>
config_key_map
private static java.util.Map<java.lang.String,java.lang.Object[]>
config_value_cache
(package private) java.util.Map<Tag,TagPropertyConstraintHandler.TagConstraint>
constrained_tags
private Core
core
private AsyncDispatcher
dispatcher
private static java.lang.Object
DM_FILE_EXTS
private static java.lang.Object
DM_FILE_EXTS_SELECTED
private static java.lang.Object
DM_FILE_NAMES
private static java.lang.Object
DM_FILE_NAMES_SELECTED
private static java.lang.Object
DM_FILE_PATHS
private static java.lang.Object
DM_FILE_PATHS_SELECTED
private DownloadManagerListener
dm_listener
private boolean
dm_listener_added
private static java.lang.Object
DM_LISTENERS_ADDED
private static java.lang.Object
DM_PEER_SETS
private DownloadManagerStateAttributeListener
dms_listener
private static java.lang.String
EVAL_CTX_COLOURS
private FrequencyLimitedDispatcher
freq_lim_dispatcher
(package private) java.util.IdentityHashMap<DownloadManager,java.util.List<TagPropertyConstraintHandler.TagConstraint>>
freq_lim_pending
private boolean
initial_assignment_complete
private boolean
initialised
private static java.lang.Object
process_lock
private static int
processing_disabled_count
private static java.util.List<java.lang.Object[]>
processing_queue
private ShareManager
share_manager
private boolean
stopping
private TagManagerImpl
tag_manager
private TimerEventPeriodic
timer
-
Constructor Summary
Constructors Modifier Constructor Description private
TagPropertyConstraintHandler()
protected
TagPropertyConstraintHandler(Core _core, TagManagerImpl _tm)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
apply()
private void
apply(DownloadManager dm, Tag related_tag, boolean auto, boolean is_new)
private void
apply(TagPropertyConstraintHandler.TagConstraint constraint)
private void
apply(java.util.List<DownloadManager> dms, boolean initial_assignment)
private void
apply(java.util.List<DownloadManager> dms, java.util.List<TagPropertyConstraintHandler.TagConstraint> cons)
private static boolean
canProcess(TagPropertyConstraintHandler.TagConstraint constraint, DownloadManager dm, boolean is_new)
private static boolean
canProcess(TagPropertyConstraintHandler.TagConstraint constraint, java.util.List<DownloadManager> dms)
private void
checkDMListeners(DownloadManager dm)
private void
checkFreqLimUpdates()
private void
checkRecompiles()
private void
checkTimer()
TagPropertyConstraintHandler.TagConstraint
compileConstraint(java.lang.String expr)
protected java.lang.String
explain(Tag tag, Taggable taggable)
protected java.util.Set<Tag>
getDependsOnTags(Tag tag)
protected java.lang.String
getTagStatus(Tag tag)
private void
handleProperty(TagFeatureProperties.TagProperty property)
private boolean
isStopping()
void
positionChanged(Download download, int oldPosition, int newPosition)
Position of download has changed.void
setProcessingEnabled(boolean enabled)
void
stateChanged(Download download, int old_state, int new_state)
The Download's state has changed.void
tagAdded(Tag tag)
void
tagEventOccurred(TagTypeListener.TagEvent event)
void
tagRemoved(Tag tag)
void
tagTypeChanged(TagType tag_type)
General change not specific to one tag
-
-
-
Field Detail
-
DM_LISTENERS_ADDED
private static final java.lang.Object DM_LISTENERS_ADDED
-
DM_FILE_NAMES
private static final java.lang.Object DM_FILE_NAMES
-
DM_FILE_NAMES_SELECTED
private static final java.lang.Object DM_FILE_NAMES_SELECTED
-
DM_FILE_EXTS
private static final java.lang.Object DM_FILE_EXTS
-
DM_FILE_EXTS_SELECTED
private static final java.lang.Object DM_FILE_EXTS_SELECTED
-
DM_FILE_PATHS
private static final java.lang.Object DM_FILE_PATHS
-
DM_FILE_PATHS_SELECTED
private static final java.lang.Object DM_FILE_PATHS_SELECTED
-
DM_PEER_SETS
private static final java.lang.Object DM_PEER_SETS
-
EVAL_CTX_COLOURS
private static final java.lang.String EVAL_CTX_COLOURS
- See Also:
- Constant Field Values
-
core
private final Core core
-
tag_manager
private final TagManagerImpl tag_manager
-
share_manager
private final ShareManager share_manager
-
initialised
private volatile boolean initialised
-
initial_assignment_complete
private boolean initial_assignment_complete
-
stopping
private boolean stopping
-
constrained_tags
final java.util.Map<Tag,TagPropertyConstraintHandler.TagConstraint> constrained_tags
-
dm_listener_added
private boolean dm_listener_added
-
apply_history
final java.util.Map<Tag,java.util.Map<DownloadManager,java.lang.Long>> apply_history
-
dispatcher
private final AsyncDispatcher dispatcher
-
freq_lim_dispatcher
private final FrequencyLimitedDispatcher freq_lim_dispatcher
-
freq_lim_pending
final java.util.IdentityHashMap<DownloadManager,java.util.List<TagPropertyConstraintHandler.TagConstraint>> freq_lim_pending
-
dm_listener
private DownloadManagerListener dm_listener
-
dms_listener
private DownloadManagerStateAttributeListener dms_listener
-
timer
private TimerEventPeriodic timer
-
process_lock
private static java.lang.Object process_lock
-
processing_disabled_count
private static int processing_disabled_count
-
processing_queue
private static java.util.List<java.lang.Object[]> processing_queue
-
comp_op_pattern
private static java.util.regex.Pattern comp_op_pattern
-
comp_op_map
private static java.util.Map<java.lang.String,java.lang.String> comp_op_map
-
config_value_cache
private static java.util.Map<java.lang.String,java.lang.Object[]> config_value_cache
-
config_key_map
private static java.util.Map<java.lang.String,java.lang.String[]> config_key_map
-
CONFIG_FLOAT
private static final java.lang.String CONFIG_FLOAT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TagPropertyConstraintHandler
private TagPropertyConstraintHandler()
-
TagPropertyConstraintHandler
protected TagPropertyConstraintHandler(Core _core, TagManagerImpl _tm)
-
-
Method Detail
-
checkRecompiles
private void checkRecompiles()
-
setProcessingEnabled
public void setProcessingEnabled(boolean enabled)
-
canProcess
private static boolean canProcess(TagPropertyConstraintHandler.TagConstraint constraint, DownloadManager dm, boolean is_new)
-
canProcess
private static boolean canProcess(TagPropertyConstraintHandler.TagConstraint constraint, java.util.List<DownloadManager> dms)
-
checkDMListeners
private void checkDMListeners(DownloadManager dm)
-
tagTypeChanged
public void tagTypeChanged(TagType tag_type)
Description copied from interface:TagTypeListener
General change not specific to one tag- Specified by:
tagTypeChanged
in interfaceTagTypeListener
-
tagEventOccurred
public void tagEventOccurred(TagTypeListener.TagEvent event)
- Specified by:
tagEventOccurred
in interfaceTagTypeListener
-
tagAdded
public void tagAdded(Tag tag)
-
checkTimer
private void checkTimer()
-
checkFreqLimUpdates
private void checkFreqLimUpdates()
-
stateChanged
public void stateChanged(Download download, int old_state, int new_state)
Description copied from interface:DownloadListener
The Download's state has changed. This is also triggered if the user toggles the Force Start on/off.- Specified by:
stateChanged
in interfaceDownloadListener
-
positionChanged
public void positionChanged(Download download, int oldPosition, int newPosition)
Description copied from interface:DownloadListener
Position of download has changed.- Specified by:
positionChanged
in interfaceDownloadListener
- Parameters:
download
- object in which the position has changedoldPosition
- position that the download used to be atnewPosition
- position that the download is now at
-
getTagStatus
protected java.lang.String getTagStatus(Tag tag)
-
tagRemoved
public void tagRemoved(Tag tag)
-
isStopping
private boolean isStopping()
-
handleProperty
private void handleProperty(TagFeatureProperties.TagProperty property)
-
apply
private void apply(DownloadManager dm, Tag related_tag, boolean auto, boolean is_new)
-
apply
private void apply(java.util.List<DownloadManager> dms, boolean initial_assignment)
-
apply
private void apply(TagPropertyConstraintHandler.TagConstraint constraint)
-
apply
private void apply(java.util.List<DownloadManager> dms, java.util.List<TagPropertyConstraintHandler.TagConstraint> cons)
-
apply
private void apply()
-
compileConstraint
public TagPropertyConstraintHandler.TagConstraint compileConstraint(java.lang.String expr)
-
-