Package org.eclipse.cdt.core.dom.ast

# Class ASTNameCollector

java.lang.Object
org.eclipse.cdt.core.dom.ast.ASTVisitor
org.eclipse.cdt.core.dom.ast.ASTNameCollector

public final class ASTNameCollector extends ASTVisitor
A convenience visitor that collects names.

Since:
  5.1

## Field Summary

### Fields inherited from class org.eclipse.cdt.core.dom.ast.ASTVisitor

`includeInactiveNodes, PROCESS_ABORT, PROCESS_CONTINUE, PROCESS_SKIP, shouldVisitAmbiguousNodes, shouldVisitArrayModifiers, shouldVisitAttributes, shouldVisitBaseSpecifiers, shouldVisitCaptures, shouldVisitDeclarations, shouldVisitDeclarators, shouldVisitDeclSpecifiers, shouldVisitDecltypeSpecifiers, shouldVisitDesignators, shouldVisitEnumerators, shouldVisitExpressions, shouldVisitImplicitDestructorNames, shouldVisitImplicitNameAlternates, shouldVisitImplicitNames, shouldVisitInitializers, shouldVisitNames, shouldVisitNamespaces, shouldVisitParameterDeclarations, shouldVisitPointerOperators, shouldVisitProblems, shouldVisitStatements, shouldVisitTemplateParameters, shouldVisitTokens, shouldVisitTranslationUnit, shouldVisitTypeIds, shouldVisitVirtSpecifiers`

## Constructor Summary

Constructors
Constructor
Description
`ASTNameCollector(char[] name)`
Constructs a name collector for the given name.
`ASTNameCollector(String name)`
Constructs a name collector for the given name.

## Method Summary

Modifier and Type
Method
Description
`void`
`clear()`
Clears the names found, such that the collector can be reused.
`IASTName[]`
`getNames()`
Returns the array of matching names.
`int`
`visit(IASTName name)`

### Methods inherited from class org.eclipse.cdt.core.dom.ast.ASTVisitor

`leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, leave, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit`

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

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

## Constructor Details

### ASTNameCollector

public ASTNameCollector(char[] name)
Constructs a name collector for the given name.

### ASTNameCollector

public ASTNameCollector(String name)
Constructs a name collector for the given name.

## Method Details

### visit

public int visit(IASTName name)

Overrides:
  `visit` in class `ASTVisitor`

### getNames

public IASTName[] getNames()
Returns the array of matching names.

### clear

public void clear()
Clears the names found, such that the collector can be reused.