APISonar


java.util.Stack.clone

> java > util > Stack > clone
java APIs util APIs Stack APIs clone APIs

Example 1
private Stack<MappingRecord> m_nodeStack = new Stack<>();

    public Object clone() throws CloneNotSupportedException {
        NamespaceMappings clone = new NamespaceMappings();
        clone.m_nodeStack = (Stack<MappingRecord>) m_nodeStack.clone();
        clone.m_namespaces = (HashMap<String, Stack<MappingRecord>>) m_namespaces.clone();
        clone.count = count;
        return clone;

    }
Example 2
public void setFormulaTokens( Stack formulaTokens )
    {
        this.formulaTokens = (Stack) formulaTokens.clone();
    }
Example 3
Stack cloneStack() {
    Stack stack = getCurrentStack();
    if(stack == null)
      return null;
    else {
      return (Stack) stack.clone();
    }
  }
Example 4
public void testClone() {
    Stack<Integer> large = createLargeStack();
    @SuppressWarnings("unchecked")
    Stack<Integer> cloned = (Stack<Integer>) large.clone();
    checkLargeStack(cloned, 0);
    assertEquals(TEST_SIZE, large.size());
  }
Example 5
private Object extractListAsJson(ObjectToJsonConverter pConverter, List pList, Stack<String> pPath, int pLength) throws AttributeNotFoundException {
        List ret = new JSONArray();
        for (int i = 0;i < pLength; i++) {
            Stack<String> path = (Stack<String>) pPath.clone();
            try {
                ret.add(pConverter.extractObject(pList.get(i), path, true));
            } catch (ValueFaultHandler.AttributeFilteredException exp) {
                // This element is filtered out, next one ...
            }
        }
        if (ret.isEmpty() && pLength > 0) {
            throw new ValueFaultHandler.AttributeFilteredException();
        }
        return ret;
    }
Example 6
public Iterable<? extends Instruction> succ(CallEnvironment env) {
    final Stack<CallInstruction> callStack = getStack(env, this);
    if (callStack.isEmpty()) return Collections.emptyList();     //can be true in case env was not populated (e.g. by DFA)

    final CallInstruction callInstruction = callStack.peek();
    final List<InstructionImpl> succ = callInstruction.mySucc;
    final Stack<CallInstruction> copy = (Stack<CallInstruction>)callStack.clone();
    copy.pop();
    for (InstructionImpl instruction : succ) {
      env.update(copy, instruction);
    }

    return succ;
  }