/** * Forces a get of the image. */ @Override public SingleImage getImage(int index, Supplier<String> custom_name) { initializeIfNeeded(); if (guiImages[index] == null) { String str_custom_name = custom_name != null ? custom_name.get() : null; if(str_custom_name == null) str_custom_name = ""; loadGuiImage(index, str_custom_name+file_name+"-G"+index); } return guiImages[index]; }
T_SPLITR get() { if (s == null) { s = supplier.get(); } return s; }
/** * Called before advancing to set up spliterator, if needed. */ final void init() { if (spliterator == null) { spliterator = spliteratorSupplier.get(); spliteratorSupplier = null; } }
T_SPLITR get() { if (s == null) { s = supplier.get(); } return s; }
/** * Called before advancing to set up spliterator, if needed. */ final void init() { if (spliterator == null) { spliterator = spliteratorSupplier.get(); spliteratorSupplier = null; } }
/** * If a value is present, returns the value, otherwise returns the result * produced by the supplying function. * * @param supplier the supplying function that produces a value to be returned * @return the value, if present, otherwise the result produced by the * supplying function * @throws NullPointerException if value is not present and the supplying * function is {@code null} */ public T orElseGet(Supplier<? extends T> supplier) { return value != null ? value : supplier.get(); }
/** * If a value is present, returns the value, otherwise returns the result * produced by the supplying function. * * @param supplier the supplying function that produces a value to be returned * @return the value, if present, otherwise the result produced by the * supplying function * @throws NullPointerException if value is not present and the supplying * function is {@code null} */ public T orElseGet(Supplier<? extends T> supplier) { return value != null ? value : supplier.get(); }
/** * Forces a get of the image. */ @Override public SingleImage getImage(int index, Supplier<String> custom_name) { initializeIfNeeded(); if (landscapeImages[index] == null) { String str_custom_name = custom_name != null ? custom_name.get() : null; if(str_custom_name == null) str_custom_name = ""; loadLandscapeImage(index, str_custom_name+file_name+"-L"+index); } return landscapeImages[index]; }
@Override public Action getAction() { if (selectedProvider == null || mapPositionProvider == null) { return null; } EMaterialType selected = selectedProvider.get(); ShortPoint2D mapPosition = mapPositionProvider.get(); if (selected == null || mapPosition == null) { return null; } return new SetAcceptedStockMaterialAction(mapPosition, selected, accept, local); }
private String getOrDefault(String key, Supplier<String> defaultProvider) { String value = get(key); return value != null ? value : defaultProvider.get(); }
@Override public boolean tryAdvance(Consumer<? super T> action) { Objects.requireNonNull(action); action.accept(s.get()); return true; }
@Override public <S> Boolean evaluateSequential(PipelineHelper<T> helper, Spliterator<S> spliterator) { return helper.wrapAndCopyInto(sinkSupplier.get(), spliterator).getAndClearState(); }
@Override public <S> O evaluateSequential(PipelineHelper<T> helper, Spliterator<S> spliterator) { O result = helper.wrapAndCopyInto(sinkSupplier.get(), spliterator).get(); return result != null ? result : emptyValue; }
@Override public <S> Boolean evaluateSequential(PipelineHelper<T> helper, Spliterator<S> spliterator) { return helper.wrapAndCopyInto(sinkSupplier.get(), spliterator).getAndClearState(); }
@Override public boolean tryAdvance(Consumer<? super T> action) { Objects.requireNonNull(action); action.accept(s.get()); return true; }
@Override public <S> O evaluateSequential(PipelineHelper<T> helper, Spliterator<S> spliterator) { O result = helper.wrapAndCopyInto(sinkSupplier.get(), spliterator).get(); return result != null ? result : emptyValue; }
@Override public SingleImage getImageSafe(int index, Supplier<String> custom_name) { initializeIfNeeded(); if (index < 0 || index >= length()) { return NullImage.getInstance(); } else { if (guiImages[index] == null) { String str_custom_name = custom_name != null ? custom_name.get() : null; if(str_custom_name == null) str_custom_name = ""; loadGuiImage(index, str_custom_name+file_name+"-G"+index); } return guiImages[index]; } } }
@Override public SingleImage getImageSafe(int index, Supplier<String> custom_name) { initializeIfNeeded(); if (index < 0 || index >= length()) { return NullImage.getInstance(); } else { if (landscapeImages[index] == null) { String str_custom_name = custom_name != null ? custom_name.get() : null; if(str_custom_name == null) str_custom_name = ""; loadLandscapeImage(index, str_custom_name+file_name+"-L"+index); } return landscapeImages[index]; } } }
@Override protected Boolean doLeaf() { boolean b = helper.wrapAndCopyInto(op.sinkSupplier.get(), spliterator).getAndClearState(); if (b == op.matchKind.shortCircuitResult) shortCircuit(b); return null; }
@Override protected Boolean doLeaf() { boolean b = helper.wrapAndCopyInto(op.sinkSupplier.get(), spliterator).getAndClearState(); if (b == op.matchKind.shortCircuitResult) shortCircuit(b); return null; }