org.gudy.azureus2.core3.category.impl
Class CategoryImpl

java.lang.Object
  extended by com.aelitis.azureus.core.tag.impl.TagBase
      extended by org.gudy.azureus2.core3.category.impl.CategoryImpl
All Implemented Interfaces:
TagDownload, TagFeature, TagFeatureExecOnAssign, TagFeatureFileLocation, TagFeatureLimits, TagFeatureNotifications, TagFeatureProperties, TagFeatureRateLimit, TagFeatureRSSFeed, TagFeatureRunState, TagFeatureTranscode, java.lang.Comparable, Category, SimpleTimer.TimerTickReceiver, Tag

public class CategoryImpl
extends TagBase
implements Category, java.lang.Comparable, TagDownload


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.aelitis.azureus.core.tag.TagFeatureProperties
TagFeatureProperties.TagProperty, TagFeatureProperties.TagPropertyListener
 
Field Summary
 
Fields inherited from class com.aelitis.azureus.core.tag.impl.TagBase
AT_BYTES_DOWN, AT_BYTES_UP, AT_CAN_BE_PUBLIC, AT_COLOR_ID, AT_DESCRIPTION, AT_EOA_PREFIX, AT_EOS_SCRIPT, AT_FL_COPY_COMP, AT_FL_COPY_COMP_OPT, AT_FL_INIT_LOC, AT_FL_INIT_LOC_OPT, AT_FL_MOVE_COMP, AT_FL_MOVE_COMP_OPT, AT_GROUP, AT_IMAGE_ID, AT_LIMIT_ORDERING, AT_MAX_TAGGABLES, AT_NOTIFICATION_POST, AT_ORIGINAL_NAME, AT_PROPERTY_PREFIX, AT_PUBLIC, AT_RATELIMIT_DOWN, AT_RATELIMIT_MAX_AGGREGATE_SR, AT_RATELIMIT_MAX_AGGREGATE_SR_ACTION, AT_RATELIMIT_MAX_AGGREGATE_SR_PRIORITY, AT_RATELIMIT_MAX_SR, AT_RATELIMIT_MAX_SR_ACTION, AT_RATELIMIT_MIN_SR, AT_RATELIMIT_UP, AT_RATELIMIT_UP_PRI, AT_REMOVAL_STRATEGY, AT_RSS_ENABLE, AT_VISIBLE, AT_XCODE_TARGET
 
Fields inherited from interface org.gudy.azureus2.core3.category.Category
AT_AUTO_TRANSCODE_TARGET, AT_RSS_GEN, AT_UPLOAD_PRIORITY, TYPE_ALL, TYPE_UNCATEGORIZED, TYPE_USER
 
Fields inherited from interface com.aelitis.azureus.core.tag.TagDownload
FEATURES
 
Fields inherited from interface com.aelitis.azureus.core.tag.Tag
TP_SETTINGS_REQUESTED
 
Fields inherited from interface com.aelitis.azureus.core.tag.TagFeatureRunState
RSC_ALL, RSC_NONE, RSC_PAUSE, RSC_RESUME, RSC_START, RSC_START_STOP_PAUSE, RSC_STOP, RSC_STOP_PAUSE
 
Fields inherited from interface com.aelitis.azureus.core.tag.TagFeatureRateLimit
AT_RATELIMIT_MAX_AGGREGATE_SR_PRIORITY_DEFAULT, SR_ACTION_PAUSE, SR_ACTION_QUEUE, SR_ACTION_STOP, SR_AGGREGATE_ACTION_DEFAULT, SR_INDIVIDUAL_ACTION_DEFAULT
 
Fields inherited from interface com.aelitis.azureus.core.tag.TagFeature
TF_EXEC_ON_ASSIGN, TF_FILE_LOCATION, TF_LIMITS, TF_NONE, TF_NOTIFICATIONS, TF_PROPERTIES, TF_RATE_LIMIT, TF_RSS_FEED, TF_RUN_STATE, TF_XCODE
 
Fields inherited from interface com.aelitis.azureus.core.tag.TagFeatureFileLocation
FL_BOTH, FL_DATA, FL_DEFAULT, FL_NONE, FL_TORRENT
 
Fields inherited from interface com.aelitis.azureus.core.tag.TagFeatureProperties
PR_CONSTRAINT, PR_TRACKER_TEMPLATES, PR_TRACKERS, PR_UNTAGGED, PT_BOOLEAN, PT_LONG, PT_STRING_LIST
 
