| Constructor and Description |
|---|
Tags(Store store)
Creates a new
Tags object. |
| Modifier and Type | Method and Description |
|---|---|
int |
add(PCont tag)
Adds a protected content tag to this object.
|
int |
add(Tag tag)
Adds a tag to this collection.
|
Tag |
get(java.lang.CharSequence ctext,
int pos)
|
Tag |
get(int key)
|
Tag |
get(java.lang.String id,
TagType tagType)
Gets the tag for a given id and tag type.
|
Tag |
getClosingTag(java.lang.String id)
Gets the closing tag for a given tag ID.
|
Tag |
getClosingTag(Tag openingTag)
Gets the closing tag for a given opening tag.
|
CTag |
getCTag(java.lang.CharSequence ctext,
int pos)
Gets the
CTag for a given reference in a coded text. |
CTag |
getCTag(int key)
Gets the
CTag for a given key. |
int |
getKey(Tag tag)
Gets the key for a given code or marker.
|
MTag |
getMTag(java.lang.CharSequence ctext,
int pos)
Gets the
MTag for a given reference in a coded text. |
MTag |
getMTag(int key)
Gets the
MTag for a given key. |
CTag |
getOpeningCTag(java.lang.String id)
Gets the opening
CTag for a given id. |
MTag |
getOpeningMTag(java.lang.String id)
Gets the opening
MTag for a given id. |
Tag |
getOpeningTag(java.lang.String id)
Gets the opening tag for a given tag ID.
|
Tag |
getOpeningTag(Tag closingTag)
Gets the opening tag for a given closing tag.
|
PCont |
getPCont(java.lang.CharSequence ctext,
int pos)
Gets the
PCont for a given reference in a coded text. |
PCont |
getPCont(int key)
Gets the
PCont for a given key. |
int |
getPContCount()
Gets the number of protected content items in this object.
|
Store |
getStore()
Gets the store associated with this collection.
|
boolean |
hasCTagWithData()
Indicates if this collection of tags has at least one code with original data.
|
int |
hashCode() |
java.util.Iterator<Tag> |
iterator()
|
java.util.Iterator<PCont> |
iteratorPCont()
Creates an iterator for the
PCont objects in this collection. |
void |
remove(int key)
Removes a tag for a given key.
|
void |
removePCont(int key)
Removes the
PCont object for a given key. |
protected void |
resetPContLastValue() |
int |
size()
|
public int hashCode()
hashCode in class java.lang.Objectprotected void resetPContLastValue()
public boolean hasCTagWithData()
public Tag getClosingTag(Tag openingTag)
openingTag - the opening tag.public Tag getClosingTag(java.lang.String id)
id - the ID of the closing tag to search for.public Tag getOpeningTag(Tag closingTag)
closingTag - the closing tag.public Tag getOpeningTag(java.lang.String id)
id - the ID of the opening tag to search for.public CTag getOpeningCTag(java.lang.String id)
CTag for a given id.id - the ID of the opening tag to search for.CTag or null if no tag with the given ID is found.InvalidParameterException - if a tag is found but it is not a CTag object.public MTag getOpeningMTag(java.lang.String id)
MTag for a given id.id - the ID of the opening tag to search for.MTag or null if no tag with the given ID is found.InvalidParameterException - if a tag is found but it is not a MTag object.public int getPContCount()
public Store getStore()
public Tag get(int key)
key - the key of the annotation or code tag to retrieve.public Tag get(java.lang.CharSequence ctext, int pos)
ctext - the coded text (e.g. String or StringBuilder object).pos - the position of the first character of the reference.public CTag getCTag(int key)
CTag for a given key.key - the key of the code tag to retrieve.public CTag getCTag(java.lang.CharSequence ctext, int pos)
CTag for a given reference in a coded text.ctext - the coded text (e.g. String or StringBuilder object).pos - the position of the first character of the reference.public MTag getMTag(int key)
MTag for a given key.key - the key of the code tag to retrieve.public MTag getMTag(java.lang.CharSequence ctext, int pos)
MTag for a given reference in a coded text.ctext - the coded text (e.g. String or StringBuilder object).pos - the position of the first character of the reference.public Tag get(java.lang.String id, TagType tagType)
id - the id of the tag to retrieve.tagType - the tag type of the tag to retrieve.public PCont getPCont(int key)
PCont for a given key.key - the key of the protected content tag to retrieve.public PCont getPCont(java.lang.CharSequence ctext, int pos)
PCont for a given reference in a coded text.ctext - the coded text (e.g. String or StringBuilder object).pos - the position of the first character of the reference.public int getKey(Tag tag)
tag - the tag to lookup.public int add(Tag tag)
tag - the marker to add.public int add(PCont tag)
tag - the marker to add.public java.util.Iterator<Tag> iterator()
public java.util.Iterator<PCont> iteratorPCont()
PCont objects in this collection.PCont.public void remove(int key)
Warning: This method does not remove the corresponding tag reference in the coded text.
key - the key of the tag to remove.java.lang.IndexOutOfBoundsException - if the key is not found.public void removePCont(int key)
PCont object for a given key.
Warning: This method does not remove the corresponding reference in the coded text.
key - the key of the tag to remove.java.lang.IndexOutOfBoundsException - if the key is not found.