Top Description Fields Constructors Methods
org.eclipse.jgit.util

public final Class RawCharSequence

extends Object
implements CharSequence
Class Inheritance
All Implemented Interfaces
java.lang.CharSequence

A rough character sequence around a raw byte buffer.

Characters are assumed to be 8-bit US-ASCII.

Field Summary

Modifier and TypeField and Description
pack-priv final byte[]
public static final RawCharSequence
EMPTY

A zero-length character sequence.

pack-priv final int
pack-priv final int

Constructor Summary

AccessConstructor and Description
public
RawCharSequence(byte[]
buffer to scan.
buf
,
int
starting position for the sequence.
start
,
int
ending position for the sequence.
end
)

Create a rough character sequence around the raw byte buffer.

Method Summary

Modifier and TypeMethod and Description
public char
charAt(int
the index of the char value to be returned
index
)

Implements java.lang.CharSequence.charAt.

Returns the char value at the specified index.

public int
length()

Implements java.lang.CharSequence.length.

Returns the length of this character sequence.

public CharSequence
subSequence(int
the start index, inclusive
start
,
int
the end index, exclusive
end
)

Implements java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence.

public String
toString()

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString.

Returns a string containing the characters in this sequence in the same order as this sequence.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bufferback to summary
pack-priv final byte[] buffer
EMPTYback to summary
public static final RawCharSequence EMPTY

A zero-length character sequence.

endPtrback to summary
pack-priv final int endPtr
startPtrback to summary
pack-priv final int startPtr

Constructor Detail

RawCharSequenceback to summary
public RawCharSequence(byte[] buf, int start, int end)

Create a rough character sequence around the raw byte buffer.

Parameters
buf:byte[]

buffer to scan.

start:int

starting position for the sequence.

end:int

ending position for the sequence.

Method Detail

charAtback to summary
public char charAt(int index)

Implements java.lang.CharSequence.charAt.

Doc from java.lang.CharSequence.charAt.

Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Parameters
index:int

the index of the char value to be returned

Returns:char

the specified char value

Annotations
@Override
lengthback to summary
public int length()

Implements java.lang.CharSequence.length.

Doc from java.lang.CharSequence.length.

Returns the length of this character sequence. The length is the number of 16-bit chars in the sequence.

Returns:int

the number of chars in this sequence

Annotations
@Override
subSequenceback to summary
public CharSequence subSequence(int start, int end)

Implements java.lang.CharSequence.subSequence.

Doc from java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Parameters
start:int

the start index, inclusive

end:int

the end index, exclusive

Returns:CharSequence

the specified subsequence

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements java.lang.CharSequence.toString.

Doc from java.lang.CharSequence.toString.

Returns a string containing the characters in this sequence in the same order as this sequence. The length of the string will be the length of this sequence.

Returns:String

a string consisting of exactly this sequence of characters

Annotations
@Override