Refine search
/** * Appends the specified element to the end of this list. * * @param element The element to be appended */ public boolean add(Object element) { if (fast) { synchronized (this) { ArrayList temp = (ArrayList) list.clone(); boolean result = temp.add(element); list = temp; return (result); } } else { synchronized (list) { return (list.add(element)); } } }
/** * Called internally to start an animation by adding it to the active animations list. Must be * called on the UI thread. */ private void startAnimation() { initAnimation(); sAnimations.get().add(this); if (mStartDelay > 0 && mListeners != null) { // Listeners were already notified in start() if startDelay is 0; this is // just for delayed animations ArrayList<AnimatorListener> tmpListeners = (ArrayList<AnimatorListener>) mListeners.clone(); int numListeners = tmpListeners.size(); for (int i = 0; i < numListeners; ++i) { tmpListeners.get(i).onAnimationStart(this); } } }
Path cur = paths.get(s); p.setCost(cur.getCost()); p.setPath((ArrayList<String>) cur.getPath().clone()); String phone = symsArray[i]; if (!skipSeqs.contains(phone)) { p.getPath().add(phone); res.add(path); int numPaths = res.size(); for (int i = nbest; i < numPaths; i++) { res.remove(res.size() - 1);
&& parameterTypes.length + k - j <= typedDependencies.length; k++) { if (parameterTypes[j].isAssignableFrom(typedDependencies[k].type)) { matchingDependencies.add(typedDependencies[k].value); usedDeps |= 1L << k; if (++j == parameterTypes.length) { matchingDependencies.add(deps[assignable].value); usedDeps |= 1L << assignable; possibleMatchingDependencies = (List)matchingDependencies.clone(); possibleUsedDeps = usedDeps;
String[] array = new String[10]; array[0] = "111"; ArrayList one = new ArrayList(); one.add(array); ArrayList two = (ArrayList) one.clone(); //Alternate with: ArrayList two = one; String[] stringarray1 = (String[]) one.get(0); String[] stringarray2 = (String[]) two.get(0); System.out.println("Array: "+one+" with value: "+stringarray1[0]); System.out.println("Array: "+one+" with value: "+stringarray2[0]); array[0] = "999"; String[] stringarray3 = (String[]) one.get(0); String[] stringarray4 = (String[]) two.get(0); System.out.println("Array: "+one+" with value: "+stringarray3[0]); System.out.println("Array: "+two+" with value: "+stringarray4[0]);
if (animations.size() > 0 || delayedAnims.size() > 0) { callAgain = false; while (pendingAnimations.size() > 0) { ArrayList<ValueAnimator> pendingCopy = (ArrayList<ValueAnimator>) pendingAnimations.clone(); pendingAnimations.clear(); int count = pendingCopy.size(); for (int i = 0; i < count; ++i) { ValueAnimator anim = pendingCopy.get(i); delayedAnims.add(anim); int numDelayedAnims = delayedAnims.size(); for (int i = 0; i < numDelayedAnims; ++i) { ValueAnimator anim = delayedAnims.get(i); if (anim.delayedAnimationFrame(currentTime)) { readyAnims.add(anim); ValueAnimator anim = animations.get(i); if (anim.animationFrame(currentTime)) { endingAnims.add(anim); if (animations.size() == numAnims) {
/** * Called internally to end an animation by removing it from the animations list. Must be * called on the UI thread. */ private void endAnimation() { sAnimations.get().remove(this); sPendingAnimations.get().remove(this); sDelayedAnims.get().remove(this); mPlayingState = STOPPED; if (mRunning && mListeners != null) { ArrayList<AnimatorListener> tmpListeners = (ArrayList<AnimatorListener>) mListeners.clone(); int numListeners = tmpListeners.size(); for (int i = 0; i < numListeners; ++i) { tmpListeners.get(i).onAnimationEnd(this); } } mRunning = false; mStarted = false; }
@Override public final void addKeyListener(int index, final KeyListener l) { if(l == null) { return; } @SuppressWarnings("unchecked") final ArrayList<KeyListener> clonedListeners = (ArrayList<KeyListener>) keyListeners.clone(); if(0>index) { index = clonedListeners.size(); } clonedListeners.add(index, l); keyListeners = clonedListeners; }
/** * Insert the specified element at the specified position in this list, * and shift all remaining elements up one position. * * @param index Index at which to insert this element * @param element The element to be inserted * * @exception IndexOutOfBoundsException if the index is out of range */ public void add(int index, Object element) { if (fast) { synchronized (this) { ArrayList temp = (ArrayList) list.clone(); temp.add(index, element); list = temp; } } else { synchronized (list) { list.add(index, element); } } }
mTerminated = true; if (isStarted()) { if (mSortedNodes.size() != mNodes.size()) { mDelayAnim.cancel(); if (mSortedNodes.size() > 0) { for (Node node : mSortedNodes) { node.animation.end(); (ArrayList<AnimatorListener>) mListeners.clone(); for (AnimatorListener listener : tmpListeners) { listener.onAnimationEnd(this);
/** * This method is called automatically by the transition and * TransitionSet classes prior to a Transition subclass starting; * subclasses should not need to call it directly. * * @hide */ protected void start() { if (mNumInstances == 0) { if (mListeners != null && mListeners.size() > 0) { ArrayList<TransitionListener> tmpListeners = (ArrayList<TransitionListener>) mListeners.clone(); int numListeners = tmpListeners.size(); for (int i = 0; i < numListeners; ++i) { tmpListeners.get(i).onTransitionStart(this); } } mEnded = false; } mNumInstances++; }
@Override public final void addKeyListener(int index, final KeyListener l) { if(l == null) { return; } @SuppressWarnings("unchecked") final ArrayList<KeyListener> clonedListeners = (ArrayList<KeyListener>) keyListeners.clone(); if(0>index) { index = clonedListeners.size(); } clonedListeners.add(index, l); keyListeners = clonedListeners; }
/** * Appends the specified element to the end of this list. * * @param element The element to be appended */ public boolean add(Object element) { if (fast) { synchronized (this) { ArrayList temp = (ArrayList) list.clone(); boolean result = temp.add(element); list = temp; return (result); } } else { synchronized (list) { return (list.add(element)); } } }
ArrayList<AnimatorListener> tmpListeners = null; if (mListeners != null) { tmpListeners = (ArrayList<AnimatorListener>) mListeners.clone(); for (AnimatorListener listener : tmpListeners) { listener.onAnimationCancel(this); } else if (mSortedNodes.size() > 0) { for (Node node : mSortedNodes) { node.animation.cancel();
int numSortedNodes = mSortedNodes.size(); for (int i = 0; i < numSortedNodes; ++i) { Node node = mSortedNodes.get(i); if (oldListeners != null && oldListeners.size() > 0) { final ArrayList<AnimatorListener> clonedListeners = new ArrayList<AnimatorListener>(oldListeners); Node node = mSortedNodes.get(i); if (mSetListener == null) { mSetListener = new AnimatorSetListener(this); node.tmpDependencies = (ArrayList<Dependency>) node.dependencies.clone(); for (Node node : nodesToStart) { node.animation.start(); mPlayingSet.add(node.animation); (ArrayList<AnimatorListener>) mListeners.clone(); int numListeners = tmpListeners.size(); for (int i = 0; i < numListeners; ++i) { if (mListeners != null) { ArrayList<AnimatorListener> tmpListeners = (ArrayList<AnimatorListener>) mListeners.clone(); int numListeners = tmpListeners.size(); for (int i = 0; i < numListeners; ++i) {
/** * This method cancels a transition that is currently running. * * @hide */ protected void cancel() { int numAnimators = mCurrentAnimators.size(); for (int i = numAnimators - 1; i >= 0; i--) { Animator animator = mCurrentAnimators.get(i); animator.cancel(); } if (mListeners != null && mListeners.size() > 0) { ArrayList<TransitionListener> tmpListeners = (ArrayList<TransitionListener>) mListeners.clone(); int numListeners = tmpListeners.size(); for (int i = 0; i < numListeners; ++i) { tmpListeners.get(i).onTransitionCancel(this); } } }
@Override public final void addMouseListener(int index, final MouseListener l) { if(l == null) { return; } @SuppressWarnings("unchecked") final ArrayList<MouseListener> clonedListeners = (ArrayList<MouseListener>) mouseListeners.clone(); if(0>index) { index = clonedListeners.size(); } clonedListeners.add(index, l); mouseListeners = clonedListeners; }