Interface IDocumentPartitioner
- All Known Subinterfaces:
- IConsoleDocumentPartitioner
- All Known Implementing Classes:
- DefaultPartitioner,- FastPartitioner,- RuleBasedPartitioner
 In order to provided backward compatibility for clients of IDocumentPartitioner, extension
 interfaces are used to provide a means of evolution. The following extension interfaces
 exist:
 
-  IDocumentPartitionerExtensionsince version 2.0 replacing thedocumentChangedmethod with a new one returning the minimal document region comprising all partition changes.
-  IDocumentPartitionerExtension2since version 3.0 introducing zero-length partitions in conjunction with the distinction between open and closed partitions. Also provides inside in the implementation of the partitioner by exposing the position category used for managing the partitioning information.
-  IDocumentPartitionerExtension3since version 3.1 introducing rewrite session. It also replaces the existingconnect(IDocument)method with a new one:IDocumentPartitionerExtension3.connect(IDocument, boolean).
 Clients may implement this interface and its extension interfaces or use the standard
 implementation FastPartitioner.
 
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptioncomputePartitioning(int offset, int length) Returns the partitioning of the given range of the connected document.voidConnects the partitioner to a document.voidDisconnects the partitioner from the document it is connected to.voidInforms about a forthcoming document change.booleandocumentChanged(DocumentEvent event) The document has been changed.getContentType(int offset) Returns the content type of the partition containing the given offset in the connected document.String[]Returns the set of all legal content types of this partitioner.getPartition(int offset) Returns the partition containing the given offset of the connected document.
- 
Method Details- 
connectConnects the partitioner to a document. Connect indicates the begin of the usage of the receiver as partitioner of the given document. Thus, resources the partitioner needs to be operational for this document should be allocated.The caller of this method must ensure that this partitioner is also set as the document's document partitioner. This method has been replaced with IDocumentPartitionerExtension3.connect(IDocument, boolean). Implementers should default a callconnect(document)toconnect(document, false)in order to sustain the same semantics.- Parameters:
- document- the document to be connected to
 
- 
disconnectvoid disconnect()Disconnects the partitioner from the document it is connected to. Disconnect indicates the end of the usage of the receiver as partitioner of the connected document. Thus, resources the partitioner needed to be operation for its connected document should be deallocated.The caller of this method should also must ensure that this partitioner is no longer the document's partitioner. 
- 
documentAboutToBeChangedInforms about a forthcoming document change. Will be called by the connected document and is not intended to be used by clients other than the connected document.- Parameters:
- event- the event describing the forthcoming change
 
- 
documentChangedThe document has been changed. The partitioner updates the document's partitioning and returns whether the structure of the document partitioning has been changed, i.e. whether partitions have been added or removed. Will be called by the connected document and is not intended to be used by clients other than the connected document.This method has been replaced by IDocumentPartitionerExtension.documentChanged2(DocumentEvent).- Parameters:
- event- the event describing the document change
- Returns:
- trueif partitioning changed
 
- 
getLegalContentTypesString[] getLegalContentTypes()Returns the set of all legal content types of this partitioner. I.e. any result delivered by this partitioner may not contain a content type which would not be included in this method's result.- Returns:
- the set of legal content types
 
- 
getContentTypeReturns the content type of the partition containing the given offset in the connected document. There must be a document connected to this partitioner.Use IDocumentPartitionerExtension2.getContentType(int, boolean)when zero-length partitions are supported. In that case this method is equivalent:IDocumentPartitionerExtension2 extension= (IDocumentPartitionerExtension2) partitioner; return extension.getContentType(offset, false);- Parameters:
- offset- the offset in the connected document
- Returns:
- the content type of the offset's partition
 
- 
computePartitioningReturns the partitioning of the given range of the connected document. There must be a document connected to this partitioner.Use IDocumentPartitionerExtension2.computePartitioning(int, int, boolean)when zero-length partitions are supported. In that case this method is equivalent:IDocumentPartitionerExtension2 extension= (IDocumentPartitionerExtension2) partitioner; return extension.computePartitioning(offset, length, false);- Parameters:
- offset- the offset of the range of interest
- length- the length of the range of interest
- Returns:
- the partitioning of the range
 
- 
getPartitionReturns the partition containing the given offset of the connected document. There must be a document connected to this partitioner.Use IDocumentPartitionerExtension2.getPartition(int, boolean)when zero-length partitions are supported. In that case this method is equivalent:IDocumentPartitionerExtension2 extension= (IDocumentPartitionerExtension2) partitioner; return extension.getPartition(offset, false);- Parameters:
- offset- the offset for which to determine the partition
- Returns:
- the partition containing the offset
 
 
-