Package com.tangosol.util
Class AbstractByteSequence
- java.lang.Object
-
- com.tangosol.util.AbstractByteSequence
-
- All Implemented Interfaces:
ByteSequence
- Direct Known Subclasses:
AbstractByteSequence.AggregateByteSequence
,AbstractByteSequence.PartialByteSequence
public abstract class AbstractByteSequence extends Object implements ByteSequence
A simple base class for ByteSequence implementations.- Since:
- Coherence 3.7
- Author:
- cp 2010-06-29
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractByteSequence.AggregateByteSequence
A naive ByteSequence that glues two ByteSequence instances together.static class
AbstractByteSequence.PartialByteSequence
A naive ByteSequence that represents a portion of another ByteSequence.
-
Constructor Summary
Constructors Constructor Description AbstractByteSequence()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
ByteSequence
subSequence(int ofStart, int ofEnd)
Returns a newByteSequence
that is a subsequence of this sequence.Binary
toBinary()
Returns a Binary object that holds the contents of this ByteSequence.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tangosol.util.ByteSequence
byteAt, length
-
-
-
-
Method Detail
-
subSequence
public ByteSequence subSequence(int ofStart, int ofEnd)
Returns a newByteSequence
that is a subsequence of this sequence. The subsequence starts with thebyte
value at the specified index and ends with thebyte
value at index ofEnd - 1. The length (inbyte
s) of the returned sequence is ofEnd - ofStart, so if ofStart == ofEnd then an empty sequence is returned.- Specified by:
subSequence
in interfaceByteSequence
- Parameters:
ofStart
- the start index, inclusiveofEnd
- the end index, exclusive- Returns:
- the specified subsequence
-
toBinary
public Binary toBinary()
Returns a Binary object that holds the contents of this ByteSequence.- Specified by:
toBinary
in interfaceByteSequence
- Returns:
- the contents of this ByteSequence as a Binary object
-
-