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 AString
append(char charValue)
protected abstract void
appendToStringBuffer(StringBuilder sb, int start, int length)
int
long
count()
Returns the number of elements in this data structureempty()
int
encode(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 collectionbyte
getTag()
Gets the tag byte for this cell.getType()
Gets the most specific known runtime Type for this Cell.int
length()
void
print(StringBuilder sb)
Prints this Object to a readable String Representationabstract AString
subSequence(int start, int end)
toString()
Returns the String representation of this Cell.Methods inherited from class convex.core.data.ACountable
isEmpty, size
Methods 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, write
Methods inherited from class convex.core.data.AObject
attachEncoding, print
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
charAt, chars, codePoints, isEmpty
Methods 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:ACell
Gets the most specific known runtime Type for this Cell. -
print
Description copied from class:AObject
Prints this Object to a readable String Representation -
length
public int length()- Specified by:
length
in interfaceCharSequence
-
count
public long count()Description copied from class:ACountable
Returns the number of elements in this data structure- Specified by:
count
in classACountable<CVMChar>
- Returns:
- Number of elements in this collection.
-
empty
-
append
-
get
Description copied from class:ACountable
Gets the element at the specified index in this collection- Specified by:
get
in classACountable<CVMChar>
- Parameters:
i
- Index of element to get- Returns:
- Element at the specified index
-
getElementRef
Description copied from class:ACountable
Gets a Ref to the element at the specified index in this collection- Specified by:
getElementRef
in classACountable<CVMChar>
- Parameters:
i
- Index of element to get- Returns:
- Element at the specified index
-
compareTo
- Specified by:
compareTo
in interfaceComparable<AString>
-
toString
Description copied from class:ACell
Returns 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:
toString
in interfaceCharSequence
- Overrides:
toString
in classACell
-
appendToStringBuffer
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
encode
public int encode(byte[] bs, int pos)Description copied from class:ACell
Writes this Cell's encoding to a byte array, including a tag byte which will be written first- Specified by:
encode
in interfaceIWriteable
- Specified by:
encode
in 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:ACell
Gets the tag byte for this cell. The tag byte is always written as the first byte of the Cell's Encoding
-