method2testcases stringlengths 118 6.63k |
|---|
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public void addLore(ItemStack IS, String lore) { ItemMeta IM = IS.getItemMeta(); if (IM == null) IM = Bukkit.getItemFactory().getItemMeta(IS.getType()); if (IM == null) ret... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public void setLore(ItemStack IS, int index, String lore) { ItemMeta IM = IS.getItemMeta(); if (IM == null) IM = Bukkit.getItemFactory().getItemMeta(IS.getType()); if (IM =... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public void removeLore(ItemStack IS, int index) { ItemMeta IM = IS.getItemMeta(); if (IM == null) IM = Bukkit.getItemFactory().getItemMeta(IS.getType()); if (IM == null) re... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public void clearLore(ItemStack IS) { ItemMeta IM = IS.getItemMeta(); if (IM == null) return; IM.setLore(new ArrayList<>()); IS.setItemMeta(IM); } AbstractCommonFunctions(T... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public int loreSize(ItemStack IS) { ItemMeta IM = IS.getItemMeta(); if (IM == null) return 0; List<String> lores = IM.getLore(); if (lores == null) return 0; return lores.s... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { @Override public String formatCurrency(double money, String locale1, String locale2) { Locale locale = new Locale(locale1, locale2); NumberFormat currencyFormatter = Number... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public Block getTargetBlock(Player player, int maxDistance) { return player.getTargetBlock(null, maxDistance); } AbstractCommonFunctions(TriggerReactorCore plugin); Plugin ... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public ItemStack headForName(String targetName) { return headForName(targetName, 1); } AbstractCommonFunctions(TriggerReactorCore plugin); Plugin plugin(String name); @Depr... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public abstract ItemStack headForValue(String textureValue); AbstractCommonFunctions(TriggerReactorCore plugin); Plugin plugin(String name); @Deprecated abstract boolean ta... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public Location location(String world, double x, double y, double z) { return location(world, x, y, z, 0.0, 0.0); } AbstractCommonFunctions(TriggerReactorCore plugin); Plug... |
### Question:
BukkitMigrationHelper implements IMigrationHelper { @Override public void migrate(IConfigSource current) { traversal(null, oldConfig.getValues(false), current::put); if (oldFile.exists()) oldFile.renameTo(new File(oldFile.getParentFile(), "config.yml.bak")); } BukkitMigrationHelper(FileConfiguration oldCo... |
### Question:
Timings { public static Timing getTiming(String name) { return getTiming(root, name); } static void reset(); static Timing getTiming(String name); static void print(Timing timing, OutputStream stream); static void printAll(OutputStream stream); static final Timing LIMBO; static boolean on; }### Answer:
@... |
### Question:
CommonFunctions implements SelfReference { public int random(int end) { return rand.nextInt(end); } int random(int end); float random(float end); double random(double end); long random(long end); int random(int start, int end); float random(float start, float end); double random(double start, double end)... |
### Question:
CommonFunctions implements SelfReference { public SimpleLocation slocation(String world, int x, int y, int z) { if (world == null) { throw new IllegalArgumentException("world cannot be null"); } return new SimpleLocation(world, x, y, z); } int random(int end); float random(float end); double random(doubl... |
### Question:
GsonConfigSource implements IConfigSource { @Override public void reload() { ensureFile(); synchronized (file) { try (Reader fr = this.readerFactory.apply(file)) { synchronized (cache) { cache.clear(); Map<String, Object> loaded = gson.fromJson(fr, new TypeToken<Map<String, Object>>() { }.getType()); if (... |
### Question:
GsonConfigSource implements IConfigSource { @Override public void saveAll() { ensureFile(); synchronized (file) { cacheToFile(); } } GsonConfigSource(File file); GsonConfigSource(File file, Function<File, Reader> readerFactory, Function<File, Writer> writerFactory); @Override void reload(); @Override voi... |
### Question:
GsonConfigSource implements IConfigSource { private <T> T get(Map<String, Object> map, String[] path, Class<T> asType) { for (int i = 0; i < path.length; i++) { String key = path[i]; Object value = map.get(key); if (i == path.length - 1) { return asType.cast(value); } else if (value instanceof Map) { map ... |
### Question:
GsonConfigSource implements IConfigSource { private void put(Map<String, Object> map, String[] path, Object value) { for (int i = 0; i < path.length; i++) { String key = path[i]; if (i == path.length - 1) { map.put(key, value); } else { Object previous = map.computeIfAbsent(key, (k) -> new HashMap<>()); i... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public Block block(String world, int x, int y, int z) { return location(world, x, y, z).getBlock(); } AbstractCommonFunctions(TriggerReactorCore plugin); Plugin plugin(Stri... |
### Question:
GsonConfigSource implements IConfigSource { @Override public Set<String> keys() { synchronized (cache) { return new HashSet<>(cache.keySet()); } } GsonConfigSource(File file); GsonConfigSource(File file, Function<File, Reader> readerFactory, Function<File, Writer> writerFactory); @Override void reload();... |
### Question:
GsonConfigSource implements IConfigSource { @Override public boolean isSection(String key) { synchronized (cache) { return get(cache, IConfigSource.toPath(key), Object.class) instanceof Map; } } GsonConfigSource(File file); GsonConfigSource(File file, Function<File, Reader> readerFactory, Function<File, ... |
### Question:
Lexer { public Token getToken() throws IOException, LexerException { skipWhiteSpaces(); skipComment(); if (Character.isDigit(c)) { return readNumber(); } if (c == '"') { return readString(); } if (c == '`') { return readMultilineString(); } if (isOperator(c)) { return readOperator(); } if (isIdCharacter(c... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public boolean locationEqual(Location loc1, Location loc2) { return loc1.getWorld() == loc2.getWorld() && loc1.getBlockX() == loc2.getBlockX() && loc1.getBlockY() == loc2.g... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public abstract PotionEffect makePotionEffect(String EffectType, int duration, int amplifier, boolean ambient, boolean particles, Color color); AbstractCommonFunctions(Trig... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public Player player(String name) { return Bukkit.getPlayer(name); } AbstractCommonFunctions(TriggerReactorCore plugin); Plugin plugin(String name); @Deprecated abstract bo... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public OfflinePlayer oplayer(String name) { return Bukkit.getOfflinePlayer(name); } AbstractCommonFunctions(TriggerReactorCore plugin); Plugin plugin(String name); @Depreca... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public abstract Collection<? extends Player> getPlayers(); AbstractCommonFunctions(TriggerReactorCore plugin); Plugin plugin(String name); @Deprecated abstract boolean take... |
### Question:
AbstractCommonFunctions extends io.github.wysohn.triggerreactor.core.manager.trigger.share.CommonFunctions implements SelfReference { public String currentArea(Entity entity) { String[] areas = currentAreasAt(entity.getLocation()); return areas.length > 0 ? areas[0] : null; } AbstractCommonFunctions(Trigg... |
### Question:
MemoryManager { public abstract long acquireExecutionMemory(long numBytes, long taskAttemptId, MemoryMode memoryMode); MemoryManager(SparkConf conf, int numCores, long onHeapStorageMemory, long onHeapExecutionMemory); long pageSizeBytes(); MemoryAllocator tungstenMemoryAllocator(); final void setMemorySto... |
### Question:
SparkContext { public SparkContext(SparkConf conf) { this.conf = conf; this.localProperties = new InheritableThreadLocal<Properties>(){ @Override protected Properties childValue(Properties parentValue) { return SerializationUtils.clone(parentValue); } @Override protected Properties initialValue() { return... |
### Question:
DiskBlockManager { public BlockId[] getAllBlocks() { File[] blockFiles = getAllFiles(); BlockId[] blockIds = new BlockId[blockFiles.length]; for (int i = 0; i < blockFiles.length; ++i) { blockIds[i] = BlockId.apply(blockFiles[i].getName()); } return blockIds; } DiskBlockManager(SparkConf conf, boolean del... |
### Question:
LineChart extends AbstractLineChart { public final void setSparkline(final boolean isSparkline) { this.isSparkline = isSparkline; } LineChart(final ImmutableList<? extends Plot> lines); final void setSparkline(final boolean isSparkline); }### Answer:
@Test public void test4() { final Line line = Plots.ne... |
### Question:
Data { @Override public String toString() { return Arrays.toString(data); } Data(final double... data); @Override String toString(); final double[] getData(); final int getSize(); static Data newData(final double... data); static Data newData(final List<? extends Number> data); static final double MIN_VAL... |
### Question:
AxisStyle implements Kloneable<AxisStyle> { public static AxisStyle newAxisStyle(final Color textColor, final int fontSize, final AxisTextAlignment alignment) { checkNotNull(textColor, "color must not be null"); checkArgument(fontSize > 0, "fontsize must be > 0"); checkNotNull(alignment, "alignment must n... |
### Question:
AbstractAxisChart extends AbstractGraphChart implements GridChart { public final void setGrid(final double xAxisStepSize, final double yAxisStepSize, final int lengthOfLineSegment, final int lengthOfBlankSegment) { checkArgument(xAxisStepSize > 0, "xAxisStepSize must be positive: %s", xAxisStepSize); chec... |
### Question:
AbstractAxisChart extends AbstractGraphChart implements GridChart { public final void addXAxisLabels(final AxisLabels axisLabels) { checkNotNull(axisLabels, "axisLabel cannnot be null"); xAxisLabels.add((AxisLabelsImpl) axisLabels.klone()); } AbstractAxisChart(); final void addXAxisLabels(final AxisLabels... |
### Question:
AbstractAxisChart extends AbstractGraphChart implements GridChart { public final void addYAxisLabels(final AxisLabels axisLabels) { checkNotNull(axisLabels, "axisLabel cannnot be null"); yAxisLabels.add((AxisLabelsImpl) axisLabels.klone()); } AbstractAxisChart(); final void addXAxisLabels(final AxisLabels... |
### Question:
AbstractAxisChart extends AbstractGraphChart implements GridChart { public final void addTopAxisLabels(final AxisLabels axisLabels) { checkNotNull(axisLabels, "axisLabel cannnot be null"); topAxisLabels.add((AxisLabelsImpl) axisLabels.klone()); } AbstractAxisChart(); final void addXAxisLabels(final AxisLa... |
### Question:
AbstractAxisChart extends AbstractGraphChart implements GridChart { public final void addRightAxisLabels(final AxisLabels axisLabels) { checkNotNull(axisLabels, "axisLabels cannnot be null"); rightAxisLabels.add((AxisLabelsImpl) axisLabels.klone()); } AbstractAxisChart(); final void addXAxisLabels(final A... |
### Question:
AbstractAxisChart extends AbstractGraphChart implements GridChart { public final void addMarker(final Marker marker, final double xPos, final double yPos) { checkNotNull(marker, "marker cannnot be null"); checkArgument(xPos >= 0 && xPos <= 100, "xPos must be >= 0 and <= 100: %s", xPos); checkArgument(yPos... |
### Question:
UrlUtil { public static String normalize(final String s) { if (s == null) { return ""; } final ImmutableList<String> stringList = Lists.of(s.split("\\?")); if (stringList.size() != 2) { return s; } final String args = stringList.get(1); final List<String> params = Arrays.asList(args.split("&")); Collectio... |
### Question:
LineStyle { public static LineStyle newLineStyle(final int lineThickness, final int lengthOfLineSegment, final int lengthOfBlankSegment) { checkArgument(lineThickness > 0, "line thickness must be > 0: %s", lineThickness); checkArgument(lengthOfLineSegment >= 0, "length of line segment must be >= 0: %s", l... |
### Question:
GCharts { public static LineChart newLineChart(final Line... plots) { checkNotNull(plots, "plots cannot be null or contain a null."); checkContentsNotNull(Arrays.asList(plots), "plots cannot be null or contain a null."); return new LineChart(Plots.copyOf(plots)); } private GCharts(); static LineChart new... |
### Question:
PieChart extends AbstractGraphChart { public final void setThreeD(final boolean threeD) { this.threeD = threeD; } PieChart(final ImmutableList<? extends Slice> slices); void setOrientation(final double radians); final boolean isThreeD(); final void setThreeD(final boolean threeD); }### Answer:
@Test publ... |
### Question:
PieChart extends AbstractGraphChart { public void setOrientation(final double radians) { this.orientation = radians; } PieChart(final ImmutableList<? extends Slice> slices); void setOrientation(final double radians); final boolean isThreeD(); final void setThreeD(final boolean threeD); }### Answer:
@Test... |
### Question:
AbstractMarkableChart extends AbstractAxisChart { public final void addHorizontalRangeMarker(final double startPoint, final double endPoint, final Color color) { checkRangeArgs(startPoint, endPoint); checkNotNull(color, "Color cannot be null."); horizontalRangeMarkers.add(new HorizontalRangeMarker(color, ... |
### Question:
AbstractGraphChart extends AbstractGChart implements GraphChart, TitledChart { public final void setTitle(final String title) { checkNotNull(title, "Title cannot be null."); this.chartTitle = new ChartTitle(title); } AbstractGraphChart(); final void setTitle(final String title); final void setTitle(final ... |
### Question:
AbstractMarkableChart extends AbstractAxisChart { public final void addVerticalRangeMarker(final double startPoint, final double endPoint, final Color color) { checkRangeArgs(startPoint, endPoint); checkNotNull(color, "Color cannot be null."); verticalRangeMarkers.add(new VerticalRangeMarker(color, startP... |
### Question:
MapChart extends AbstractGChart { public final void addPoliticalBoundaries(final PoliticalBoundary... politicalBoundaries) { pBoundaries.addAll(Lists.of(politicalBoundaries)); } MapChart(final GeographicalArea geographicalArea); final void setColorGradient(final Color defaultColor, final Color... colorGra... |
### Question:
DataUtil { public static Data scaleWithinRange(final double min, final double max, final double[] data) { checkArgument(max - min > 0, "min >= max!"); return Data.newData(privateScale(data, min, max)); } private DataUtil(); static Data scaleWithinRange(final double min, final double max, final double[] d... |
### Question:
DataUtil { public static Data scale(final double... data) { checkNotNull(data, "data is null or contents of data is null."); final double min = Collections.min(PrimitiveArrays.asList(data)); final double max = Collections.max(PrimitiveArrays.asList(data)); checkArgument(min < max, "Cannot scale this data.... |
### Question:
DataUtil { public static List<Data> scaleDataList(final List<? extends List<? extends Number>> data) { checkContentsNotNull(data, "data is null or contents of data is null."); final double[][] d = new double[data.size()][]; int j = 0; for (List<? extends Number> datum : data) { checkContentsNotNull(datum,... |
### Question:
DataParameter extends AbstractParameter { void addData(final Data data) { datas.add(data); } DataParameter(); @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test0() { final Data data = new Data(1, 2, 3); final DataParameter p = new DataParameter(); p.addData(data);... |
### Question:
PieChartAndGoogleOMeterLegendParameter extends AbstractParameter { void addLegend(final String legend) { this.legends.add(legend); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test0() { final PieChartAndGoogleOMeterLegendParameter p = new PieChartAndGoogleOMet... |
### Question:
AxisTypesParameter extends AbstractParameter { void addAxisTypes(final AxisTypes axisTypes) { axisTypesList.add(axisTypes); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test0() { final AxisTypesParameter p = new AxisTypesParameter(); p.addAxisTypes(AxisTypes.B... |
### Question:
AxisLabelPositionsParameter extends AbstractParameter { void addLabelPosition(final int index, final ImmutableList<? extends Number> positions) { labelPositions.add(new AxisLabelPositions(index, positions)); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test0()... |
### Question:
ColorsParameter extends AbstractParameter { void addColors(final ImmutableList<? extends ImmutableList<? extends Color>> colors) { for (ImmutableList<? extends Color> listOfColors : colors) { final List<Color> l = Lists.newLinkedList(); l.addAll(listOfColors); this.colors.add(l); } } @Override String get... |
### Question:
AxisStylesParameter extends AbstractParameter { void addAxisStyle(final int index, final AxisStyle axisStyle) { axisStyles.add(new PrivateAxisStyles(index, axisStyle)); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test0() { final AxisStylesParameter p = new Ax... |
### Question:
ChartFillsParameter extends AbstractParameter { void addLinearGradientFill(final FillType fillType, final int angle, final ImmutableList<? extends ColorAndOffset> colorAndOffsets) { fills.add(new LinearGradient(fillType, angle, colorAndOffsets)); } @Override String getKey(); @Override String getValue(); ... |
### Question:
ChartFillsParameter extends AbstractParameter { void addLinearStripeFill(final FillType fillType, final int angle, final ImmutableList<? extends ColorAndWidth> colorAndWidths) { fills.add(new LinearStripes(fillType, angle, colorAndWidths)); } @Override String getKey(); @Override String getValue(); }### ... |
### Question:
ChartFillsParameter extends AbstractParameter { void addSolidFill(final SolidFillType solidFillType, final Color color) { fills.add(new Solid(solidFillType, color)); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test2() { final ChartFillsParameter p = new Chart... |
### Question:
AxisRangesParameter extends AbstractParameter { void addAxisRange(final int index, final double startOfRange, final double endOfRange, final double interval) { axisRanges.add(new AxisRange(index, startOfRange, endOfRange, interval)); } @Override String getKey(); @Override String getValue(); }### Answer:... |
### Question:
DataLegendsParameter extends AbstractParameter { void addLegends(final ImmutableList<? extends String> legends) { this.legends.addAll(legends); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test0() { final DataLegendsParameter p = new DataLegendsParameter(); p.... |
### Question:
ChartMarkersParameter extends AbstractParameter { void addFillAreaMarker(final FillAreaType fillAreaType, final Color color, final int startLineIndex, final int endLineIndex) { markers.add(new FillAreaMarker(fillAreaType, color, startLineIndex, endLineIndex)); } @Override String getKey(); @Override Strin... |
### Question:
ChartMarkersParameter extends AbstractParameter { void addLineStyleMarker(final Color color, final int dataSetIndex, final int dataPoint, final int size, final Priority priority) { markers.add(new LineStyleMarker(color, dataSetIndex, dataPoint, size, priority)); } @Override String getKey(); @Override Str... |
### Question:
ChartMarkersParameter extends AbstractParameter { void addHorizontalRangeMarker(final Color color, final double startPoint, final double endPoint) { markers.add(new RangeMarker(RangeType.HORIZONTAL, color, startPoint, endPoint)); } @Override String getKey(); @Override String getValue(); }### Answer:
@Te... |
### Question:
ChartMarkersParameter extends AbstractParameter { void addMarker(final Marker marker, final int dataSetIndex, final int startIndex, final int endIndex, final int n) { if (marker instanceof ShapeMarker) { markers.add(new ShapeMarkerParam((ShapeMarker) marker, dataSetIndex, startIndex, endIndex, n)); } else... |
### Question:
ChartMarkersParameter extends AbstractParameter { void addMarkers(final Marker marker, final int dataSetIndex) { addMarker(marker, dataSetIndex, -1, 0, 0); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test9() { final ChartMarkersParameter p = new ChartMarkersP... |
### Question:
ChartMarkersParameter extends AbstractParameter { void addFreeMarker(final Marker marker, final double xPos, final double yPos) { markers.add(new FreeMarker(marker, xPos, yPos)); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void addFreeShapeMarker() { final ChartMa... |
### Question:
GeoCodesParameter extends AbstractParameter { void addGeoCode(final String geoCodes) { this.geoCodes.add(geoCodes); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test0() { final GeoCodesParameter p = new GeoCodesParameter(); p.addGeoCode(UNITED_STATES + ""); p.... |
### Question:
LineChartLineStylesParameter extends AbstractParameter { void addLineStyle(final LineStyle lineStyle) { this.lineStyles.add(new LineStyleWrapper(lineStyle)); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test0() { final LineChartLineStylesParameter p = new Line... |
### Question:
AbstractGraphChart extends AbstractGChart implements GraphChart, TitledChart { public final void setLegendPosition(final LegendPosition legendPosition) { checkNotNull(legendPosition, "Legend position cannot be null."); this.legendPosition = legendPosition; } AbstractGraphChart(); final void setTitle(final... |
### Question:
AxisLabelsParameter extends AbstractParameter { void addAxisLabels(final int index, final ImmutableList<? extends String> labels) { axisLabels.add(new AxisLabels(index, labels)); } @Override String getKey(); @Override String getValue(); }### Answer:
@Test public void test0() { final AxisLabelsParameter ... |
### Question:
BarChart extends AbstractAxisChart { public final void setHorizontal(final boolean horizontal) { this.horizontal = horizontal; } BarChart(final ImmutableList<? extends Plot> barChartPlots); final void setDataStacked(final boolean dataStacked); final void setHorizontal(final boolean horizontal); final void... |
### Question:
BarChart extends AbstractAxisChart { public final void setDataStacked(final boolean dataStacked) { this.dataStacked = dataStacked; } BarChart(final ImmutableList<? extends Plot> barChartPlots); final void setDataStacked(final boolean dataStacked); final void setHorizontal(final boolean horizontal); final ... |
### Question:
BarChart extends AbstractAxisChart { public final void setSpaceBetweenGroupsOfBars(final int spaceBetweenGroupsOfBars) { checkArgument(spaceWithinGroupsOfBars >= 0, "spaceWithinGroupsOfBars must be >= 0"); this.spaceBetweenGroupsOfBars = spaceBetweenGroupsOfBars; } BarChart(final ImmutableList<? extends P... |
### Question:
BarChart extends AbstractAxisChart { public final void setBarWidth(final int barWidth) { checkArgument(barWidth > -1, "barWidth must be > 0"); this.barWidth = barWidth; } BarChart(final ImmutableList<? extends Plot> barChartPlots); final void setDataStacked(final boolean dataStacked); final void setHorizo... |
### Question:
BarChart extends AbstractAxisChart { public final void setSpaceWithinGroupsOfBars(final int spaceWithinGroupsOfBars) { checkArgument(spaceWithinGroupsOfBars >= 0, "spaceWithinGroupsOfBars must be >= 0"); this.spaceWithinGroupsOfBars = spaceWithinGroupsOfBars; } BarChart(final ImmutableList<? extends Plot>... |
### Question:
AbstractGChart implements GChart { public void setSize(final int width, final int height) { checkArgument(width * height <= MAX_PIXELS, "The largest possible area for all charts except maps is 300,000 pixels."); checkArgument(width > MIN_WIDTH && width <= MAX_WIDTH, "width must be > " + MIN_WIDTH + " and ... |
### Question:
AbstractGChart implements GChart { public void setBackgroundFill(final Fill fill) { checkNotNull(fill, "The background fill cannot be null"); this.backgroundFill = fill; } AbstractGChart(); void setSize(final int width, final int height); final Map<String, String> getParameters(); final String toURLString... |
### Question:
AbstractGChart implements GChart { public void setTransparency(final int opacity) { checkArgument(opacity >= MIN_OPACITY && opacity <= MAX_OPACITY, "opacity must be between " + MIN_OPACITY + " and " + MAX_OPACITY + ": %s", opacity); this.opacity = opacity; } AbstractGChart(); void setSize(final int width,... |
### Question:
AbstractGChart implements GChart { public void setURLEndpoint(final String urlEndpoint) { checkNotNull(urlEndpoint, "The chart URL endpoint cannot be null"); this.chartURLEndpoint = urlEndpoint; } AbstractGChart(); void setSize(final int width, final int height); final Map<String, String> getParameters();... |
### Question:
AbstractGChart implements GChart { public final Map<String, String> getParameters() { parameterManager.init(chartURLEndpoint); prepareData(); return parameterManager.getParameterMap(); } AbstractGChart(); void setSize(final int width, final int height); final Map<String, String> getParameters(); final Str... |
### Question:
AbstractGraphChart extends AbstractGChart implements GraphChart, TitledChart { public void setLegendMargins(final int legendWidth, final int legendHeight) { this.legendMargins = new LegendMargins(legendWidth, legendHeight); } AbstractGraphChart(); final void setTitle(final String title); final void setTit... |
### Question:
AbstractGraphChart extends AbstractGChart implements GraphChart, TitledChart { public final void setAreaFill(final Fill fill) { areaFill = fill.klone(); } AbstractGraphChart(); final void setTitle(final String title); final void setTitle(final String title, final Color color, final int fontSize); final vo... |
### Question:
ClassLoaderUtil { public static String classnameFromFilename(final String filename) { Objects.requireNonNull(filename); return StreamSupport.stream( Paths.get(filename.replaceFirst("\\.class$", "")).spliterator(), false) .map(Path::toString) .collect(Collectors.joining(".")); } private ClassLoaderUtil();... |
### Question:
ClassLoaderUtil { public static String resourceNameFromClassName(final String className) { Objects.requireNonNull(className); return className.replace('.', '/') + ".class"; } private ClassLoaderUtil(); static URL toUrl(final Path file); static String classnameFromFilename(final String filename); static S... |
### Question:
LobbyPresenter extends BasePresenter<LobbyView> { String getLocalReport() { String localReport = lobbyReportUseCase.getLocalReport(); Timber.d("localReport: %s", localReport); return localReport; } @Inject LobbyPresenter(LobbyReportUseCase lobbyReportUseCase, SchedulersFacade schedulersFacade); }### An... |
### Question:
LobbyActivity extends AppCompatActivity implements LobbyView { @Override public void displayReportData(CharSequence report) { displayReportTextView.setVisibility(View.VISIBLE); displayReportTextView.setText(report); } @OnClick(R.id.generate_report) void onGenerateReportButtonClicked(); @Override void dis... |
### Question:
LobbyActivity extends AppCompatActivity implements LobbyView { @Override public void displayReportError() { Toast.makeText(this, R.string.lobby_report_error_text, Toast.LENGTH_LONG).show(); } @OnClick(R.id.generate_report) void onGenerateReportButtonClicked(); @Override void displayReportData(CharSequenc... |
### Question:
LobbyActivity extends AppCompatActivity implements LobbyView { @Override public void hideReportData() { displayReportTextView.setVisibility(View.GONE); } @OnClick(R.id.generate_report) void onGenerateReportButtonClicked(); @Override void displayReportData(CharSequence report); @Override void hideReportDa... |
### Question:
LobbyActivity extends AppCompatActivity implements LobbyView { @Override public void displayLoadingIndicator() { loadingIndicator.setVisibility(View.VISIBLE); } @OnClick(R.id.generate_report) void onGenerateReportButtonClicked(); @Override void displayReportData(CharSequence report); @Override void hideR... |
### Question:
LobbyActivity extends AppCompatActivity implements LobbyView { @Override public void hideLoadingIndicator() { loadingIndicator.setVisibility(View.GONE); } @OnClick(R.id.generate_report) void onGenerateReportButtonClicked(); @Override void displayReportData(CharSequence report); @Override void hideReportD... |
### Question:
LobbyReportUseCase { Single<String> generateReport() { return repository.getReportAsync(); } @Inject LobbyReportUseCase(LobbyRepository repository); }### Answer:
@Test public void generateReport_getsReportAsyncFromRepository() throws Exception { testSubject.generateReport(); verify(lobbyRepository).get... |
### Question:
LobbyReportUseCase { String getLocalReport() { return repository.getReport(); } @Inject LobbyReportUseCase(LobbyRepository repository); }### Answer:
@Test public void getLocalReport_getsReportFromRepository() throws Exception { testSubject.getLocalReport(); verify(lobbyRepository).getReport(); } |
### Question:
LobbyPresenter extends BasePresenter<LobbyView> { void generateReport() { addDisposable(lobbyReportUseCase.generateReport() .doOnSubscribe(s -> publishRequestState(RequestState.LOADING)) .subscribeOn(schedulersFacade.io()) .observeOn(schedulersFacade.ui()) .delay(REPORT_DELAY_MILLIS, TimeUnit.MILLISECONDS... |
### Question:
LobbyPresenter extends BasePresenter<LobbyView> { void onReportDataAvailable(String report) { Timber.d("report data: %s", report); view.displayReportData(report); } @Inject LobbyPresenter(LobbyReportUseCase lobbyReportUseCase, SchedulersFacade schedulersFacade); }### Answer:
@Test public void onReportD... |
### Question:
LobbyPresenter extends BasePresenter<LobbyView> { void onReportDataError(Throwable throwable) { Timber.e(throwable, "report error"); view.displayReportError(); } @Inject LobbyPresenter(LobbyReportUseCase lobbyReportUseCase, SchedulersFacade schedulersFacade); }### Answer:
@Test public void onReportData... |
### Question:
LobbyRepositoryImpl implements LobbyRepository { @Override public Single<String> getReportAsync() { return Single.just(FAKE_REPORT_DATA); } @Override Single<String> getReportAsync(); @Override String getReport(); }### Answer:
@Test public void getReportAsync_onSuccess_returnsReportData() throws Exceptio... |
### Question:
LobbyRepositoryImpl implements LobbyRepository { @Override public String getReport() { return FAKE_REPORT_DATA; } @Override Single<String> getReportAsync(); @Override String getReport(); }### Answer:
@Test public void getReport_returnsReportData() throws Exception { String result = testSubject.getReport... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.