Package convex.core.data
Class AString
- All Implemented Interfaces:
IValidated,IWriteable,CharSequence,Comparable<AString>
- Direct Known Subclasses:
StringShort,StringSlice,StringTree
public abstract class AString
extends ACountable<CVMChar>
implements CharSequence, Comparable<AString>
Class representing a CVM String
-
Field Summary
FieldsFields inherited from class convex.core.data.ACell
cachedRef, EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AStringappend(char charValue)protected abstract voidappendToStringBuffer(StringBuilder sb, int start, int length)intlongcount()Returns the number of elements in this data structureempty()intencode(byte[] bs, int pos)Writes this Cell's encoding to a byte array, including a tag byte which will be written firstget(long i)Gets the element at the specified index in this collectiongetElementRef(long i)Gets a Ref to the element at the specified index in this collectionbytegetTag()Gets the tag byte for this cell.getType()Gets the most specific known runtime Type for this Cell.intlength()voidprint(StringBuilder sb)Prints this Object to a readable String Representationabstract AStringsubSequence(int start, int end)toString()Returns the String representation of this Cell.Methods inherited from class convex.core.data.ACountable
isEmpty, sizeMethods inherited from class convex.core.data.ACell
announce, announce, attachMemorySize, attachRef, cachedEncoding, cachedHash, calcMemorySize, createAnnounced, createEncoding, createPersisted, createPersisted, createRef, encodeRaw, equals, equals, getChildRefs, getEncoding, getEncodingLength, getHash, getMemorySize, getRef, getRef, getRefCount, hashCode, isCanonical, isCVMValue, isEmbedded, toCanonical, updateRefs, validate, validateCell, writeMethods inherited from class convex.core.data.AObject
attachEncoding, printMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
charAt, chars, codePoints, isEmptyMethods inherited from interface convex.core.data.IWriteable
estimatedEncodingSize
-
Field Details
-
length
protected int length
-
-
Constructor Details
-
AString
protected AString(int length)
-
-
Method Details
-
getType
Description copied from class:ACellGets the most specific known runtime Type for this Cell. -
print
Description copied from class:AObjectPrints this Object to a readable String Representation -
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
count
public long count()Description copied from class:ACountableReturns the number of elements in this data structure- Specified by:
countin classACountable<CVMChar>- Returns:
- Number of elements in this collection.
-
empty
-
append
-
get
Description copied from class:ACountableGets the element at the specified index in this collection- Specified by:
getin classACountable<CVMChar>- Parameters:
i- Index of element to get- Returns:
- Element at the specified index
-
getElementRef
Description copied from class:ACountableGets a Ref to the element at the specified index in this collection- Specified by:
getElementRefin classACountable<CVMChar>- Parameters:
i- Index of element to get- Returns:
- Element at the specified index
-
compareTo
- Specified by:
compareToin interfaceComparable<AString>
-
toString
Description copied from class:ACellReturns the String representation of this Cell. The String representation is intended to be a easy-to-read textual representation of the Cell's data content.- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classACell
-
appendToStringBuffer
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
encode
public int encode(byte[] bs, int pos)Description copied from class:ACellWrites this Cell's encoding to a byte array, including a tag byte which will be written first- Specified by:
encodein interfaceIWriteable- Specified by:
encodein classACell- Parameters:
bs- A byte array to which to write the encodingpos- The offset into the byte array- Returns:
- New position after writing
-
getTag
public final byte getTag()Description copied from class:ACellGets the tag byte for this cell. The tag byte will be the first byte of the encoding
-