135 }
136
137 /**
138 * Sends this {@code Runnable} for the execution
139 *
140 * <p>
141 * This method is to be executed only from {@code add} method.
142 *
143 * <p>
144 * This implementation uses {@code SwingWorker.invokeLater}.
145 */
146 protected void submit() {
147 SwingUtilities.invokeLater(this);
148 }
149
150 /**
151 * Returns accumulated arguments and flashes the arguments storage.
152 *
153 * @return accumulated arguments
154 */
155 private final synchronized List<T> flush() {
156 List<T> list = arguments;
157 arguments = null;
158 return list;
159 }
160 }
|
135 }
136
137 /**
138 * Sends this {@code Runnable} for the execution
139 *
140 * <p>
141 * This method is to be executed only from {@code add} method.
142 *
143 * <p>
144 * This implementation uses {@code SwingWorker.invokeLater}.
145 */
146 protected void submit() {
147 SwingUtilities.invokeLater(this);
148 }
149
150 /**
151 * Returns accumulated arguments and flashes the arguments storage.
152 *
153 * @return accumulated arguments
154 */
155 private synchronized List<T> flush() {
156 List<T> list = arguments;
157 arguments = null;
158 return list;
159 }
160 }
|