Package com.biglybt.core.tag.impl
Class TagTypeBase
java.lang.Object
com.biglybt.core.tag.impl.TagTypeBase
- All Implemented Interfaces:
TagListener
,TagType
- Direct Known Subclasses:
CategoryManagerImpl
,OpenTorrentOptionsWindow.DiscoveredTag.TagTypeDiscovery
,TagTypeWithState
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final AtomicInteger
protected static final String
private static final TagManagerImpl
private Map
<String, TagTypeBase.TagGroupImpl> private final Map
<Taggable, List<TagListener>> private final int
private final int
private final String
private final AtomicInteger
private final ListenerManager
<TagTypeListener> private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private final String
Fields inherited from interface com.biglybt.core.tag.TagType
TT_DOWNLOAD_CATEGORY, TT_DOWNLOAD_INTERNAL, TT_DOWNLOAD_MANUAL, TT_DOWNLOAD_STATE, TT_PEER_IPSET, TT_SWARM_TAG, TT_TAG_SUGGESTION
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TagTypeBase
(int _tag_type, int _tag_features, String _tag_type_name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addTagListener
(Taggable taggable, TagListener listener) taggable-specific listneer for this tag-typeprotected void
void
addTagTypeListener
(TagTypeListener listener, boolean fire_for_existing) protected void
closing()
protected void
private void
protected void
void
generate
(IndentWriter writer) protected void
generateConfig
(IndentWriter writer, TagBase tag) int[]
protected TaggableResolver
getTag
(int tag_id) static int
protected TagGroup
getTagGroup
(String name) getTagsForTaggable
(Taggable taggable) int
Unique type denoting this species of taglong
getTagTypeName
(boolean localize) boolean
hasTagTypeFeature
(long feature) boolean
boolean
protected Boolean
readBooleanAttribute
(TagBase tag, String attr, Boolean def) protected Long
readLongAttribute
(TagBase tag, String attr, Long def) protected long[]
readLongListAttribute
(TagBase tag, String attr, long[] def) protected String
readStringAttribute
(TagBase tag, String attr, String def) protected String[]
readStringListAttribute
(TagBase tag, String attr, String[] def) void
protected void
removeTaggable
(TaggableResolver resolver, Taggable taggable) void
removeTagListener
(Taggable taggable, TagListener listener) void
void
removeTagTypeListener
(TagTypeListener listener) void
protected Taggable
protected void
setTagGroup
(Tag tag, String old_name, String new_name) private void
setTagGroupName
(TagTypeBase.TagGroupImpl old_group, String new_name) protected void
sync()
void
taggableAdded
(Tag tag, Taggable tagged) void
taggableRemoved
(Tag tag, Taggable tagged) void
taggableSync
(Tag tag) protected void
protected boolean
writeBooleanAttribute
(TagBase tag, String attr, Boolean value) protected boolean
writeLongAttribute
(TagBase tag, String attr, Long value) protected boolean
writeLongListAttribute
(TagBase tag, String attr, long[] value) protected void
protected boolean
writeStringAttribute
(TagBase tag, String attr, String value) protected boolean
writeStringListAttribute
(TagBase tag, String attr, String[] value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.tag.TagType
getTagCount, getTags
-
Field Details
-
AT_COLOR_ID
- See Also:
-
tag_type
private final int tag_type -
tag_type_features
private final int tag_type_features -
tag_type_name
-
TTL_ADD
private static final int TTL_ADD- See Also:
-
TTL_TAG_MEMBERHIP_CHANGE
private static final int TTL_TAG_MEMBERHIP_CHANGE- See Also:
-
TTL_TAG_METADATA_CHANGE
private static final int TTL_TAG_METADATA_CHANGE- See Also:
-
TTL_REMOVE
private static final int TTL_REMOVE- See Also:
-
TTL_TYPE_CHANGE
private static final int TTL_TYPE_CHANGE- See Also:
-
TTL_ATTENTION_REQUESTED
private static final int TTL_ATTENTION_REQUESTED- See Also:
-
manager
-
all_tags_or_tag_membership_mut
-
tags_or_tag_membership_mut
-
tt_listeners
-
tag_listeners
-
tag_groups
-
TTP_TAGS_FOR_TAGGABLE_CACHE
-
-
Constructor Details
-
TagTypeBase
-
-
Method Details
-
getTagAndTaggableMut
public static int getTagAndTaggableMut() -
addTagType
protected void addTagType() -
getTagManager
- Specified by:
getTagManager
in interfaceTagType
-
getResolver
-
resolveTaggable
-
removeTaggable
-
getTagType
public int getTagType()Description copied from interface:TagType
Unique type denoting this species of tag- Specified by:
getTagType
in interfaceTagType
- Returns:
-
getTagTypeName
- Specified by:
getTagTypeName
in interfaceTagType
-
isTagTypeAuto
public boolean isTagTypeAuto()- Specified by:
isTagTypeAuto
in interfaceTagType
-
isTagTypePersistent
public boolean isTagTypePersistent()- Specified by:
isTagTypePersistent
in interfaceTagType
-
getTagTypeFeatures
public long getTagTypeFeatures()- Specified by:
getTagTypeFeatures
in interfaceTagType
-
hasTagTypeFeature
public boolean hasTagTypeFeature(long feature) - Specified by:
hasTagTypeFeature
in interfaceTagType
-
fireChanged
protected void fireChanged() -
createTag
- Specified by:
createTag
in interfaceTagType
- Throws:
TagException
-
tagsOrMembershipChanged
protected void tagsOrMembershipChanged() -
addTag
-
removeTag
-
requestAttention
-
getColorDefault
public int[] getColorDefault()- Specified by:
getColorDefault
in interfaceTagType
-
sync
protected void sync() -
closing
protected void closing() -
getTag
-
getTag
-
getTagsForTaggable
- Specified by:
getTagsForTaggable
in interfaceTagType
-
fireMembershipChanged
-
fireMetadataChanged
-
removeTagType
public void removeTagType()- Specified by:
removeTagType
in interfaceTagType
-
addTagTypeListener
- Specified by:
addTagTypeListener
in interfaceTagType
-
removeTagTypeListener
- Specified by:
removeTagTypeListener
in interfaceTagType
-
taggableAdded
- Specified by:
taggableAdded
in interfaceTagListener
-
taggableSync
- Specified by:
taggableSync
in interfaceTagListener
-
taggableRemoved
- Specified by:
taggableRemoved
in interfaceTagListener
-
addTagListener
Description copied from interface:TagType
taggable-specific listneer for this tag-type- Specified by:
addTagListener
in interfaceTagType
- Parameters:
taggable
-listener
-
-
removeTagListener
- Specified by:
removeTagListener
in interfaceTagType
-
readBooleanAttribute
-
writeBooleanAttribute
-
readLongAttribute
-
writeLongAttribute
-
readStringAttribute
-
writeStringAttribute
- Returns:
- Whether attribute was changed from existing value
-
readMapAttribute
-
writeMapAttribute
-
readStringListAttribute
-
writeStringListAttribute
-
readLongListAttribute
-
writeLongListAttribute
-
setTagGroupName
-
setTagGroup
-
getTagGroup
-
generate
-
generateConfig
-