Fields inherited from interface com.aelitis.azureus.core.tag.TagFeatureExecOnAssign
ACTION_DESTROY, ACTION_FORCE_START, ACTION_NONE, ACTION_NOT_FORCE_START, ACTION_PAUSE, ACTION_RESUME, ACTION_SCRIPT, ACTION_START, ACTION_STOP
 
Fields inherited from interface com.aelitis.azureus.core.tag.TagFeatureLimits
OP_ADDED_TO_VUZE, OP_ADED_TO_TAG, OP_DEFAULT, RS_ARCHIVE, RS_DEFAULT, RS_DELETE_FROM_COMPUTER, RS_MOVE_TO_OLD_TAG, RS_NONE, RS_REMOVE_FROM_LIBRARY
 
Fields inherited from interface com.aelitis.azureus.core.tag.TagFeatureNotifications
NOTIFY_NONE, NOTIFY_ON_ADD, NOTIFY_ON_REMOVE
 
Constructor Summary
CategoryImpl(CategoryManagerImpl manager, java.lang.String sName, int maxup, int maxdown, java.util.Map<java.lang.String,java.lang.String> _attributes)
           
CategoryImpl(CategoryManagerImpl manager, java.lang.String sName, int type, java.util.Map<java.lang.String,java.lang.String> _attributes)
           
 
Method Summary
 void addCategoryListener(CategoryListener l)
          Add a Category Listener
 void addManager(DownloadManagerState manager_state)
          Add a DownloadManager to this category.
 int compareTo(java.lang.Object b)
           
protected  void destroy()
           
 void dump(IndentWriter writer)
           
protected  java.util.Map<java.lang.String,java.lang.String> getAttributes()
           
 boolean getBooleanAttribute(java.lang.String name)
           
 boolean getCanBePublicDefault()
           
 java.util.List<DownloadManager> getDownloadManagers(java.util.List<DownloadManager> all_dms)
          Retrieve a list of DownloadManagers for this category
 int getDownloadSpeed()
           
 int getIntAttribute(java.lang.String name)
           
 java.lang.String getName()
          Retrieve the name of the category.
 boolean[] getPerformableOperations(int[] ops)
           
 int getRunStateCapabilities()
           
 java.lang.String getStringAttribute(java.lang.String name)
           
 int getTagCurrentDownloadRate()
           
 int getTagCurrentUploadRate()
           
 int getTagDownloadLimit()
           
 int getTaggableTypes()
           
 java.util.Set<Taggable> getTagged()
           
 int getTaggedCount()
           
 java.util.Set<DownloadManager> getTaggedDownloads()
           
 java.lang.String getTagName(boolean localize)
           
 java.lang.String[] getTagTranscodeTarget()
           
 int getTagUploadLimit()
           
 int getTagUploadPriority()
           
 int getType()
          Retrieves what type of Category this is
 int getUploadSpeed()
           
 boolean hasCategoryListener(CategoryListener l)
           
 boolean hasRunStateCapability(int capability)
           
 boolean hasTaggable(Taggable t)
           
 void performOperation(int op)
           
 void removeCategoryListener(CategoryListener l)
          Remove a Category Listener
 void removeManager(DownloadManagerState manager_state)
          Remove a DownloadManager object from this Category.
protected  void setAttributes(java.util.Map<java.lang.String,java.lang.String> a)
           
 void setBooleanAttribute(java.lang.String name, boolean value)
           
 void setDownloadSpeed(int speed)
           
 void setIntAttribute(java.lang.String name, int value)
           
 void setStringAttribute(java.lang.String name, java.lang.String value)
           
 void setTagDownloadLimit(int bps)
           
 void setTagTranscodeTarget(java.lang.String uid, java.lang.String display_name)
           
 void setTagUploadLimit(int bps)
           
 void setTagUploadPriority(int priority)
           
 void setUploadSpeed(int speed)
           
 boolean supportsTagDownloadLimit()
           
 boolean supportsTagRates()
           
 boolean supportsTagTranscode()
           
 boolean supportsTagUploadLimit()
           
 
