private List<Matcher> popLastArgumentMatchers(int count) { List<Matcher> result = new LinkedList<Matcher>(); result.addAll(matcherStack.subList(matcherStack.size() - count, matcherStack.size())); for (int i = 0; i < count; i++) { matcherStack.pop(); } return result; }
private void detectedCycle(N q) throws CycleDetectedException { int i = path.indexOf(q); path.push(q); reactOnCycle(q, path.subList(i, path.size())); }
@Override public void execute(ExecutionContext context) { Stack<Object> stack = context.getStack(); int n = ((Number)stack.pop()).intValue(); if (n > 0) { int size = stack.size(); //Need to copy to a new list to avoid ConcurrentModificationException List<Object> copy = new java.util.ArrayList<>( stack.subList(size - n, size)); stack.addAll(copy); } }
public List<Object> getDestParents() { return dstObjects.subList(0, dstObjects.size()); }
public List<Object> getSourceParents() { return srcObjects.subList(0, srcObjects.size()); }
public List<Object> getSourceParents() { return srcObjects.subList(0, srcObjects.size()); }
public List<Object> getDestParents() { return dstObjects.subList(0, dstObjects.size()); }
public void execute(ExecutionContext context) { Stack<Object> stack = context.getStack(); int n = ((Number)stack.pop()).intValue(); if (n > 0) { int size = stack.size(); //Need to copy to a new list to avoid ConcurrentModificationException List<Object> copy = new java.util.ArrayList<Object>( stack.subList(size - n, size)); stack.addAll(copy); } }
public void execute(ExecutionContext context) { Stack<Object> stack = context.getStack(); int n = ((Number)stack.pop()).intValue(); if (n > 0) { int size = stack.size(); //Need to copy to a new list to avoid ConcurrentModificationException List<Object> copy = new java.util.ArrayList<>( stack.subList(size - n, size)); stack.addAll(copy); } }
public void execute(ExecutionContext context) { Stack<Object> stack = context.getStack(); int n = ((Number)stack.pop()).intValue(); if (n > 0) { int size = stack.size(); //Need to copy to a new list to avoid ConcurrentModificationException List<Object> copy = new java.util.ArrayList<Object>( stack.subList(size - n, size)); stack.addAll(copy); } }
private static List<IArgumentMatcher> popLastArgumentMatchers(int count) { Stack<IArgumentMatcher> stack = threadToArgumentMatcherStack.get(Thread .currentThread()); assertState(stack != null, "no matchers found."); assertState(stack.size() >= count, "" + count + " matchers expected, " + stack.size() + " recorded."); List<IArgumentMatcher> result = new LinkedList<IArgumentMatcher>(); result.addAll(stack.subList(stack.size() - count, stack.size())); for (int i = 0; i < count; i++) { stack.pop(); } return result; }
private static List<IArgumentMatcher> popLastArgumentMatchers(int count) { Stack<IArgumentMatcher> stack = threadToArgumentMatcherStack.get(); assertState(stack != null, "no matchers found."); assertState(stack.size() >= count, "" + count + " matchers expected, " + stack.size() + " recorded."); List<IArgumentMatcher> result = new LinkedList<IArgumentMatcher>(); result.addAll(stack.subList(stack.size() - count, stack.size())); for (int i = 0; i < count; i++) { stack.pop(); } return result; }
private List<Matcher> popLastArgumentMatchers(int count) { assertState(!matcherStack.isEmpty(), "No matchers found."); assertState(matcherStack.size() >= count, "" + count + " matchers expected, " + matcherStack.size() + " recorded."); List<Matcher> result = new LinkedList<Matcher>(); result.addAll(matcherStack.subList(matcherStack.size() - count, matcherStack.size())); for (int i = 0; i < count; i++) { matcherStack.pop(); } return result; }
private void detectedCycle(N q) throws CycleDetectedException { int i = path.indexOf(q); path.push(q); reactOnCycle(q, path.subList(i, path.size())); }
private void detectedCycle(N q) throws CycleDetectedException { int i = path.indexOf(q); path.push(q); throw new CycleDetectedException(path.subList(i, path.size())); }
private void detectedCycle(N q) throws CycleDetectedException { int i = path.indexOf(q); path.push(q); throw new CycleDetectedException(path.subList(i, path.size())); }
private void detectedCycle(N q) throws CycleDetectedException { int i = path.indexOf(q); path.push(q); throw new CycleDetectedException(path.subList(i, path.size())); }
private void detectedCycle(N q) throws CycleDetectedException { int i = path.indexOf(q); path.push(q); throw new CycleDetectedException(path.subList(i, path.size())); }
public List<Variable> getCycleFor(Variable input) { if (!wouldCycle(input)) return Collections.emptyList(); int position = names.indexOf(input.getName()); List<Variable> result = new ArrayList<Variable>(variables.subList(position, variables.size())); result.add(input); return result; }
public void setSelected(String selected){ super.setSelected(selected); Stack<String> history = getHistory(); if( history.size() == 1 && history.get(0).equals(selected)){ return; } if( history.size() > 1 && getHistory().contains(selected)){ Stack<String> newHistory = new Stack<String>(); newHistory.addAll(getHistory().subList(0, getHistory().indexOf(selected)+1)); setHistory(newHistory); } else { getHistory().push(selected); } }