DocumentFilter
Leave feedback
On this page
Inheritance: java.lang.Object
public abstract class DocumentFilter
Represents the base class for document filters. Contains methods for creation document filter instances.
Learn more
| Constructor | Description |
|---|---|
| DocumentFilter() |
| Method | Description |
|---|---|
| toString() | Returns string representation of a document filter. |
| createCreationTimeLowerBound(Date lowerBound) | Creates a filter for skipping documents with creation date earlier than the lower bound. |
| createCreationTimeUpperBound(Date upperBound) | Creates a filter for skipping documents with creation date later than the upper bound. |
| createCreationTimeRange(Date lowerBound, Date upperBound) | Creates a filter for skipping documents with creation date out of the specified range. |
| createModificationTimeLowerBound(Date lowerBound) | Creates a filter for skipping documents with modification date earlier than the lower bound. |
| createModificationTimeUpperBound(Date upperBound) | Creates a filter for skipping documents with modification date later than the upper bound. |
| createModificationTimeRange(Date lowerBound, Date upperBound) | Creates a filter for skipping documents with modification date out of the specified range. |
| createFilePathRegularExpression(String pattern) | Creates a filter for skipping documents that are not match a regular expression. |
| createFilePathRegularExpression(String pattern, int options) | Creates a filter for skipping documents that are not match a regular expression. |
| createFileLengthLowerBound(long lowerBound) | Creates a filter for skipping documents with the length less than the lower bound. |
| createFileLengthUpperBound(long upperBound) | Creates a filter for skipping documents with the length greater than the upper bound. |
| createFileLengthRange(long lowerBound, long upperBound) | Creates a filter for skipping documents out of the specified document length range. |
| createFileExtension(String[] extensions) | Creates a filter for skipping documents that do not have allowable extension. |
| createNot(DocumentFilter innerFilter) | Creates a filter that has inverse logic in relation to the specified inner filter. |
| createAnd(DocumentFilter[] filters) | Creates a logical conjunction of the specified filters. |
| createOr(DocumentFilter[] filters) | Creates a logical disjunction of the specified filters. |
public DocumentFilter()
public abstract String toString()
Returns string representation of a document filter.
Returns: java.lang.String - String representation of a document filter.
public static DocumentFilter createCreationTimeLowerBound(Date lowerBound)
Creates a filter for skipping documents with creation date earlier than the lower bound.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| lowerBound | java.util.Date | The lower bound of the document creation time. |
Returns: DocumentFilter - A document filter by document creation time.
public static DocumentFilter createCreationTimeUpperBound(Date upperBound)
Creates a filter for skipping documents with creation date later than the upper bound.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| upperBound | java.util.Date | The upper bound of the document creation time. |
Returns: DocumentFilter - A document filter by document creation time.
public static DocumentFilter createCreationTimeRange(Date lowerBound, Date upperBound)
Creates a filter for skipping documents with creation date out of the specified range.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| lowerBound | java.util.Date | The lower bound of the document creation time. |
| upperBound | java.util.Date | The upper bound of the document creation time. |
Returns: DocumentFilter - A document filter by document creation time.
public static DocumentFilter createModificationTimeLowerBound(Date lowerBound)
Creates a filter for skipping documents with modification date earlier than the lower bound.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| lowerBound | java.util.Date | The lower bound of the document modification time. |
Returns: DocumentFilter - A document filter by document modification time.
public static DocumentFilter createModificationTimeUpperBound(Date upperBound)
Creates a filter for skipping documents with modification date later than the upper bound.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| upperBound | java.util.Date | The upper bound of the document modification time. |
Returns: DocumentFilter - A document filter by document modification time.
public static DocumentFilter createModificationTimeRange(Date lowerBound, Date upperBound)
Creates a filter for skipping documents with modification date out of the specified range.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| lowerBound | java.util.Date | The lower bound of the document modification time. |
| upperBound | java.util.Date | The upper bound of the document modification time. |
Returns: DocumentFilter - A document filter by document modification time.
public static DocumentFilter createFilePathRegularExpression(String pattern)
Creates a filter for skipping documents that are not match a regular expression. The regular expression is applied to the full path of a document.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pattern | java.lang.String | The regular expression pattern. |
Returns: DocumentFilter - A document filter by file name.
public static DocumentFilter createFilePathRegularExpression(String pattern, int options)
Creates a filter for skipping documents that are not match a regular expression. The regular expression is applied to the full path of a document.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pattern | java.lang.String | The regular expression pattern. |
| options | int | The regular expression options. |
Returns: DocumentFilter - A document filter by file name.
public static DocumentFilter createFileLengthLowerBound(long lowerBound)
Creates a filter for skipping documents with the length less than the lower bound.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| lowerBound | long | The lower bound of the document length. |
Returns: DocumentFilter - A document filter by document length.
public static DocumentFilter createFileLengthUpperBound(long upperBound)
Creates a filter for skipping documents with the length greater than the upper bound.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| upperBound | long | The upper bound of the document length. |
Returns: DocumentFilter - A document filter by document length.
public static DocumentFilter createFileLengthRange(long lowerBound, long upperBound)
Creates a filter for skipping documents out of the specified document length range.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| lowerBound | long | The lower bound of the document length. |
| upperBound | long | The upper bound of the document length. |
Returns: DocumentFilter - A document filter by document length.
public static DocumentFilter createFileExtension(String[] extensions)
Creates a filter for skipping documents that do not have allowable extension.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| extensions | java.lang.String[] | The list of allowable extensions. |
Returns: DocumentFilter - A document filter by document extension.
public static DocumentFilter createNot(DocumentFilter innerFilter)
Creates a filter that has inverse logic in relation to the specified inner filter.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| innerFilter | DocumentFilter | The inner document filter. |
Returns: DocumentFilter - An inverted document filter.
public static DocumentFilter createAnd(DocumentFilter[] filters)
Creates a logical conjunction of the specified filters.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| filters | DocumentFilter[] | The document filters. |
Returns: DocumentFilter - A document filter that represents result of conjunction of the specified filters.
public static DocumentFilter createOr(DocumentFilter[] filters)
Creates a logical disjunction of the specified filters.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| filters | DocumentFilter[] | The document filters. |
Returns: DocumentFilter - A document filter that represents result of disjunction of the specified filters.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.