Package io.keikai.doc.collab.structs
Class ContentType
- java.lang.Object
-
- io.keikai.doc.collab.structs.AbstractContent
-
- io.keikai.doc.collab.structs.ContentType
-
public class ContentType extends AbstractContent
-
-
Field Summary
Fields Modifier and Type Field Description static intYArrayRefIDstatic intYMapRefIDstatic intYTextRefIDstatic intYXmlElementRefIDstatic intYXmlFragmentRefIDstatic intYXmlHookRefIDstatic intYXmlTextRefID
-
Constructor Summary
Constructors Constructor Description ContentType(AbstractType type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentTypecopy()Creates a copy of this content.voiddelete(Transaction transaction)Deletes this content from a transaction.voidgc(StructStore store)Performs garbage collection on this content.java.util.List<java.lang.Object>getContent()intgetLength()intgetRef()AbstractTypegetType()voidintegrate(Transaction transaction, Item item)Integrates this content into a transaction.booleanisCountable()Should return false if this Item is some kind of meta information (e.g. format information)booleanmergeWith(AbstractContent right)Merges this content with another content.static ContentTypereadContentType(UpdateDecoder decoder)ContentTypesplice(int offset)Splices the content at the specified offset.voidwrite(UpdateEncoder encoder, int offset)Writes this content to an encoder.
-
-
-
Field Detail
-
YArrayRefID
public static final int YArrayRefID
- See Also:
- Constant Field Values
-
YMapRefID
public static final int YMapRefID
- See Also:
- Constant Field Values
-
YTextRefID
public static final int YTextRefID
- See Also:
- Constant Field Values
-
YXmlElementRefID
public static final int YXmlElementRefID
- See Also:
- Constant Field Values
-
YXmlFragmentRefID
public static final int YXmlFragmentRefID
- See Also:
- Constant Field Values
-
YXmlHookRefID
public static final int YXmlHookRefID
- See Also:
- Constant Field Values
-
YXmlTextRefID
public static final int YXmlTextRefID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ContentType
public ContentType(AbstractType type)
-
-
Method Detail
-
getType
public AbstractType getType()
-
getLength
public int getLength()
- Overrides:
getLengthin classAbstractContent- Returns:
- the length of the content
-
getContent
public java.util.List<java.lang.Object> getContent()
- Overrides:
getContentin classAbstractContent- Returns:
- the content as an array
-
isCountable
public boolean isCountable()
Description copied from class:AbstractContentShould return false if this Item is some kind of meta information (e.g. format information). * Whether this Item should be addressable via `yarray.get(i)` * Whether this Item should be counted when computing yarray.length- Overrides:
isCountablein classAbstractContent- Returns:
- true if the content is countable, false otherwise
-
copy
public ContentType copy()
Description copied from class:AbstractContentCreates a copy of this content.- Overrides:
copyin classAbstractContent- Returns:
- a new instance of AbstractContent
-
splice
public ContentType splice(int offset)
Description copied from class:AbstractContentSplices the content at the specified offset.- Overrides:
splicein classAbstractContent- Parameters:
offset- the offset at which to splice the content- Returns:
- a new instance of AbstractContent representing the spliced content
-
mergeWith
public boolean mergeWith(AbstractContent right)
Description copied from class:AbstractContentMerges this content with another content.- Overrides:
mergeWithin classAbstractContent- Parameters:
right- the content to merge with- Returns:
- true if the merge was successful, false otherwise
-
integrate
public void integrate(Transaction transaction, Item item)
Description copied from class:AbstractContentIntegrates this content into a transaction.- Overrides:
integratein classAbstractContent- Parameters:
transaction- the transaction to integrate intoitem- the item associated with this content
-
delete
public void delete(Transaction transaction)
Description copied from class:AbstractContentDeletes this content from a transaction.- Overrides:
deletein classAbstractContent- Parameters:
transaction- the transaction to delete from
-
gc
public void gc(StructStore store)
Description copied from class:AbstractContentPerforms garbage collection on this content.- Overrides:
gcin classAbstractContent- Parameters:
store- the store in which to perform garbage collection
-
write
public void write(UpdateEncoder encoder, int offset)
Description copied from class:AbstractContentWrites this content to an encoder.- Overrides:
writein classAbstractContent- Parameters:
encoder- the encoder to write tooffset- the offset at which to write
-
getRef
public int getRef()
- Overrides:
getRefin classAbstractContent- Returns:
- a reference ID for this content
-
readContentType
public static ContentType readContentType(UpdateDecoder decoder)
-
-