com.aliasi.chunk
Interface Chunking

All Known Implementing Classes:
ChunkingImpl

public interface Chunking

The 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.

Since:
LingPipe2.1
Version:
3.0
Author:
Bob Carpenter

Method Summary
 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.
 

Method Detail

chunkSet

Set<Chunk> chunkSet()
Returns the chunks for this chunking.

Returns:
The chunks for this chunking.

charSequence

CharSequence charSequence()
Returns the character sequence underlying this chunking.

Returns:
The character sequence underlying this set of chunks.

equals

boolean equals(Object that)
Returns 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).

Overrides:
equals in class Object
Parameters:
that - Object to compare.
Returns:
true if the specified object is a chunking equal to this one.

hashCode

int hashCode()
Returns the hash code for this chunking. Hash codes for chunkings are defined by:
 hashCode() 
   = Strings.hashCode(charSequence())
     + 31 * chunkSet().hashCode()
 
There is a utility implementation of this definition provided for chunkings in ChunkingImpl.hashCode(Chunking).

Overrides:
hashCode in class Object
Returns:
The hash code for this chunking.