org.eclipse.cdt.core.index

## Class IndexFilter

- java.lang.Object
- - org.eclipse.cdt.core.index.IndexFilter

    public abstract class IndexFilter
    extends Object

Can be subclassed and used for queries in the index.

Since:
  4.0

### Field Summary

Fields
`static IndexFilter` `ALL`
`static IndexFilter` `ALL_DECLARED`
`static IndexFilter` `ALL_DECLARED_OR_IMPLICIT`
`static IndexFilter` `C_DECLARED_OR_IMPLICIT`
`static IndexFilter` `CPP_DECLARED_OR_IMPLICIT`
`static IndexFilter` `CPP_DECLARED_OR_IMPLICIT_NO_INSTANCE`

### Constructor Summary

Constructors
Constructor and Description
`IndexFilter()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `acceptBinding(IBinding binding)` Determines whether or not a binding is valid.
`boolean` `acceptLinkage(ILinkage linkage)` Returns whether or not to include objects of the given linkage in the query.
`static IndexFilter` `getDeclaredBindingFilter(int linkageID, boolean acceptImplicit)` Get an IndexFilter that filters out bindings without declarations and those from linkages other than that specified.
`static IndexFilter` `getDeclaredBindingFilter(int linkageID, boolean acceptImplicit, boolean allowInstances)` Get an IndexFilter that filters out bindings without declarations and those from linkages other than that specified.
`static IndexFilter` `getFilter(int linkageID)` Get an IndexFilter that filters out bindings from linkages other than that specified.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### ALL

    public static final IndexFilter ALL

#### ALL_DECLARED

    public static final IndexFilter ALL_DECLARED

#### ALL_DECLARED_OR_IMPLICIT

    public static final IndexFilter ALL_DECLARED_OR_IMPLICIT

#### CPP_DECLARED_OR_IMPLICIT

    public static final IndexFilter CPP_DECLARED_OR_IMPLICIT

#### CPP_DECLARED_OR_IMPLICIT_NO_INSTANCE

    public static final IndexFilter CPP_DECLARED_OR_IMPLICIT_NO_INSTANCE

Since:
  5.1

#### C_DECLARED_OR_IMPLICIT

    public static final IndexFilter C_DECLARED_OR_IMPLICIT

### Constructor Detail

#### IndexFilter

    public IndexFilter()

### Method Detail

#### getFilter

    public static IndexFilter getFilter(int linkageID)

Get an IndexFilter that filters out bindings from linkages other than that specified.

Parameters:
  `linkageID` - the id of the linkage whose bindings should be retained
Returns:
  an IndexFilter instance

#### getDeclaredBindingFilter

    public static IndexFilter getDeclaredBindingFilter(int linkageID,
                                                       boolean acceptImplicit)

Get an IndexFilter that filters out bindings without declarations and those from linkages other than that specified.

Parameters:
  `linkageID` - the id of the linkage whose bindings should be retained, or -1 to accept all linkages.
Returns:
  an IndexFilter instance

#### getDeclaredBindingFilter

    public static IndexFilter getDeclaredBindingFilter(int linkageID,
                                                       boolean acceptImplicit,
                                                       boolean allowInstances)

Get an IndexFilter that filters out bindings without declarations and those from linkages other than that specified.

Parameters:
  `linkageID` - the id of the linkage whose bindings should be retained, or -1 to accept all linkages.
Returns:
  an IndexFilter instance
Since:
  5.1

#### acceptLinkage

    public boolean acceptLinkage(ILinkage linkage)

Returns whether or not to include objects of the given linkage in the query.

Parameters:
  `linkage` - a linkage to be tested
Returns:
  whether to include objects of the given linkage in the query.
See Also:
  `IIndex.findBindings(java.util.regex.Pattern, boolean, IndexFilter, org.eclipse.core.runtime.IProgressMonitor)`

#### acceptBinding

    public boolean acceptBinding(IBinding binding)
                          throws org.eclipse.core.runtime.CoreException

Determines whether or not a binding is valid.

Parameters:
  `binding` - the binding being checked for validity
Returns:
  whether or not the binding is valid
Throws:
  `org.eclipse.core.runtime.CoreException`