com.sun.tools.javac.model
public class: FilteredMemberList [javadoc |
source]
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList<Symbol>
com.sun.tools.javac.model.FilteredMemberList
All Implemented Interfaces:
List, Collection
Utility to construct a view of a symbol's members,
filtering out unwanted elements such as synthetic ones.
This view is most efficiently accessed through its iterator() method.
This is NOT part of any supported API.
If you write code that depends on this, you do so at your own risk.
This code and its internal interfaces are subject to change or
deletion without notice.
Method from com.sun.tools.javac.model.FilteredMemberList Summary: |
---|
get, iterator, size |
Methods from java.util.AbstractList: |
---|
add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
Methods from java.util.AbstractCollection: |
---|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from com.sun.tools.javac.model.FilteredMemberList Detail: |
public Symbol get(int index) {
for (Scope.Entry e = scope.elems; e != null; e = e.sibling) {
if (!unwanted(e.sym) && (index-- == 0))
return e.sym;
}
throw new IndexOutOfBoundsException();
}
|
public Iterator<Symbol> iterator() {
return new Iterator< Symbol >() {
/** The next entry to examine, or null if none. */
private Scope.Entry nextEntry = scope.elems;
private boolean hasNextForSure = false;
public boolean hasNext() {
if (hasNextForSure) {
return true;
}
while (nextEntry != null && unwanted(nextEntry.sym)) {
nextEntry = nextEntry.sibling;
}
hasNextForSure = (nextEntry != null);
return hasNextForSure;
}
public Symbol next() {
if (hasNext()) {
Symbol result = nextEntry.sym;
nextEntry = nextEntry.sibling;
hasNextForSure = false;
return result;
} else {
throw new NoSuchElementException();
}
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
|
public int size() {
int cnt = 0;
for (Scope.Entry e = scope.elems; e != null; e = e.sibling) {
if (!unwanted(e.sym))
cnt++;
}
return cnt;
}
|