@Override public Iterator<ModuleEntry> getEntries() { return new NonNullSingletonIterator<>(this); }
@Override public Iterator<CallSiteReference> iterateCallSites(CGNode node) { assert understands(node); return new NonNullSingletonIterator<>(ARRAYCOPY_SITE); }
/** * subclass constructors must call this! */ protected void init(T N) { init(new NonNullSingletonIterator<>(N)); }
/** * subclass constructors must call this! */ protected void init(T N) { init(new NonNullSingletonIterator<>(N)); }
/** * Construct a depth-first enumerator starting with a particular node in a directed graph. * * @param G the graph whose nodes to enumerate */ public SlowDFSDiscoverTimeIterator(Graph<T> G, T N) { init(G, new NonNullSingletonIterator<>(N)); }
/** * subclass constructors must call this! */ protected void init(T N) { init(new NonNullSingletonIterator<>(N)); }
/** * Construct a breadth-first iterator starting with a particular node in a directed graph. * * @param G the graph whose nodes to enumerate * @throws IllegalArgumentException if G is null */ public BFSIterator(Graph<T> G, T N) { if (G == null) { throw new IllegalArgumentException("G is null"); } init(G, new NonNullSingletonIterator<>(N)); }
/** * Construct a breadth-first iterator starting with a particular node in a directed graph. * * @param G the graph whose nodes to enumerate * @throws IllegalArgumentException if G is null */ public BFSIterator(Graph<T> G, T N) { if (G == null) { throw new IllegalArgumentException("G is null"); } init(G, new NonNullSingletonIterator<>(N)); }
/** * Construct a depth-first enumerator starting with a particular node in a directed graph. * * @param G the graph whose nodes to enumerate */ public SlowDFSDiscoverTimeIterator(Graph<T> G, T N) { init(G, new NonNullSingletonIterator<>(N)); }
/** * Construct a depth-first enumerator starting with a particular node in a directed graph. * * @param G the graph whose nodes to enumerate */ @SuppressWarnings("unchecked") NumberedDFSFinishTimeIterator(NumberedGraph<T> G, T N) { this.G = G; pendingChildren = new Iterator[G.getMaxNumber() + 1]; init(G, new NonNullSingletonIterator<>(N)); }
@Override public Iterator<PointerKey> getPointerKeysForReflectedFieldRead(InstanceKey I, InstanceKey F) { if (F instanceof ConstantKey) { PointerKey ifk = getInstanceFieldPointerKeyForConstant(I, (ConstantKey<?>) F); if (ifk != null) { return new NonNullSingletonIterator<>(ifk); } } PointerKey x = ReflectedFieldPointerKey.mapped(new ConcreteTypeKey(getFieldNameType(F)), I); return new NonNullSingletonIterator<>(x); } }
@Override public Iterator<PointerKey> getPointerKeysForReflectedFieldRead(InstanceKey I, InstanceKey F) { if (F instanceof ConstantKey) { PointerKey ifk = getInstanceFieldPointerKeyForConstant(I, (ConstantKey<?>) F); if (ifk != null) { return new NonNullSingletonIterator<>(ifk); } } PointerKey x = ReflectedFieldPointerKey.mapped(new ConcreteTypeKey(getFieldNameType(F)), I); return new NonNullSingletonIterator<>(x); } }
@Override public String toString() { StringBuilder result = new StringBuilder(); for (CGNode n : Iterator2Iterable.make(DFS.iterateDiscoverTime(this, new NonNullSingletonIterator<>(getFakeRootNode())))) { result.append(nodeToString(this, n)).append('\n'); } return result.toString(); }
@Override public String toString() { StringBuilder result = new StringBuilder(); for (CGNode n : Iterator2Iterable.make(DFS.iterateDiscoverTime(this, new NonNullSingletonIterator<>(getFakeRootNode())))) { result.append(nodeToString(this, n)).append('\n'); } return result.toString(); }
/** * Construct a depth-first enumerator starting with a particular node in a directed graph. * * @param G the graph whose nodes to enumerate */ @SuppressWarnings("unchecked") NumberedDFSFinishTimeIterator(NumberedGraph<T> G, T N) { this.G = G; pendingChildren = new Iterator[G.getMaxNumber() + 1]; init(G, new NonNullSingletonIterator<>(N)); }
/** * Construct a depth-first enumerator starting with a particular node in a directed graph. * * @param G the graph whose nodes to enumerate */ @SuppressWarnings("unchecked") NumberedDFSFinishTimeIterator(NumberedGraph<T> G, T N) { this.G = G; pendingChildren = new Iterator[G.getMaxNumber() + 1]; init(G, new NonNullSingletonIterator<>(N)); }
@Override public Iterator<NewSiteReference> iterateNewSites(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } assert understands(node); IClass cls = ContextUtil.getConcreteClassFromContext(node.getContext()); return new NonNullSingletonIterator<>(NewSiteReference.make(NEW_PC, cls.getReference())); }
@Override public Iterator<NewSiteReference> iterateNewSites(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } assert understands(node); TypeReference tr = ((TypeAbstraction)node.getContext().get(ContextKey.RECEIVER)).getTypeReference(); if (tr != null) { return new NonNullSingletonIterator<>(NewSiteReference.make(0, tr)); } return EmptyIterator.instance(); }
@Override public Iterator<NewSiteReference> iterateNewSites(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } assert understands(node); TypeReference tr = ((TypeAbstraction)node.getContext().get(ContextKey.RECEIVER)).getTypeReference(); if (tr != null) { return new NonNullSingletonIterator<>(NewSiteReference.make(0, tr)); } return EmptyIterator.instance(); }
@Override public Iterator<NewSiteReference> iterateNewSites(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } assert understands(node); Context context = node.getContext(); TypeReference tr = ((TypeAbstraction)context.get(ContextKey.RECEIVER)).getTypeReference(); if (tr != null) { return new NonNullSingletonIterator<>(NewSiteReference.make(0, tr)); } return EmptyIterator.instance(); }