/** * Request that a sequence of split points be prefetched. Code for the split * points in <code>splitPoints</code> will be downloaded and installed * whenever there is nothing else to download. Each call to this method * overwrites the entire prefetch queue with the newly specified one. */ public void setPrefetchQueue(int... runAsyncSplitPoints) { if (prefetchQueue == null) { prefetchQueue = new BoundedIntQueue(numEntries); } prefetchQueue.clear(); for (int sp : runAsyncSplitPoints) { prefetchQueue.add(sp); } startLoadingNextFragment(); }
/** * Request that a sequence of split points be prefetched. Code for the split * points in <code>splitPoints</code> will be downloaded and installed * whenever there is nothing else to download. Each call to this method * overwrites the entire prefetch queue with the newly specified one. */ public void setPrefetchQueue(int... runAsyncSplitPoints) { if (prefetchQueue == null) { prefetchQueue = new BoundedIntQueue(numEntries); } prefetchQueue.clear(); for (int sp : runAsyncSplitPoints) { prefetchQueue.add(sp); } startLoadingNextFragment(); }
public AsyncFragmentLoader(int numEntries, int[] initialLoadSequence, LoadingStrategy loadingStrategy, Logger logger, OnSuccessExecutor executor) { this.numEntries = numEntries; this.initialLoadSequence = initialLoadSequence; this.loadingStrategy = loadingStrategy; this.logger = logger; this.onSuccessExecutor = executor; int numEntriesPlusOne = numEntries + 1; this.allCallbacks = new Object[numEntriesPlusOne][]; this.requestedExclusives = new BoundedIntQueue(numEntriesPlusOne); this.isLoaded = new boolean[numEntriesPlusOne]; this.pendingDownloadErrorHandlers = new LoadTerminatedHandler[numEntriesPlusOne]; }
/** * Initialize {@link #remainingInitialFragments} if it isn't already. */ private void initializeRemainingInitialFragments() { if (remainingInitialFragments == null) { remainingInitialFragments = new BoundedIntQueue(initialLoadSequence.length + 1); for (int sp : initialLoadSequence) { remainingInitialFragments.add(sp); } remainingInitialFragments.add(leftoversFragment()); } }
/** * Initialize {@link #remainingInitialFragments} if it isn't already. */ private void initializeRemainingInitialFragments() { if (remainingInitialFragments == null) { remainingInitialFragments = new BoundedIntQueue(initialLoadSequence.length + 1); for (int sp : initialLoadSequence) { remainingInitialFragments.add(sp); } remainingInitialFragments.add(leftoversFragment()); } }
public AsyncFragmentLoader(int numEntries, int[] initialLoadSequence, LoadingStrategy loadingStrategy, Logger logger, OnSuccessExecutor executor) { this.numEntries = numEntries; this.initialLoadSequence = initialLoadSequence; this.loadingStrategy = loadingStrategy; this.logger = logger; this.onSuccessExecutor = executor; int numEntriesPlusOne = numEntries + 1; this.allCallbacks = new Object[numEntriesPlusOne][]; this.requestedExclusives = new BoundedIntQueue(numEntriesPlusOne); this.isLoaded = new boolean[numEntriesPlusOne]; this.pendingDownloadErrorHandlers = new LoadTerminatedHandler[numEntriesPlusOne]; }
/** * Request that a sequence of split points be prefetched. Code for the split * points in <code>splitPoints</code> will be downloaded and installed * whenever there is nothing else to download. Each call to this method * overwrites the entire prefetch queue with the newly specified one. */ public void setPrefetchQueue(int... runAsyncSplitPoints) { if (prefetchQueue == null) { prefetchQueue = new BoundedIntQueue(numEntries); } prefetchQueue.clear(); for (int sp : runAsyncSplitPoints) { prefetchQueue.add(sp); } startLoadingNextFragment(); }
public AsyncFragmentLoader(int numEntries, int[] initialLoadSequence, LoadingStrategy loadingStrategy, Logger logger, OnSuccessExecutor executor) { this.numEntries = numEntries; this.initialLoadSequence = initialLoadSequence; this.loadingStrategy = loadingStrategy; this.logger = logger; this.onSuccessExecutor = executor; int numEntriesPlusOne = numEntries + 1; this.allCallbacks = new Object[numEntriesPlusOne][]; this.requestedExclusives = new BoundedIntQueue(numEntriesPlusOne); this.isLoaded = new boolean[numEntriesPlusOne]; this.pendingDownloadErrorHandlers = new LoadTerminatedHandler[numEntriesPlusOne]; }
/** * Initialize {@link #remainingInitialFragments} if it isn't already. */ private void initializeRemainingInitialFragments() { if (remainingInitialFragments == null) { remainingInitialFragments = new BoundedIntQueue(initialLoadSequence.length + 1); for (int sp : initialLoadSequence) { remainingInitialFragments.add(sp); } remainingInitialFragments.add(leftoversFragment()); } }