Adds a tag to the set.

@param tag the tag to add
979853
public void addTag(TagValue tag) {
    //int pos = 0;
    //while (pos < tags.size() && tags.get(pos).getId() < tag.getId()) pos++;
    //tags.add(pos, tag);
    tags.add(tag);
    if (!hashTagsId.containsKey(tag.getId())) {
      hashTagsId.put(tag.getId(), tag);
    }
    Tag t = TiffTags.getTag(tag.getId());
    if (t != null) {
      if (hashTagsName.containsKey(t.getName())) {
        hashTagsName.put(t.getName(), tag);
      }
    }
  }
157139
public void setTags(java.util.Collection<Tag> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new java.util.ArrayList<Tag>(tags);
    }
870763
public final void removeElementsWithTag(@Nonnull String tag) {
        getElements().stream()
                .map(ElementView::getElement)
                .filter(e -> e.hasTag(tag))
                .forEach(this::removeElement);
    }
264733
public void setTag(String tagName, String tagValue) {
    if (tagValue == null) {
      tagValue = "";
    }
    tagTable.put(tagName, tagValue);
  }
601831
protected void appendTag(CharSequence tag) {
        final TagView newTag = new TagView(getContext(), TagView.STATE_NORMAL, tag);
        newTag.setOnClickListener(mInternalTagClickListener);
        addView(newTag);
    }
234209
public void addClassTag (String tag, Class type) {
		tagToClass.put(tag, type);
		classToTag.put(type, tag);
	}
1273512
public Builder tag(String tag) {
        ends.push("</" + tag + ">");
        html.a('<').a(tag).a('>');
        return this;
    }
771781
public void setTags(java.util.Collection<TagListEntry> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new java.util.ArrayList<TagListEntry>(tags);
    }
329071
public void setTags(String... tags) {
        removeAllViews();
        for (final String tag : tags) {
            appendTag(tag);
        }

        if (isAppendMode) {
            appendInputTag();
        }
    }
1158444
@Deprecated
	@Override
	public void setTag(final String tag) {
		ComponentModel model = getOrCreateComponentModel();
		model.setTag(tag);
	}
189368
public AffectedEntity withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
725750
public void setComments(String tag, List<String> comments) {
        String nt = normaliseTag(tag);
        if(this.comments.containsKey(nt)) {
            this.comments.remove(nt);
        }
        this.comments.put(nt, comments);
    }
230241
public void addTag(String tag) {
   		if (insertTagDb(tag)) {
   			this.tags.add(tag);
   			notifyEvent(HistoryReferenceEventPublisher.EVENT_TAG_ADDED);
   		}
   	}
434969
protected function insertTag(Tag $tag)
	{
		if (!$this->tagStackIsSorted)
		{
			$this->tagStack[] = $tag;
		}
		else
		{
			// Scan the stack and copy every tag to the next slot until we find the correct index
			$i = count($this->tagStack);
			while ($i > 0 && self::compareTags($this->tagStack[$i - 1], $tag) > 0)
			{
				$this->tagStack[$i] = $this->tagStack[$i - 1];
				--$i;
			}
			$this->tagStack[$i] = $tag;
		}
	}
661873
public void setTags(java.util.Collection<String> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new java.util.ArrayList<String>(tags);
    }
986044
public final void setTags(Map<String, String> tags) {
        Map<String, String> updatedTags = new TreeMap<>();

        if (tags != null) {
            for (Map.Entry<String, String> entry : tags.entrySet()) {
                String key = entry.getKey();

                requireArgument(!Metric.ReservedField.isReservedField(key), MessageFormat.format("Tag {0} is a reserved tag name.", key));
                updatedTags.put(key, entry.getValue());
            }
        }
        _tags.clear();
        _tags.putAll(updatedTags);
    }
1234295
public void reuse(Tag tag) {
	tag.release();
	Queue<Tag> queue = getQueue(tag.getClass().getName());
	queue.add(tag);
    }