Methods inherited from class com.aelitis.azureus.core.tag.impl.TagBase
addListener, addTag, addTaggable, addTagListener, canBePublic, checkMaximumTaggables, closing, createTagProperty, generate, getActionScript, getColor, getDescription, getGroup, getImageID, getManager, getMaximumTaggables, getOrdering, getPostingNotifications, getProperty, getPublicDefault, getRecentHistory, getRemovalStrategy, getSupportedActions, getSupportedProperties, getTag, getTagAggregateShareRatio, getTagCopyOnCompleteFolder, getTagCopyOnCompleteOptions, getTagDownloadTotal, getTaggableAddedTime, getTaggables, getTagID, getTagInitialSaveFolder, getTagInitialSaveOptions, getTagMaxAggregateShareRatio, getTagMaxAggregateShareRatioAction, getTagMaxAggregateShareRatioHasPriority, getTagMaxShareRatio, getTagMaxShareRatioAction, getTagMinShareRatio, getTagMoveOnCompleteFolder, getTagMoveOnCompleteOptions, getTagName, getTagNameRaw, getTagSessionDownloadTotal, getTagSessionDownloadTotalCurrent, getTagSessionUploadTotal, getTagSessionUploadTotalCurrent, getTagType, getTagUID, getTagUploadTotal, getTransientProperty, getVisibleDefault, initialized, isActionEnabled, isColorDefault, isPublic, isTagAuto, isTagRSSFeedEnabled, isVisible, readBooleanAttribute, readLongAttribute, readStringAttribute, readStringListAttribute, removeListener, removeTag, removeTaggable, removeTagListener, requestAttention, resetTagSessionDownloadTotal, resetTagSessionUploadTotal, setActionEnabled, setActionScript, setCanBePublic, setColor, setDescription, setGroup, setImageID, setMaximumTaggables, setOrdering, setPostingNotifications, setPublic, setRecentHistoryRetention, setRemovalStrategy, setTagCopyOnCompleteFolder, setTagCopyOnCompleteOptions, setTagInitialSaveFolder, setTagInitialSaveOptions, setTagMaxAggregateShareRatio, setTagMaxAggregateShareRatioAction, setTagMaxAggregateShareRatioHasPriority, setTagMaxShareRatio, setTagMaxShareRatioAction, setTagMinShareRatio, setTagMoveOnCompleteFolder, setTagMoveOnCompleteOptions, setTagName, setTagRSSFeedEnabled, setTransientProperty, setVisible, supportsAction, supportsTagCopyOnComplete, supportsTagInitialSaveFolder, supportsTagMoveOnComplete, sync, tick, writeBooleanAttribute, writeLongAttribute, writeStringAttribute, writeStringListAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.aelitis.azureus.core.tag.Tag
addTaggable, addTagListener, canBePublic, getColor, getDescription, getGroup, getImageID, getTaggableAddedTime, getTagID, getTagType, getTagUID, getTransientProperty, isPublic, isTagAuto, isVisible, removeTag, removeTaggable, removeTagListener, requestAttention, setCanBePublic, setColor, setDescription, setGroup, setImageID, setPublic, setTagName, setTransientProperty, setVisible
 
Methods inherited from interface org.gudy.azureus2.plugins.tag.Tag
addListener, getTaggables, getTagName, removeListener
 
Methods inherited from interface com.aelitis.azureus.core.tag.TagFeatureRSSFeed
isTagRSSFeedEnabled, setTagRSSFeedEnabled
 
Methods inherited from interface com.aelitis.azureus.core.tag.TagFeatureRateLimit
getRecentHistory, getTagAggregateShareRatio, getTagDownloadTotal, getTagMaxAggregateShareRatio, getTagMaxAggregateShareRatioAction, getTagMaxAggregateShareRatioHasPriority, getTagMaxShareRatio, getTagMaxShareRatioAction, getTagMinShareRatio, getTagSessionDownloadTotal, getTagSessionUploadTotal, getTagUploadTotal, resetTagSessionDownloadTotal, resetTagSessionUploadTotal, setRecentHistoryRetention, setTagMaxAggregateShareRatio, setTagMaxAggregateShareRatioAction, setTagMaxAggregateShareRatioHasPriority, setTagMaxShareRatio, setTagMaxShareRatioAction, setTagMinShareRatio
 
Methods inherited from interface com.aelitis.azureus.core.tag.TagFeature
getTag
 
