1 /* 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * 4 * This code is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU General Public License version 2 only, as 6 * published by the Free Software Foundation. Oracle designates this 7 * particular file as subject to the "Classpath" exception as provided 8 * by Oracle in the LICENSE file that accompanied this code. 9 * 10 * This code is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 * version 2 for more details (a copy is included in the LICENSE file that 14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 */ 24 25 /* 26 * This file is available under and governed by the GNU General Public 27 * License version 2 only, as published by the Free Software Foundation. 28 * However, the following notice accompanied the original version of this 29 * file: 30 * 31 * Written by Doug Lea with assistance from members of JCP JSR-166 32 * Expert Group and released to the public domain, as explained at 33 * http://creativecommons.org/publicdomain/zero/1.0/ 34 */ 35 36 package java.util.concurrent; 37 38 import dalvik.annotation.compat.UnsupportedAppUsage; 39 40 @SuppressWarnings({"unchecked", "deprecation", "all"}) 41 public class FutureTask<V> implements java.util.concurrent.RunnableFuture<V> { 42 FutureTask(java.util.concurrent.Callable<V> callable)43 public FutureTask(java.util.concurrent.Callable<V> callable) { 44 throw new RuntimeException("Stub!"); 45 } 46 FutureTask(java.lang.Runnable runnable, V result)47 public FutureTask(java.lang.Runnable runnable, V result) { 48 throw new RuntimeException("Stub!"); 49 } 50 report(int s)51 private V report(int s) throws java.util.concurrent.ExecutionException { 52 throw new RuntimeException("Stub!"); 53 } 54 isCancelled()55 public boolean isCancelled() { 56 throw new RuntimeException("Stub!"); 57 } 58 isDone()59 public boolean isDone() { 60 throw new RuntimeException("Stub!"); 61 } 62 cancel(boolean mayInterruptIfRunning)63 public boolean cancel(boolean mayInterruptIfRunning) { 64 throw new RuntimeException("Stub!"); 65 } 66 get()67 public V get() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException { 68 throw new RuntimeException("Stub!"); 69 } 70 get(long timeout, java.util.concurrent.TimeUnit unit)71 public V get(long timeout, java.util.concurrent.TimeUnit unit) 72 throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, 73 java.util.concurrent.TimeoutException { 74 throw new RuntimeException("Stub!"); 75 } 76 done()77 protected void done() { 78 throw new RuntimeException("Stub!"); 79 } 80 set(V v)81 protected void set(V v) { 82 throw new RuntimeException("Stub!"); 83 } 84 setException(java.lang.Throwable t)85 protected void setException(java.lang.Throwable t) { 86 throw new RuntimeException("Stub!"); 87 } 88 run()89 public void run() { 90 throw new RuntimeException("Stub!"); 91 } 92 runAndReset()93 protected boolean runAndReset() { 94 throw new RuntimeException("Stub!"); 95 } 96 handlePossibleCancellationInterrupt(int s)97 private void handlePossibleCancellationInterrupt(int s) { 98 throw new RuntimeException("Stub!"); 99 } 100 finishCompletion()101 private void finishCompletion() { 102 throw new RuntimeException("Stub!"); 103 } 104 awaitDone(boolean timed, long nanos)105 private int awaitDone(boolean timed, long nanos) throws java.lang.InterruptedException { 106 throw new RuntimeException("Stub!"); 107 } 108 removeWaiter(java.util.concurrent.FutureTask.WaitNode node)109 private void removeWaiter(java.util.concurrent.FutureTask.WaitNode node) { 110 throw new RuntimeException("Stub!"); 111 } 112 113 private static final int CANCELLED = 4; // 0x4 114 115 private static final int COMPLETING = 1; // 0x1 116 117 @UnsupportedAppUsage 118 private static final int EXCEPTIONAL = 3; // 0x3 119 120 private static final int INTERRUPTED = 6; // 0x6 121 122 private static final int INTERRUPTING = 5; // 0x5 123 124 private static final int NEW = 0; // 0x0 125 126 private static final int NORMAL = 2; // 0x2 127 128 private static final long RUNNER; 129 130 static { 131 RUNNER = 0; 132 } 133 134 private static final long STATE; 135 136 static { 137 STATE = 0; 138 } 139 140 private static final sun.misc.Unsafe U; 141 142 static { 143 U = null; 144 } 145 146 private static final long WAITERS; 147 148 static { 149 WAITERS = 0; 150 } 151 152 @UnsupportedAppUsage 153 private java.util.concurrent.Callable<V> callable; 154 155 @UnsupportedAppUsage 156 private java.lang.Object outcome; 157 158 private volatile java.lang.Thread runner; 159 160 @UnsupportedAppUsage 161 private volatile int state; 162 163 private volatile java.util.concurrent.FutureTask.WaitNode waiters; 164 165 @SuppressWarnings({"unchecked", "deprecation", "all"}) 166 static final class WaitNode { 167 WaitNode()168 WaitNode() { 169 throw new RuntimeException("Stub!"); 170 } 171 172 volatile java.util.concurrent.FutureTask.WaitNode next; 173 174 volatile java.lang.Thread thread; 175 } 176 } 177