|
|||||||||||||||||||
| This license of Clover is provided to support the development of JBind only. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover. | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| ASTNameList.java | 50% | 100% | 100% | 86,7% |
|
||||||||||||||
| 1 |
/* |
|
| 2 |
* JBind |
|
| 3 |
* |
|
| 4 |
* Copyright (c) by Stefan Wachter. All rights reserved. |
|
| 5 |
* |
|
| 6 |
* Usage, modification, and redistribution is subject to license terms that are |
|
| 7 |
* available at 'http://www.jbind.org'. The JBind license is like the |
|
| 8 |
* 'Apache Software License V 1.1'. |
|
| 9 |
*/ |
|
| 10 |
package org.jbind.javaParser; |
|
| 11 |
|
|
| 12 |
import java.util.ArrayList; |
|
| 13 |
import java.util.Iterator; |
|
| 14 |
import java.util.List; |
|
| 15 |
|
|
| 16 |
public class ASTNameList {
|
|
| 17 |
|
|
| 18 |
private List myNames = new ArrayList(); |
|
| 19 |
|
|
| 20 | 8 |
public ASTNameList() {}
|
| 21 |
|
|
| 22 | 10 |
public void addName(ASTName aName) {
|
| 23 | 10 |
myNames.add(aName); |
| 24 |
} |
|
| 25 |
|
|
| 26 | 8 |
public boolean contains(String aName) {
|
| 27 | 8 |
boolean res = false; |
| 28 | 8 |
for (Iterator i = myNames.iterator(); i.hasNext(); ) {
|
| 29 | 8 |
ASTName n = (ASTName)i.next(); |
| 30 | 8 |
if (n.getName().equals(aName)) {
|
| 31 | 8 |
res = true; |
| 32 | 8 |
break; |
| 33 |
} |
|
| 34 |
} |
|
| 35 | 8 |
return res; |
| 36 |
} |
|
| 37 |
} |
|
| 38 |
|
|
||||||||||