Methods inherited from interface com.aelitis.azureus.core.tag.TagFeatureFileLocation
getTagCopyOnCompleteFolder, getTagCopyOnCompleteOptions, getTagInitialSaveFolder, getTagInitialSaveOptions, getTagMoveOnCompleteFolder, getTagMoveOnCompleteOptions, setTagCopyOnCompleteFolder, setTagCopyOnCompleteOptions, setTagInitialSaveFolder, setTagInitialSaveOptions, setTagMoveOnCompleteFolder, setTagMoveOnCompleteOptions, supportsTagCopyOnComplete, supportsTagInitialSaveFolder, supportsTagMoveOnComplete
 
Methods inherited from interface com.aelitis.azureus.core.tag.TagFeatureProperties
getProperty, getSupportedProperties
 
Methods inherited from interface com.aelitis.azureus.core.tag.TagFeatureExecOnAssign
getActionScript, getSupportedActions, isActionEnabled, setActionEnabled, setActionScript, supportsAction
 
Methods inherited from interface com.aelitis.azureus.core.tag.TagFeatureLimits
getMaximumTaggables, getOrdering, getRemovalStrategy, setMaximumTaggables, setOrdering, setRemovalStrategy
 
Methods inherited from interface com.aelitis.azureus.core.tag.TagFeatureNotifications
getPostingNotifications, setPostingNotifications
 

Constructor Detail

CategoryImpl

public CategoryImpl(CategoryManagerImpl manager,
                    java.lang.String sName,
                    int maxup,
                    int maxdown,
                    java.util.Map<java.lang.String,java.lang.String> _attributes)

CategoryImpl

public CategoryImpl(CategoryManagerImpl manager,
                    java.lang.String sName,
                    int type,
                    java.util.Map<java.lang.String,java.lang.String> _attributes)
Method Detail

addCategoryListener

public void addCategoryListener(CategoryListener l)
Description copied from interface: Category
Add a Category Listener

Specified by:
addCategoryListener in interface Category
Parameters:
l - Listener to add

removeCategoryListener

public void removeCategoryListener(CategoryListener l)
Description copied from interface: Category
Remove a Category Listener

Specified by:
removeCategoryListener in interface Category
Parameters:
l - Listener to remove

hasCategoryListener

public boolean hasCategoryListener(CategoryListener l)
Specified by:
hasCategoryListener in interface Category

getName

public java.lang.String getName()
Description copied from interface: Category
Retrieve the name of the category. All category names are unique.

Specified by:
getName in interface Category
Returns:
If type is TYPE_USER, returns name of the category Otherwise, returns ID in MessageBundle.

getType

public int getType()
Description copied from interface: Category
Retrieves what type of Category this is

Specified by:
getType in interface Category
Returns:
TYPE_* constant

getDownloadManagers

public java.util.List<DownloadManager> getDownloadManagers(java.util.List<DownloadManager> all_dms)
Description copied from interface: Category
Retrieve a list of DownloadManagers for this category

Specified by:
getDownloadManagers in interface Category
Returns:
DownloadManager List

addManager

public void addManager(DownloadManagerState manager_state)
Description copied from interface: Category
Add a DownloadManager to this category. Used by DownloadManager. You should not have to add a DownloadManager object manually. If you wish to change a DownloadManager's category, use DownloadManager.setCategory(..) instead.

Specified by:
addManager in interface Category
Parameters:
manager_state - DownloadManager object to add to Category

removeManager

public void removeManager(DownloadManagerState manager_state)
Description copied from interface: Category
Remove a DownloadManager object from this Category. Used by DownloadManager. You should not have to add a DownloadManager object manually. If you wish to change a DownloadManager's category, use DownloadManager.setCategory(..) instead.

Specified by:
removeManager in interface Category
Parameters:
manager_state - DownloadManager object to remove from Category

setDownloadSpeed

public void setDownloadSpeed(int speed)
Specified by:
setDownloadSpeed in interface Category

getDownloadSpeed

public int getDownloadSpeed()
Specified by:
getDownloadSpeed in interface Category

setUploadSpeed

public void setUploadSpeed(int speed)
Specified by:
setUploadSpeed in interface Category

getUploadSpeed

public int getUploadSpeed()
Specified by:
getUploadSpeed in interface Category

setAttributes

protected void setAttributes(java.util.Map<java.lang.String,java.lang.String> a)

getAttributes

protected java.util.Map<java.lang.String,java.lang.String> getAttributes()

