|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.chunk.ChunkingImpl
public class ChunkingImpl
A ChunkingImpl provides a mutable, set-based
implementation of the chunking interface. At construction time, a
character sequence or slice is specified. Chunks may then be added
using the add(Chunk) method.
| Constructor Summary | |
|---|---|
ChunkingImpl(char[] cs,
int start,
int end)
Construct a chunking implementation to hold chunks over the specified character slice. |
|
ChunkingImpl(CharSequence cSeq)
Constructs a chunking implementation to hold chunks over the specified character sequence. |
|
| Method Summary | |
|---|---|
void |
add(Chunk chunk)
Add a chunk this this chunking. |
void |
addAll(Collection chunks)
Adds all of the chunks in the specified collection to this chunking. |
CharSequence |
charSequence()
Returns the character sequence underlying this chunking. |
Set<Chunk> |
chunkSet()
Returns the set of chunks for this chunking. |
static boolean |
equal(Chunking chunking1,
Chunking chunking2)
Returns true if the specified chunkings are equal. |
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. |
static int |
hashCode(Chunking chunking)
Returns the hash code for the specified chunking. |
String |
toString()
Returns a string-based representation of this chunking. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ChunkingImpl(CharSequence cSeq)
cSeq - Character sequence underlying the chunking.
public ChunkingImpl(char[] cs,
int start,
int end)
cs - Character array.start - Index in array of first element in chunk.end - Index in array of one past the last element in chunk.| Method Detail |
|---|
public void addAll(Collection chunks)
Chunk interface, an illegal argument exception is
thrown.
chunks - Chunks to add to this chunking.
IllegalArgumentException - If the collection contains an
object that does not implement Chunk.public void add(Chunk chunk)
chunk - Chunk to add to this chunking.
IllegalArgumentException - If the end point is beyond the
underlying character sequence.public CharSequence charSequence()
charSequence in interface Chunkingpublic Set<Chunk> chunkSet()
chunkSet in interface Chunkingpublic boolean equals(Object that)
Chunkingtrue 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 equal(Chunking,Chunking).
equals in interface Chunkingequals in class Objectthat - Object to compare.
true if the specified object is a chunking
equal to this one.public int hashCode()
Chunking
hashCode()
= Strings.hashCode(charSequence())
+ 31 * chunkSet().hashCode()
There is a utility implementation of this definition provided
for chunkings in hashCode(Chunking).
hashCode in interface ChunkinghashCode in class Object
public static boolean equal(Chunking chunking1,
Chunking chunking2)
true if the specified chunkings are equal.
Chunking equality is defined in Chunking.equals(Object)
to be equality of character sequence yields and equality of
chunk sets.
Warning: Equality is unstable if the chunkings change.
chunking1 - First chunking.chunking2 - Second chunking.
true if the chunkings are equal.public static int hashCode(Chunking chunking)
Chunking.hashCode().
Warning: Hash codes are unstable if the chunkings change.
chunking - Chunking whose hash code is returned.
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||