public interface Chunking
Chunking interface specifies a set of chunks
over a shared underlying character sequence. Each chunk in
the chunk set should provide a valid slice of that character
sequence.
A simple mutable implementation of the Chunking
interface is provided by the ChunkingImpl class.
| Modifier and Type | Method and Description |
|---|---|
CharSequence |
charSequence()
Returns the character sequence underlying this chunking.
|
Set<Chunk> |
chunkSet()
Returns the chunks for this chunking.
|
boolean |
equals(Object that)
Returns
true if the specified object is a chunking
equal to this one. |
int |
hashCode()
Returns the hash code for this chunking.
|
Set<Chunk> chunkSet()
CharSequence charSequence()
boolean equals(Object that)
true if the specified object is a chunking
equal to this one. Equality for chunking is defined by
character sequence yield equality and chunk set equality.
Character sequences are tested for equality with Strings.equalCharSequence(CharSequence,CharSequence)
and chunks are compared as sets with elements tested for
equality using Chunk.equals(Object).
There is a utility implementation of this definition provided
for chunkings in ChunkingImpl.equal(Chunking,Chunking).int hashCode()
hashCode()
= Strings.hashCode(charSequence())
+ 31 * chunkSet().hashCode()
There is a utility implementation of this definition provided
for chunkings in ChunkingImpl.hashCode(Chunking).Copyright © 2019 Alias-i, Inc.. All rights reserved.