getStringAttribute

public java.lang.String getStringAttribute(java.lang.String name)
Specified by:
getStringAttribute in interface Category

setStringAttribute

public void setStringAttribute(java.lang.String name,
                               java.lang.String value)
Specified by:
setStringAttribute in interface Category

getIntAttribute

public int getIntAttribute(java.lang.String name)
Specified by:
getIntAttribute in interface Category

setIntAttribute

public void setIntAttribute(java.lang.String name,
                            int value)
Specified by:
setIntAttribute in interface Category

getBooleanAttribute

public boolean getBooleanAttribute(java.lang.String name)
Specified by:
getBooleanAttribute in interface Category

setBooleanAttribute

public void setBooleanAttribute(java.lang.String name,
                                boolean value)
Specified by:
setBooleanAttribute in interface Category

getTaggableTypes

public int getTaggableTypes()

getTagName

public java.lang.String getTagName(boolean localize)
Overrides:
getTagName in class TagBase

supportsTagRates

public boolean supportsTagRates()
Specified by:
supportsTagRates in interface TagFeatureRateLimit

supportsTagUploadLimit

public boolean supportsTagUploadLimit()
Specified by:
supportsTagUploadLimit in interface TagFeatureRateLimit

supportsTagDownloadLimit

public boolean supportsTagDownloadLimit()
Specified by:
supportsTagDownloadLimit in interface TagFeatureRateLimit

getTagUploadLimit

public int getTagUploadLimit()
Specified by:
getTagUploadLimit in interface TagFeatureRateLimit

setTagUploadLimit

public void setTagUploadLimit(int bps)
Specified by:
setTagUploadLimit in interface TagFeatureRateLimit

getTagCurrentUploadRate

public int getTagCurrentUploadRate()
Specified by:
getTagCurrentUploadRate in interface TagFeatureRateLimit

getTagDownloadLimit

public int getTagDownloadLimit()
Specified by:
getTagDownloadLimit in interface TagFeatureRateLimit

setTagDownloadLimit

public void setTagDownloadLimit(int bps)
Specified by:
setTagDownloadLimit in interface TagFeatureRateLimit

getTagCurrentDownloadRate

public int getTagCurrentDownloadRate()
Specified by:
getTagCurrentDownloadRate in interface TagFeatureRateLimit

getTagUploadPriority

public int getTagUploadPriority()
Specified by:
getTagUploadPriority in interface TagFeatureRateLimit

setTagUploadPriority

public void setTagUploadPriority(int priority)
Specified by:
setTagUploadPriority in interface TagFeatureRateLimit

getCanBePublicDefault

public boolean getCanBePublicDefault()
Overrides:
getCanBePublicDefault in class TagBase

supportsTagTranscode

public boolean supportsTagTranscode()
Specified by:
supportsTagTranscode in interface TagFeatureTranscode

getTagTranscodeTarget

public java.lang.String[] getTagTranscodeTarget()
Specified by:
getTagTranscodeTarget in interface TagFeatureTranscode

setTagTranscodeTarget

public void setTagTranscodeTarget(java.lang.String uid,
                                  java.lang.String display_name)
Specified by:
setTagTranscodeTarget in interface TagFeatureTranscode

getTaggedDownloads

public java.util.Set<DownloadManager> getTaggedDownloads()
Specified by:
getTaggedDownloads in interface TagDownload

getTagged

public java.util.Set<Taggable> getTagged()

getTaggedCount

public int getTaggedCount()

hasTaggable

public boolean hasTaggable(Taggable t)

getRunStateCapabilities

public int getRunStateCapabilities()
Specified by:
getRunStateCapabilities in interface TagFeatureRunState

hasRunStateCapability

public boolean hasRunStateCapability(int capability)
Specified by:
hasRunStateCapability in interface TagFeatureRunState

getPerformableOperations

public boolean[] getPerformableOperations(int[] ops)
Specified by:
getPerformableOperations in interface TagFeatureRunState

performOperation

public void performOperation(int op)
Specified by:
performOperation in interface TagFeatureRunState

destroy

protected void destroy()
Overrides:
destroy in class TagBase

compareTo

public int compareTo(java.lang.Object b)
Specified by:
compareTo in interface java.lang.Comparable

dump

public void dump(IndentWriter writer)
Specified by:
dump in interface Category