Package org.noggit
Class CharArr
- java.lang.Object
-
- org.noggit.CharArr
-
- All Implemented Interfaces:
Appendable
,CharSequence
public class CharArr extends Object implements CharSequence, Appendable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Appendable
append(char c)
Appendable
append(CharSequence csq)
Appendable
append(CharSequence csq, int start, int end)
int
capacity()
The capacity of the buffer when empty (getArray().size())char
charAt(int index)
void
close()
int
fill()
void
flush()
char[]
getArray()
int
getEnd()
int
getStart()
int
length()
int
read()
int
read(char[] cbuf, int off, int len)
int
read(CharBuffer cb)
void
reserve(int num)
void
reset()
protected void
resize(int len)
void
set(char[] arr, int start, int end)
void
setEnd(int end)
void
setStart(int start)
int
size()
CharArr
subSequence(int start, int end)
char[]
toCharArray()
String
toString()
void
unsafeWrite(char b)
void
unsafeWrite(char[] b, int off, int len)
void
unsafeWrite(int b)
void
write(char b)
void
write(char[] b)
void
write(char[] b, int off, int len)
void
write(int b)
void
write(String s)
void
write(String s, int stringOffset, int len)
void
write(CharArr arr)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Method Detail
-
setStart
public void setStart(int start)
-
setEnd
public void setEnd(int end)
-
set
public void set(char[] arr, int start, int end)
-
getArray
public char[] getArray()
-
getStart
public int getStart()
-
getEnd
public int getEnd()
-
size
public int size()
-
length
public int length()
- Specified by:
length
in interfaceCharSequence
-
capacity
public int capacity()
The capacity of the buffer when empty (getArray().size())
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
subSequence
public CharArr subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
read
public int read() throws IOException
- Throws:
IOException
-
read
public int read(char[] cbuf, int off, int len)
-
unsafeWrite
public void unsafeWrite(char b)
-
unsafeWrite
public void unsafeWrite(int b)
-
unsafeWrite
public void unsafeWrite(char[] b, int off, int len)
-
resize
protected void resize(int len)
-
reserve
public void reserve(int num)
-
write
public void write(char b)
-
write
public final void write(int b)
-
write
public final void write(char[] b)
-
write
public void write(char[] b, int off, int len)
-
write
public final void write(CharArr arr)
-
write
public final void write(String s)
-
write
public void write(String s, int stringOffset, int len)
-
flush
public void flush()
-
reset
public final void reset()
-
close
public void close()
-
toCharArray
public char[] toCharArray()
-
toString
public String toString()
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
read
public int read(CharBuffer cb) throws IOException
- Throws:
IOException
-
fill
public int fill() throws IOException
- Throws:
IOException
-
append
public final Appendable append(CharSequence csq) throws IOException
- Specified by:
append
in interfaceAppendable
- Throws:
IOException
-
append
public Appendable append(CharSequence csq, int start, int end) throws IOException
- Specified by:
append
in interfaceAppendable
- Throws:
IOException
-
append
public final Appendable append(char c) throws IOException
- Specified by:
append
in interfaceAppendable
- Throws:
IOException
-
-