code
stringlengths
146
69.7k
prompt
stringlengths
55
1.5k
Of course, here is the Java code you requested: ```java public void insertConstructor(InsertableConstructor insertableConstructor) throws CannotCompileException, AfterBurnerImpossibleException, NotFoundException { // create or complete onViewCreated List<CtConstructor> constructorList = extractExis...
Create a Java method that does the following: "Insert a constructor in the class.".
Of course, here is the Java code you requested: ```java @Deprecated public void overwriteRecordAt(long pointer, T record) throws IOException { long tmpPointer = this.writeView.getCurrentPointer(); this.writeView.resetTo(pointer); this.serializer.serialize(record, this.writeView); this.writeView.resetTo(tmpPoi...
Create a Java method that does the following: "Overwrites the record at the given pointer.".
Of course, here is the Java code you requested: ```java public String getValue(final String key) { Validate.notEmpty(key, "key cannot be empty"); final List<String> allValues = this.getValues(key); return allValues != null ? allValues.get(0) : null; } ``` Hope this helps!
Create a Java method that does the following: "Gets the value of a single language element.".
Of course, here is the Java code you requested: ```java @VisibleForTesting byte[] getAESKey() throws IncompatibleDeviceException, CryptoException { final String encodedEncryptedAES = storage.retrieveString(KEY_ALIAS); if (encodedEncryptedAES != null) { //Return existing key ...
Create a Java method that does the following: "Get the AES key.".
Of course, here is the Java code you requested: ```java private Object setElementCollection(Object entity, Object thriftColumnValue, MetamodelImpl metaModel, Attribute attribute) { String cqlColumnMetadata = null; Map<ByteBuffer, String> schemaTypes = this.clientBase.getCqlMetadata().ge...
Create a Java method that does the following: "Sets the element collection.".
Of course, here is the Java code you requested: ```java public List<OkCoinKline> getKlines( CurrencyPair currencyPair, OkCoinKlineType type, Integer size, Long timestamp) throws IOException { List<OkCoinKline> klineList = new ArrayList<>(); List<Object[]> list = okCoin.getKlines(OkCoinAdapt...
Create a Java method that does the following: "Get a list of okcoin klines".
Of course, here is the Java code you requested: ```java public static String[] fastSplit(String re, String input, int limit) { // Can we do it cheaply? int len = re.length(); if (len == 0) { return null; } char ch = re.charAt(0); if (len == 1 && FASTSPLIT_MET...
Create a Java method that does the following: "Fast split method.".
Of course, here is the Java code you requested: ```java public Object getModuleParam(String moduleName, String paramName) { Map<String, Object> moduleParams = getModuleParams(moduleName); if (moduleParams == null) { return null; } return moduleParams.get(paramName); ...
Create a Java method that does the following: "Gets a single related parameter from a module.".
Of course, here is the Java code you requested: ```java public List<Variable> getVariables(Object groupIdOrPath, int page, int perPage) throws GitLabApiException { Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "groups", getGroupIdOrPath(groupIdOrPath), "variables"); ret...
Create a Java method that does the following: "Get a list of variables belonging to the specified group.".
Of course, here is the Java code you requested: ```java public JobClientNode getAvailableJobClient(String nodeGroup) { Set<JobClientNode> jobClientNodes = NODE_MAP.get(nodeGroup); if (CollectionUtils.isEmpty(jobClientNodes)) { return null; } List<JobClientNode> list = new...
Create a Java method that does the following: "Get the JobClientNode from the nodeGroup.".
Of course, here is the Java code you requested: ```java @Override public ListEndpointConfigsResult listEndpointConfigs(ListEndpointConfigsRequest request) { request = beforeClientExecution(request); return executeListEndpointConfigs(request); } ``` Hope this helps!
Create a Java method that does the following: "Returns a list of endpoint configurations for an app.".
Of course, here is the Java code you requested: ```java private void getRubygemsSetupScript(RubyStringBuilder builder) { File[] gemPaths = gemsConfig.getGemPath(); if (gemHome == null && gemPaths == null) { return; } builder.appendLine("# Set up GEM_HOME and GEM_PATH for ru...
Create a Java method that does the following: "Get the RubyStringBuilder for the setup script.".
Of course, here is the Java code you requested: ```java public List<EventHubConnectionInner> listByDatabase(String resourceGroupName, String clusterName, String databaseName) { return listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); } ``` H...
Create a Java method that does the following: "Gets a list of event hub connections.".
Of course, here is the Java code you requested: ```java private String getBasePath(RamlRoot loadRamlFromFile) { // we take the given baseUri from raml spec by default. String basePath = loadRamlFromFile.getBaseUri(); // If the baseUri is explicitly set by the plugin configuration we take // it. if (baseUri ...
Create a Java method that does the following: "Get the base path from the file.".
Of course, here is the Java code you requested: ```java public void updateSitePath(String sitepath, I_CmsSitemapController controller) { if (!isLeafType() && !sitepath.endsWith("/")) { sitepath = sitepath + "/"; } if (!m_sitePath.equals(sitepath)) { // update the vfs pa...
Create a Java method that does the following: "Updates the site path.".
Of course, here is the Java code you requested: ```java private void parseLastConsonant() { if (!validViSyll) return; if (iCurPos > strSyllable.length()) strLastConsonant = ZERO; String strCon = strSyllable.substring(iCurPos, strSyllable.length()); if (strCon.length() > 3) { validViSyll = false; r...
Create a Java method that does the following: "Parse the last consonant.".
Of course, here is the Java code you requested: ```java public static <T extends CharSequence> T findMinimum(Collection<T> ss, CharSequence t) { int min = Integer.MAX_VALUE; T result = null; for (T s : ss) { int d = StringUtils.getLevenshteinDistance(s, t); if (d < min) { min = d; result = s; ...
Create a Java method that does the following: "Find the minimum of the given characters in the given collection.".
Of course, here is the Java code you requested: ```java protected List<Application> getApplicationTemplate(final byte[] pData) { List<Application> ret = new ArrayList<Application>(); // Search Application template List<TLV> listTlv = TlvUtil.getlistTLV(pData, EmvTags.APPLICATION_TEMPLATE); // For each applicat...
Create a Java method that does the following: "Get the Application Template from the given byte array.".
Of course, here is the Java code you requested: ```java public static gslbvserver_stats get(nitro_service service, String name) throws Exception{ gslbvserver_stats obj = new gslbvserver_stats(); obj.set_name(name); gslbvserver_stats response = (gslbvserver_stats) obj.stat_resource(service); return response; }...
Create a Java method that does the following: "Use this API to fetch statistics of gslbvserver_stats resource of given name.".
Of course, here is the Java code you requested: ```java @Override public DescribeElasticsearchDomainResult describeElasticsearchDomain(DescribeElasticsearchDomainRequest request) { request = beforeClientExecution(request); return executeDescribeElasticsearchDomain(request); } ``` Hope this hel...
Create a Java method that does the following: "Retrieves information about an Elasticsearch domain.".
Of course, here is the Java code you requested: ```java public String getLocaleSeparator() { String sub0 = "{0}"; String sub1 = "{1}"; ICUResourceBundle locDispBundle = (ICUResourceBundle) langBundle.get(LOCALE_DISPLAY_PATTERN); String localeSeparator = locDispBundle.getStringWithFallb...
Create a Java method that does the following: "Get the locale separator.".
Of course, here is the Java code you requested: ```java private boolean writeToCharacteristic(BluetoothGattCharacteristic charc, byte[] data) { charc.setValue(data); boolean result = mGattClient.writeCharacteristic(charc); if (result) { Log.d(TAG, "Wrote to characteristic: " + charc...
Create a Java method that does the following: "Write a byte array to a characteristic.".
Of course, here is the Java code you requested: ```java @Override public FastStr replace(CharSequence target, CharSequence replacement) { return unsafeOf(Pattern.compile(target.toString(), Pattern.LITERAL).matcher( this).replaceAll(Matcher.quoteReplacement(replacement.toString()))); } `...
Create a Java method that does the following: "Replace all occurrences of target with replacement.".
Of course, here is the Java code you requested: ```java protected static void log(Level level, Object message, Throwable throwable, Object... args) { Message payload = payload(message, args, throwable); payload.getFormattedMessage(); // preformat message (cached), so formating has processed and added fields to Met...
Create a Java method that does the following: "Log a message with a throwable.".
Of course, here is the Java code you requested: ```java public static <T> T invokeGetter(final Object target, final String name) { String getterMethodName = GETTER_PREFIX + StringUtils.capitalize(name); return (T) invokeMethod(target, getterMethodName, new Class[] {}, new Object[] {}); } ``` Hope this helps!
Create a Java method that does the following: "Invoke a method that returns the value of the specified property on the specified object.".
Of course, here is the Java code you requested: ```java @NonNull public static Term function(@NonNull CqlIdentifier functionId, @NonNull Term... arguments) { return function(functionId, Arrays.asList(arguments)); } ``` Hope this helps!
Create a Java method that does the following: "Function with arguments".
Of course, here is the Java code you requested: ```java public T get() { return getInternal( x -> x, () -> { T defaultValue = defaultExpression.get(); if (defaultValue == null) { throw new IllegalStateException("Val...
Create a Java method that does the following: "Gets the value of the attribute.".
Of course, here is the Java code you requested: ```java public long add(long instant, long months) { int i_months = (int)months; if (i_months == months) { return add(instant, i_months); } // Copied from add(long, int) and modified slightly: long timePart = iChronol...
Create a Java method that does the following: "Add to the specified number of months.".
Of course, here is the Java code you requested: ```java private void closeStatement(Statement stmt) { if (stmt != null) { try { stmt.close(); } catch (SQLException e) { logger.error("Could not close JDBC Statement", e); } catch (Throwable e) { logger.error("Unexpected exce...
Create a Java method that does the following: "Close the JDBC Statement.".
Of course, here is the Java code you requested: ```java public ManagementLockObjectInner createOrUpdateByScope(String scope, String lockName, ManagementLockObjectInner parameters) { return createOrUpdateByScopeWithServiceResponseAsync(scope, lockName, parameters).toBlocking().single().body(); } ``` Hope t...
Create a Java method that does the following: "Creates or updates an existing management lock object.".
Of course, here is the Java code you requested: ```java @Override public synchronized ISession getSession(final SessionConfiguration pSessionConf) throws TTException { final File resourceFile = new File(new File(mStorageConfig.mFile, StorageConfiguration.Paths.Data.getFile().getName()), ...
Create a Java method that does the following: "Get a session from the session configuration.".
Of course, here is the Java code you requested: ```java @Override public void writeRecord(Record record) throws IOException { try { for (int x = 0; x < record.getNumFields(); x++) { Value temp = record.getField(x, fieldClasses[x]); addValue(x + 1, temp); } upload.addBatch(); batchCount++; if(...
Create a Java method that does the following: "Write a single record to the underlying database.".
Of course, here is the Java code you requested: ```java public void setActionConfigurationProperties(java.util.Collection<ActionConfigurationProperty> actionConfigurationProperties) { if (actionConfigurationProperties == null) { this.actionConfigurationProperties = null; return; ...
Create a Java method that does the following: "Sets the value of the actionConfigurationProperties property.".
Of course, here is the Java code you requested: ```java public final void removeAllHelperTexts(@NonNull final Collection<CharSequence> helperTexts) { Condition.INSTANCE.ensureNotNull(helperTexts, "The collection may not be null"); for (CharSequence helperText : helperTexts) { removeHelperT...
Create a Java method that does the following: "Removes all helper texts from a specific collection.".
Of course, here is the Java code you requested: ```java public void performTranslation(File gensrcDir, Map<String,Transformer> suffixRules) { Map<String,Transformer> sr = new HashMap<String,Transformer>(); for (Map.Entry<String,Transformer> e : suffixRules.entrySet()) { if (e.getValue() != ...
Create a Java method that does the following: "Performs translation on the specified GENSRC directory.".
Of course, here is the Java code you requested: ```java private void updateComputeNodeUser(String poolId, String nodeId, String userName, NodeUpdateUserParameter nodeUpdateUserParameter, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { ComputeNodeUpdateUserOptions op...
Create a Java method that does the following: "Updates the specified compute node user.".
Of course, here is the Java code you requested: ```java public boolean recordXidGenerator() { if (!currentInfo.isXidGenerator()) { currentInfo.setXidGenerator(true); populated = true; return true; } else { return false; } } ``` Hope this helps!
Create a Java method that does the following: "Records the generation of a XidGenerator.".
Of course, here is the Java code you requested: ```java public ResponseEncapsulation sendRequest(MessageType type, byte[] body) throws IOException { sendRequestHeader(type, (body != null) ? body.length : 0); if (body != null) { os.write(body); } return recvMessage(); } ``` Hope this helps!
Create a Java method that does the following: "Send a message to the server.".
Of course, here is the Java code you requested: ```java public static List<ComparisonExpression> extractSupportedSpatialComparisons(Expression filterExpression) { return extractConjuncts(filterExpression).stream() .filter(ComparisonExpression.class::isInstance) .map(Comparis...
Create a Java method that does the following: "Extract supported spatial comparisons from a filter expression.".
Of course, here is the Java code you requested: ```java public Map < String, RootCompositeType > build(XmlSchema xmlSchema) throws Xsd2ConverterException { log.debug("visit XML Schema started"); Map < String, RootCompositeType > rootComplexTypes = new LinkedHashMap < String, RootCompositeT...
Create a Java method that does the following: "Build a Map of RootCompositeType objects from an XML Schema.".
Of course, here is the Java code you requested: ```java public ServerAzureADAdministratorInner beginCreateOrUpdate(String resourceGroupName, String serverName, ServerAzureADAdministratorInner properties) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, properties).toBlocking(...
Create a Java method that does the following: "Creates or updates a server s CIDCTYPE.".
Of course, here is the Java code you requested: ```java public static void createAndRegister(final String thriftEndpoint, final String serviceName) { synchronized (monitor) { checkState(handler == null, "Jaeger exporter is already registered."); final SpanExporter.Handler newHandler = newHandler(thrift...
Create a Java method that does the following: "Creates and registers the Jaeger Trace exporter.".
Of course, here is the Java code you requested: ```java public static String replaceNorwegianLetters(CharSequence text) { Pattern norwegianLettersPattern = Pattern.compile("\u00F8|\u00D8|\u00E6|\u00C6|\u00E5|\u00C5"); Matcher norwegianLetterMatcher = norwegianLettersPattern.matcher(text); StringBuffer replace...
Create a Java method that does the following: "Replaces all norwegian letters in the given text with their corresponding characters.".
Of course, here is the Java code you requested: ```java public void dhtPutItem(byte[] publicKey, byte[] privateKey, Entry entry, byte[] salt) { s.dht_put_item(Vectors.bytes2byte_vector(publicKey), Vectors.bytes2byte_vector(privateKey), entry.swig(), Vectors.bytes...
Create a Java method that does the following: "DHT put item.".
Of course, here is the Java code you requested: ```java public RetryerBuilder<V> withRetryListener(@Nonnull RetryListener listener) { Preconditions.checkNotNull(listener, "listener may not be null"); listeners.add(listener); return this; } ``` Hope this helps!
Create a Java method that does the following: "Adds a retry listener.".
Of course, here is the Java code you requested: ```java protected void setAuthenticateHeader(MobicentsSipServletRequest request, MobicentsSipServletResponse response, MobicentsSipLoginConfig config, String nOnce) { ...
Create a Java method that does the following: "Set the authentication header for the SIP response".
Of course, here is the Java code you requested: ```java private synchronized void updateBlockInfo(LogEntry e) { BlockScanInfo info = blockMap.get(new Block(e.blockId, 0, e.genStamp)); if(info != null && e.verificationTime > 0 && info.lastScanTime < e.verificationTime) { delBlockInfo(info); ...
Create a Java method that does the following: "Update the BlockScanInfo object with information from a log entry.".
Of course, here is the Java code you requested: ```java public final void setText(@Nullable final String text) { boolean hasDisabledDependents = shouldDisableDependents(); this.text = text; persistString(text); boolean isDisablingDependents = shouldDisableDependents(); if (isDi...
Create a Java method that does the following: "Sets the text of the record.".
Of course, here is the Java code you requested: ```java protected void ensureExecutionInitialized() { if (execution == null && executionId != null) { execution = Context .getCommandContext() .getExecutionManager() .findExecutionById(executionId); } } ``` Hope this helps!
Create a Java method that does the following: "Ensure that the execution is initialized.".
Of course, here is the Java code you requested: ```java public void marshall(UpdateInstanceRequest updateInstanceRequest, ProtocolMarshaller protocolMarshaller) { if (updateInstanceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try {...
Create a Java method that does the following: "marshalls the given parameter object.".
Of course, here is the Java code you requested: ```java byte[] toByteArray(ByteArrayOutputStream os) { os.write(channelid); os.write(status); if (endpt != null && crd != null) { byte[] buf = endpt.toByteArray(); os.write(buf, 0, buf.length); buf = crd.toByteArray(); os.write(buf, 0, buf.leng...
Create a Java method that does the following: "Returns a byte array containing the data of the operation.".
Of course, here is the Java code you requested: ```java public void marshall(GetResourcesRequest getResourcesRequest, ProtocolMarshaller protocolMarshaller) { if (getResourcesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
Create a Java method that does the following: "marshalls the given getResourcesRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public BufferedImage getSnapshot () { BufferedImage img = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB); Graphics2D gfx = img.createGraphics(); try { for (Mirage m : _mirages) { ...
Create a Java method that does the following: "Get a snapshot of the image of the image.".
Of course, here is the Java code you requested: ```java public static boolean isAsciiDigtalNumber(final String str) { if (N.isNullOrEmpty(str)) { return false; } final char[] chs = getCharsForReadOnly(str); int i = 0, num = 0; if (chs[i] == '+' || chs[i] ==...
Create a Java method that does the following: "Checks if the specified string is ASCII digit.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public EList<IfcCompositeCurveSegment> getSegments() { return (EList<IfcCompositeCurveSegment>) eGet(Ifc2x3tc1Package.Literals.IFC_COMPOSITE_CURVE__SEGMENTS, true); } ``` Hope this helps!
Create a Java method that does the following: "Gets the list of segments contained in this composite curve.".
Of course, here is the Java code you requested: ```java private int healthCheckFailed() { int oldState, newState; for (;;) { oldState = this.state; if ((oldState & ERROR) != ERROR) { newState = oldState | ERROR; UndertowLogger.ROOT_LOGGER.nodeIsIn...
Create a Java method that does the following: "health check failed.".
Of course, here is the Java code you requested: ```java protected BackedSession readFromExternal(String id) { PreparedStatement s = null; String appName = getIStore().getId(); Connection con = getConnection(false); if (con == null) { if (com.ibm.websphere.ras.TraceComponen...
Create a Java method that does the following: "Read a session from an external database".
Of course, here is the Java code you requested: ```java ClientStream returnStream() { synchronized (lock) { if (returnedStream == null) { // apply() has not been called, needs to buffer the requests. delayedStream = new DelayedStream(); return returnedStream = delayedStream; } e...
Create a Java method that does the following: "Returns the stream that was returned by the server.".
Of course, here is the Java code you requested: ```java public void startTracking() { if (isTracking) { return; } if (this.session == null) { addBroadcastReceiver(); } // if the session is not null, then add the callback to it right away i...
Create a Java method that does the following: "Start tracking the session.".
Of course, here is the Java code you requested: ```java public Observable<ServiceResponse<Page<ComputePolicyInner>>> listByAccountNextWithServiceResponseAsync(final String nextPageLink) { return listByAccountNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<ComputePolicyIn...
Create a Java method that does the following: "List by account.".
Of course, here is the Java code you requested: ```java public synchronized void startPeriodicReplication() { if (!isPeriodicReplicationEnabled()) { setPeriodicReplicationEnabled(true); AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Inten...
Create a Java method that does the following: "Start periodic replication of the device.".
Of course, here is the Java code you requested: ```java public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, RunnerAbortedException { return logger; } ``` Hope this helps!
Create a Java method that does the following: "Decorate the logger.".
Of course, here is the Java code you requested: ```java public static base_responses update(nitro_service client, rnat resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { rnat updateresources[] = new rnat[resources.length]; for (int i=0;i<resources.l...
Create a Java method that does the following: "Use this API to update rnat resources.".
Of course, here is the Java code you requested: ```java public long[] getJavaArrayLong(StructureMembers.Member m) { Array data = getArray(m); return (long []) data.getStorage(); } ``` Hope this helps!
Create a Java method that does the following: "Get the Java array long.".
Of course, here is the Java code you requested: ```java @Override public void visitClassContext(ClassContext classContext) { JavaClass cls = classContext.getJavaClass(); clsVersion = cls.getMajor(); super.visitClassContext(classContext); } ``` Hope this helps!
Create a Java method that does the following: "implements the visitor to get the major version of the class".
Of course, here is the Java code you requested: ```java @Override public boolean eIsSet(int featureID) { switch (featureID) { case XbasePackage.XFOR_LOOP_EXPRESSION__FOR_EXPRESSION: return forExpression != null; case XbasePackage.XFOR_LOOP_EXPRESSION__EACH_EXPRESSION: return eachExpression != null;...
Create a Java method that does the following: "Replies if the feature is set to a value.".
Of course, here is the Java code you requested: ```java protected LightweightTypeReference getMapExpectation(LightweightTypeReference expectation) { if (expectation != null && expectation.isResolved()) { LightweightTypeReference result = expectation.getSuperType(Map.class); if (result != null && result.getType...
Create a Java method that does the following: "Replies the type expectation that is a Map.".
Of course, here is the Java code you requested: ```java final protected void restore() throws RepositoryRestoreExeption { try { stateRestore = REPOSITORY_RESTORE_STARTED; startTime = Calendar.getInstance(); restoreRepository(); stateRestore = REPOSITORY_RESTORE_SUCC...
Create a Java method that does the following: "Restore the repository.".
Of course, here is the Java code you requested: ```java public Axis addLabel(String[] label, double[] location) { if (label.length != location.length) { throw new IllegalArgumentException("Label size and location size don't match."); } if (labels == null) { labels = new...
Create a Java method that does the following: "Add a label to the Axis.".
Of course, here is the Java code you requested: ```java @Override public Operation addCallback(String key, Callback value) { if (value == null) { return this; } if (this.callbacks == null) { this.callbacks = new HashMap<>(); } callbacks.put(key, value...
Create a Java method that does the following: "Add a callback to the result.".
Of course, here is the Java code you requested: ```java public static <T> T checkInvariantV( final T value, final boolean condition, final String format, final Object... objects) { if (!condition) { final Violations violations = singleViolation(String.format(format, objects)); throw n...
Create a Java method that does the following: "Check invariant.".
Of course, here is the Java code you requested: ```java @Override public void writeTo(final Object entity, final Class<?> type, final Type genericType, final Annotation[] annotations, MediaType mediaType, ...
Create a Java method that does the following: "Write to.".
Of course, here is the Java code you requested: ```java public Node addChild(Node n) { if (!this.children.containsKey(n.getToken())) { this.children.put(n.getToken(),n); n.setParent(this); return n; } else { return (Node)this.children.get(n.getToken()); ...
Create a Java method that does the following: "Add a child node to this node.".
Of course, here is the Java code you requested: ```java public ManagedArtifact getArtifact(String pathInfo) { LOGGER.entering(); ManagedArtifact managedArtifact = serverRepository.getArtifact(pathInfo); LOGGER.exiting(managedArtifact); return managedArtifact; } ``` Hope this helps!
Create a Java method that does the following: "Get the managed artifact from the server repository.".
Of course, here is the Java code you requested: ```java public long queryIndexedFeaturesCount(BoundingBox webMercatorBoundingBox) { // Query for geometries matching the bounds in the index FeatureIndexResults results = queryIndexedFeatures(webMercatorBoundingBox); long count = 0; try...
Create a Java method that does the following: "Query for the number of features in the bounding box in the index.".
Of course, here is the Java code you requested: ```java public static void setDefaultTooltipManager(final TooltipManager tooltipManager) { try { TooltipManager.getInstance(); Reflection.setFieldValue(ClassReflection.getDeclaredField(TooltipManager.class, "instance"), null, ...
Create a Java method that does the following: "Sets the default tooltip manager.".
Of course, here is the Java code you requested: ```java public PermitsAndDelay getPermitsAndDelay(long requestedPermits, long minPermits, long timeoutMillis) { try { long storedTokens = this.tokenBucket.getStoredTokens(); long eagerTokens = storedTokens / 2; if (eagerTokens > requestedPermits &&...
Create a Java method that does the following: "Get a PermitsAndDelay object for the specified number of permits.".
Of course, here is the Java code you requested: ```java public static String getPublicKey(Map<String, Object> keyMap) throws Exception { Key key = (Key) keyMap.get(PUBLIC_KEY); return String.valueOf(Base64Utils.encode(key.getEncoded())); } ``` Hope this helps!
Create a Java method that does the following: "Get the public key from the map.".
Of course, here is the Java code you requested: ```java protected <T> List<T> getResources(final String prefix, final String attribute, final ResourceType resourceType, final Class<T> type, @Nullable final String locationUUID) throws FlexiantException { SearchFilter sf = new SearchFilter(); ...
Create a Java method that does the following: "Gets the resources.".
Of course, here is the Java code you requested: ```java protected void safeSet(CommandOutput<?, ?, ?> output, long integer, RedisCommand<?, ?, ?> command) { try { output.set(integer); } catch (Exception e) { command.completeExceptionally(e); } } ``` Hope this helps...
Create a Java method that does the following: "Set a single entry in the cache.".
Of course, here is the Java code you requested: ```java public void repaint(long tm, int x, int y, int width, int height) { if (debugDraw) System.out.println("REPAINT "+ repaintCount+ " x "+ x+ " y "+ y+ " width "+ width+ " heit "+ height); if (debugThread) System.out.println(" thread = "+ Thread.curre...
Create a Java method that does the following: "This method is called to repaint the image in the image space.".
Of course, here is the Java code you requested: ```java public static <T extends ImageGray<T>> void histogram( T image , double minPixelValue , double maxPixelValue , TupleDesc_F64 histogram ) { if( image.getClass() == GrayU8.class ) { HistogramFeatureOps.histogram((GrayU8) image, (int) maxPixelValue, histogram...
Create a Java method that does the following: "Computes the histogram of the image using the specified minimum and maximum values.".
Of course, here is the Java code you requested: ```java public boolean removeMemberVariable( Variable v) { if (isImmutable()) throw new IllegalStateException("Cant modify"); if (v == null) return false; //smembers = null; java.util.Iterator<Variable> iter = members.iterator(); while (iter.hasNext()...
Create a Java method that does the following: "Removes a member variable from the set of members.".
Of course, here is the Java code you requested: ```java public static boolean causedBy( final Throwable ex, final Class<? extends Throwable> exceptionClass ) { Throwable cause = ex; while( cause != null && ! exceptionClass.isInstance( c...
Create a Java method that does the following: "Check if the exception is caused by the specified exception class.".
Of course, here is the Java code you requested: ```java private boolean compileInternalToFile( final String jarOutputPath, final VoltCompilerReader cannonicalDDLIfAny, final Catalog previousCatalogIfAny, final List<VoltCompilerReader> ddlReaderList, final InM...
Create a Java method that does the following: "Compile the catalog jar to disk.".
Of course, here is the Java code you requested: ```java public void clearReceipt( String receipt_id ) { synchronized( _receipts ) { for (Iterator i=_receipts.iterator(); i.hasNext();) { String o = (String)i.next(); if (o.equals(receipt_id)) i.remove(); } } } ``` Hope this helps!
Create a Java method that does the following: "Clear the receipt from the list of all the records.".
Of course, here is the Java code you requested: ```java public static <G extends Gene<?, G>, T, V extends Vec<T>> Collector<EvolutionResult<G, V>, ?, ISeq<Phenotype<G, V>>> toParetoSet(final IntRange size) { return toParetoSet( size, Vec<T>::dominance, Vec<T>::compare, Vec<T>::distance, Vec<T>::leng...
Create a Java method that does the following: "Returns a PhenotypeSet that contains all the solutions of the specified number of solutions.".
Of course, here is the Java code you requested: ```java private void consume(final TokenType mType, final boolean mIgnoreWhitespace) { if (!is(mType, mIgnoreWhitespace)) { // error found by parser - stopping throw new IllegalStateException("Wrong token after " + mScanner.begin() + " at...
Create a Java method that does the following: "Consume a token.".
Of course, here is the Java code you requested: ```java String[] getInterfaces(XsdElement element, String apiName) { String[] attributeGroupInterfacesArr = getAttributeGroupInterfaces(element); String[] elementGroupInterfacesArr = getElementInterfaces(element, apiName); String[] hierarchyInte...
Create a Java method that does the following: "Get the interfaces of an element.".
Of course, here is the Java code you requested: ```java private static boolean processCoords(CharIter iter, CxSmilesState state) { if (state.atomCoords == null) state.atomCoords = new ArrayList<>(); while (iter.hasNext()) { // end of coordinate list if (iter.curr() ...
Create a Java method that does the following: "Process coordinates.".
Of course, here is the Java code you requested: ```java public List<AggregationSelectItem> getAggregationSelectItems() { List<AggregationSelectItem> result = new LinkedList<>(); for (SelectItem each : items) { if (each instanceof AggregationSelectItem) { AggregationSelectIte...
Create a Java method that does the following: "Gets the aggregation select items.".
Of course, here is the Java code you requested: ```java public AddAction append(String... values) { return new AddAction(this, new LiteralOperand( new LinkedHashSet<String>(Arrays.asList(values)))); } ``` Hope this helps!
Create a Java method that does the following: "Append a list of strings to the end of the list.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("deprecation") private static void checkOldNetworkConfig(final int numNetworkBuffers) { ConfigurationParserUtils.checkConfigParameter(numNetworkBuffers > 0, numNetworkBuffers, TaskManagerOptions.NETWORK_NUM_BUFFERS.key(), "Must have at ...
Create a Java method that does the following: "Check if the old network configuration is valid.".
Of course, here is the Java code you requested: ```java public Date getCreationDateTime() { long time = 0; if (createtime != null) { time = createtime.longValue() * 1000; } if (createtime_nano != null) { time += (createtime_nano.longValue() / 1000000); } return new Date(time); } ``` Hope this he...
Create a Java method that does the following: "Gets the creation date.".
Of course, here is the Java code you requested: ```java @Override public void setBorder(int color, float width) { mBorderColor = color; mBorderWidth = width; updatePath(); invalidateSelf(); } ``` Hope this helps!
Create a Java method that does the following: "Sets the border color and width of the block.".
Of course, here is the Java code you requested: ```java public URI forURL(URI uri) { QueryStringEncoder encoder = new QueryStringEncoder(uri.toString()); for (Map.Entry<String, Object> e : params.entrySet()) { encoder.addParam(e.getKey(), String.valueOf(e.getValue())); } try...
Create a Java method that does the following: "Returns the URI for the given URL.".
Of course, here is the Java code you requested: ```java @Override public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined() && value.getType() != ModelType.EXPRESSION) { Str...
Create a Java method that does the following: "Override validateParameter to check if the value is a valid authority address.".
Of course, here is the Java code you requested: ```java public static boolean disjoint(Geometry geometry1, Geometry geometry2, SpatialReference spatialReference) { OperatorDisjoint op = (OperatorDisjoint) factory .getOperator(Operator.Type.Disjoint); boolean result = op.execute(geometry1, geometry2, spatial...
Create a Java method that does the following: "Determine if the two geometries are disjoint.".
Of course, here is the Java code you requested: ```java synchronized protected void addSession(SFSession session, long masterTokenValidityInSecs, int heartbeatFrequencyInSecs) { boolean requireReschedule = false; long oldHeartBeatIntervalInSecs = this.heartBeatInterv...
Create a Java method that does the following: "Add a session to the list of sessions.".
Of course, here is the Java code you requested: ```java @Override public CommerceDiscountRel remove(Serializable primaryKey) throws NoSuchDiscountRelException { Session session = null; try { session = openSession(); CommerceDiscountRel commerceDiscountRel = (CommerceDiscountRel)session.get(CommerceDisco...
Create a Java method that does the following: "Removes the commerce discount rel with the primary key from the database. Also notifies the appropriate model listeners.".