1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-12-16 18:38:58 -08:00
parent 240a5ac13e
commit ef93400be2
5 changed files with 29 additions and 39 deletions

View file

@ -12,13 +12,13 @@
*******************************************************************************/
package org.eclipse.cdt.core.model;
import java.net.URI;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import java.net.URI;
/**
* Common protocol for all elements provided by the C model.
*

View file

@ -12,38 +12,29 @@ package org.eclipse.cdt.core.model;
/**
* This is an optional extension interface to {@link ILanguage} which allows
* a C/C++ language variant to expose the set of keywords it defines.
* a C/C++ language variant to expose the set of keywords it defines.
*
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as
* part of a work in progress. There is no guarantee that this API will work or
* that it will remain the same. Please do not use this API without consulting
* with the CDT team.
* </p>
*
* @since 4.0
*/
public interface ICLanguageKeywords {
/**
* Get the keywords defined for this language, excluding bult-in types.
*
* Returns the keywords defined for this language, excluding built-in types.
*
* @return an array of keywords, never <code>null</code>
*/
public abstract String[] getKeywords();
/**
* Get the built-in type names defined for this language.
*
* Returns the built-in type names defined for this language.
*
* @return an array of names, never <code>null</code>
*/
public abstract String[] getBuiltinTypes();
/**
* Get the preprocessor keywords (directives) defined for this language.
*
* Returns the preprocessor keywords (directives) defined for this language.
*
* @return an array of keywords, never <code>null</code>
*/
public abstract String[] getPreprocessorKeywords();
}

View file

@ -10,13 +10,11 @@
*******************************************************************************/
package org.eclipse.cdt.core.model;
/**
* Represents a function definition.
*
*
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IFunction extends IFunctionDeclaration {
}

View file

@ -8,20 +8,24 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.model;
/**
* Represent struct(ure), class or union.
*
*
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IStructure extends IInheritance, IParent, IStructureDeclaration {
public IField getField(String name);
/**
* Returns the fields of a structure.
* Returns the specific field with the given name within the structure.
* @param name the name of the field
* @return the field with the given name, or {@code null} if not found
*/
public IField getField(String name);
/**
* Returns the fields of a structure.
* @return an array of IField elements
* @throws CModelException
*/
@ -29,12 +33,12 @@ public interface IStructure extends IInheritance, IParent, IStructureDeclaration
/**
* Returns the specific method with the given name within the structure.
* Returns the first occurance more than one method has the same name.
* Returns the first occurrence more than one method has the same name.
* @param name
* @return IMethodDeclaration
*/
public IMethodDeclaration getMethod(String name);
/**
* Returns all methods within the structure.
* @return array of IMethodDeclaration.

View file

@ -8,14 +8,8 @@
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IField;
@ -23,8 +17,12 @@ import org.eclipse.cdt.core.model.IMethodDeclaration;
import org.eclipse.cdt.core.model.IStructure;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
public class Structure extends StructureDeclaration implements IStructure {
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
public class Structure extends StructureDeclaration implements IStructure {
Map<String, ASTAccessVisibility> superClassesNames = new TreeMap<String, ASTAccessVisibility>();
public Structure(ICElement parent, int kind, String name) {
@ -43,7 +41,7 @@ public class Structure extends StructureDeclaration implements IStructure {
try {
IField[] fields = getFields();
for (IField field : fields) {
if(field.getElementName().equals(name)){
if (field.getElementName().equals(name)){
return field;
}
}
@ -65,7 +63,7 @@ public class Structure extends StructureDeclaration implements IStructure {
try {
IMethodDeclaration[] methods = getMethods();
for (IMethodDeclaration method : methods) {
if(method.getElementName().equals(name)){
if (method.getElementName().equals(name)){
return method;
}
}
@ -78,7 +76,7 @@ public class Structure extends StructureDeclaration implements IStructure {
public boolean isAbstract() throws CModelException {
IMethodDeclaration[] methods = getMethods();
for (IMethodDeclaration method : methods) {
if(method.isPureVirtual())
if (method.isPureVirtual())
return true;
}
return false;
@ -101,5 +99,4 @@ public class Structure extends StructureDeclaration implements IStructure {
public void addSuperClass(String name, ASTAccessVisibility access) {
superClassesNames.put(name, access);
}
}