code
stringlengths
160
48.7k
prompt
stringlengths
38
3.13k
Of course, here is the Java code you requested: ```java public Collection<String> getIdentifiers() { List<String> keys = new LinkedList<String>(); keys.addAll(this.stateMap.keySet()); return keys; } ``` Hope this helps!
Create a Java method that does the following: "Returns a collection of all identifiers in this node.".
Of course, here is the Java code you requested: ```java public void configure(Configuration pConfig) throws ConfigurationException { if (pConfig instanceof PBPoolConfiguration) { PBPoolConfiguration conf = (PBPoolConfiguration) pConfig; this.setMaxActive(conf.getMaxActi...
Create a Java method that does the following: "Configures the entity with the specified configuration.".
Of course, here is the Java code you requested: ```java public Tree putMap(String path, boolean putIfAbsent) { return putObjectInternal(path, new LinkedHashMap<String, Object>(), putIfAbsent); } ``` Hope this helps!
Create a Java method that does the following: "Adds a LinkedHashMap to the tree.".
Of course, here is the Java code you requested: ```java public BaseField getField(String strFieldName) // Lookup this field { for (int i = 0; i < this.getRecordlistCount(); i++) { Record record = this.getRecordlistAt(i); BaseField field = record.getField(strFieldName); ...
Create a Java method that does the following: "Get the field in the recordlist.".
Of course, here is the Java code you requested: ```java public void runQueryWithTimestampParameters() throws InterruptedException { // [START bigquery_query_params_timestamps] // BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); ZonedDateTime timestamp = LocalDateTime.of(2016, 12, 7, 8...
Create a Java method that does the following: "Example of running a query with timestamp parameters.".
Of course, here is the Java code you requested: ```java private static List<URL> hackForWeblogic(FilterConfig config) { List<URL> urls = new ArrayList<>(); Set libJars = config.getServletContext().getResourcePaths("/WEB-INF/lib"); for (Object jar : libJars) { try { u...
Create a Java method that does the following: "Hack for weblogic".
Of course, here is the Java code you requested: ```java @CanIgnoreReturnValue @Override public Set<V> removeAll(@NullableDecl Object key) { return (Set<V>) super.removeAll(key); } ``` Hope this helps!
Create a Java method that does the following: "Removes all elements from the set.".
Of course, here is the Java code you requested: ```java public void extendedGet(String remoteFileName, long size, DataSink sink, MarkerListener mListener) throws IOException, ClientException, Serve...
Create a Java method that does the following: "This is a version of the extendedGet method.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") private Set<Class<? extends T>> findScriptClass(Set<Class<?>> clazzs) throws InstantiationException, IllegalAccessException { Set<Class<? extends T>> scriptClazzs = new HashSet<Class<? extends T>>(); for (Class<?> clazz : cl...
Create a Java method that does the following: "Find script class.".
Of course, here is the Java code you requested: ```java private static ApplicationSession openApplication(ApplicationDefinition appDef, RESTClient restClient) { String storageService = appDef.getStorageService(); if (storageService == null || storageService.length() <= "Service".leng...
Create a Java method that does the following: "Open an ApplicationSession using the given RESTClient.".
Of course, here is the Java code you requested: ```java public static String randomString(Long numberOfLetters, String notationMethod, boolean useNumbers, TestContext context) { return new RandomStringFunction().execute(Arrays.asList(String.valueOf(numberOfLetters), notationMethod, String.valueOf(useNumbers)),...
Create a Java method that does the following: "Generate a random string from the given arguments.".
Of course, here is the Java code you requested: ```java public static ModelNode getAttributeValue(ModelNode operation) { return operation.hasDefined(ModelDescriptionConstants.VALUE) ? operation.get(ModelDescriptionConstants.VALUE) : new ModelNode(); } ``` Hope this helps!
Create a Java method that does the following: "Get the attribute value from the given operation.".
Of course, here is the Java code you requested: ```java public ServiceFuture<SyncMemberInner> getAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName, final ServiceCallback<SyncMemberInner> serviceCallback) { return ServiceFuture.fromResponse(getWi...
Create a Java method that does the following: "Gets a single sync class.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public <T> T features(Class<T> interfaceClass) { try { for (Method method : interfaceClass.getDeclaredMethods()) { methods.put(method, findInvocationHandler(method)); } return (T) Proxy.newProxyInstance(interfaceClas...
Create a Java method that does the following: "Creates a proxy for the specified interface class.".
Of course, here is the Java code you requested: ```java public static Scheduler fromExecutor(Executor executor, boolean trampoline) { if(!trampoline && executor instanceof ExecutorService){ return fromExecutorService((ExecutorService) executor); } return new ExecutorScheduler(executor, trampoline); } ``` Ho...
Create a Java method that does the following: "Creates a scheduler from an executor.".
Of course, here is the Java code you requested: ```java public URIBuilder appendFilter(URIBuilder builder, Collection<Filter<?>> filters) { if (filters.size() > 0) { ObjectNode filterNode = new ObjectMapper().createObjectNode(); for (Filter<?> filter : filters) { filterNode.setAll(filter.toJson()); } ...
Create a Java method that does the following: "Appends the given filters to the given builder.".
Of course, here is the Java code you requested: ```java public static File getPropertyFile(String wikiId, String user) { String userPropertiesFileName = System.getProperty("user.home") + "/.mediawiki-japi/" + user + "_" + wikiId + ".ini"; File propFile = new File(userPropertiesFileName); return pro...
Create a Java method that does the following: "Gets the property file.".
Of course, here is the Java code you requested: ```java public Float getValueFloat(String label) { PrimitiveObject o = getPrimitiveObject(VALUE, label, ObjectUtil.FLOAT, "Float"); if (o == null) { return null; } return (Float) o.getObject(); } ``` Hope this helps!
Create a Java method that does the following: "Gets the value float.".
Of course, here is the Java code you requested: ```java protected <C> List<Field> retrieveCachedFields(Class<C> clazz) { return fieldListMemoization.computeIfAbsent(clazz, key -> { Field[] fields = clazz.getDeclaredFields(); List<Field> fieldList = new ArrayList<>(fields.length); ...
Create a Java method that does the following: "Retrieve the cached fields of a class.".
Of course, here is the Java code you requested: ```java final void put( final ByteVector code, final int sourceInsnBytecodeOffset, final boolean wideReference) { if ((flags & FLAG_RESOLVED) == 0) { if (wideReference) { addForwardReference(sourceInsnBytecodeOffset, FORWARD_REFERENCE_TYPE_WIDE, c...
Create a Java method that does the following: "Puts a single entry into the given byte vector.".
Of course, here is the Java code you requested: ```java public static byte[] read(InputStream in, int bufSize) throws IOException { log.debug("开始从流中读取数据,缓冲区大小为{}byte", bufSize); ByteArray array = new ByteArray(); int len; byte[] buffer = new byte[bufSize]; while ((len = in.read(...
Create a Java method that does the following: "read a byte array from an input stream".
Of course, here is the Java code you requested: ```java void and(LongBitSet other) { int pos = Math.min(numWords, other.numWords); while (--pos >= 0) { bits[pos] &= other.bits[pos]; } if (numWords > other.numWords) { Arrays.fill(bits, other.numWords, numWords, 0L); } } ``` Hope this helps!
Create a Java method that does the following: "AND other into this set.".
Of course, here is the Java code you requested: ```java public static Authentication build(String crypt) throws IllegalArgumentException { if(crypt == null) { return new PlainAuth(null); } String[] value = crypt.split(":"); if(value.length == 2 ) { Strin...
Create a Java method that does the following: "Build Authentication object from a string of password.".
Of course, here is the Java code you requested: ```java private RenditionMetadata getExactMatchRendition(final Set<RenditionMetadata> candidates, MediaArgs mediaArgs) { // check for fixed width and/or height request if (mediaArgs.getFixedWidth() > 0 || mediaArgs.getFixedHeight() > 0) { for (RenditionMeta...
Create a Java method that does the following: "Get the exact match rendition.".
Of course, here is the Java code you requested: ```java void getTokensFromTokenEndpoint() throws SocialLoginException { try { tokens = getTokensUsingAuthzCode(); } catch (Exception e) { throw createExceptionAndLogMessage(e, "AUTH_CODE_ERROR_GETTING_TOKENS", new Object[] { social...
Create a Java method that does the following: "Get the tokens from the token endpoint.".
Of course, here is the Java code you requested: ```java public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); for (ResourceRoot resourceRoot : DeploymentUtils.allResourceRoots(deployment...
Create a Java method that does the following: "Index all resources in the deployment.".
Of course, here is the Java code you requested: ```java private void setupOutputStream() { synchronized (failureLogFile) { // Setup is done by some thread if (hasSetupOutputStream) { return; } try { boolean append = false; if (fs.exists(failureLogFile)) { ...
Create a Java method that does the following: "Setup the output stream.".
Of course, here is the Java code you requested: ```java public static List<Bitmap> getCachedBitmapsForImageUri(String imageUri, ImageMemoryCache memoryCache) { List<Bitmap> values = new ArrayList<Bitmap>(); for (String key : memoryCache.getKeySet()) { if (key.startsWith(imageUri)) { values.add((Bitmap) memo...
Create a Java method that does the following: "Get the bitmaps for the given image uri.".
Of course, here is the Java code you requested: ```java public void marshall(GetDiskSnapshotRequest getDiskSnapshotRequest, ProtocolMarshaller protocolMarshaller) { if (getDiskSnapshotRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } tr...
Create a Java method that does the following: "marshalls the given GetDiskSnapshotRequest to the JSON - compatible parameter object.".
Of course, here is the Java code you requested: ```java public static Element getNextSibling(Element element, String name) { return getNextSibling(element, new String[] {name}); } ``` Hope this helps!
Create a Java method that does the following: "Get the next sibling element with the given name.".
Of course, here is the Java code you requested: ```java @Override public File call() throws Exception { try { latch.await(); if (isTimeoutEnabled()) { timedExecutor.schedule(new Runnable() { public void run() { try { ...
Create a Java method that does the following: "Override the call method to perform the actual download.".
Of course, here is the Java code you requested: ```java @Override public void eUnset(int featureID) { switch (featureID) { case TypesPackage.JVM_COMPOUND_TYPE_REFERENCE__TYPE: setType((JvmType)null); return; case TypesPackage.JVM_COMPOUND_TYPE_REFERENCE__REFERENCES: getReferences().clear(); ...
Create a Java method that does the following: "Method overridden to clear the value of the feature.".
Of course, here is the Java code you requested: ```java protected String [] getHeaderRow(String masterlanguage, String[] languages) { List<String> headerRow = new ArrayList<>(); headerRow.add(AbstractFile.KEY_HEADER); headerRow.add(AbstractFile.STATUS_HEADER); if (!ArrayUtils.contains(languages, master...
Create a Java method that does the following: "Get the header row for the file".
Of course, here is the Java code you requested: ```java @Override public void updateAsciiStream(final int columnIndex, final InputStream x, final int length) throws SQLException { wrapped.updateAsciiStream(columnIndex, x, length); } ``` Hope this helps!
Create a Java method that does the following: "Updates the designated column with an InputStream object.".
Of course, here is the Java code you requested: ```java public void createSession(String sessionId) { boolean newSession = sessionId == null; sessionId = newSession ? newSessionId() : sessionId; SessionController controller = sessions.get(sessionId); if (controller == null) { ...
Create a Java method that does the following: "Creates a new session.".
Of course, here is the Java code you requested: ```java @HEAD @Path("/{repoName}/{repoPath:.*}/") public Response head(@PathParam("repoName") String repoName, @PathParam("repoPath") String repoPath, @Context UriInfo uriInfo) { if (log.isDebugEnabled()) { log.debug("HEAD " +...
Create a Java method that does the following: "HEAD method for a single file or directory.".
Of course, here is the Java code you requested: ```java @Override public void removeAdapterItemAt(int index) { if(index == getSelectedItemPosition()) { Calendar time = getSelectedTime(); selectTemporary(new TimeItem(formatTime(time.get(Calendar.HOUR_OF_DAY), time.get(Calendar.MINUTE...
Create a Java method that does the following: "Remove the adapter item at the specified index.".
Of course, here is the Java code you requested: ```java @NonNull public RequestCreator placeholder(@NonNull Drawable placeholderDrawable) { if (!setPlaceholder) { throw new IllegalStateException("Already explicitly declared as no placeholder."); } if (placeholderResId != 0) { throw new Illega...
Create a Java method that does the following: "Sets the placeholder image.".
Of course, here is the Java code you requested: ```java @Nonnull public static File getFile (@Nonnull final IUserDataObject aUDO) { ValueEnforcer.notNull (aUDO, "UDO"); return _getFileIO ().getFile (getUserDataPath () + aUDO.getPath ()); } ``` Hope this helps!
Create a Java method that does the following: "Get the file for the passed user data object.".
Of course, here is the Java code you requested: ```java public void apply() { String in = readLineWithMessage("Delete Product with id:"); int id = Integer.parseInt(in); // We don't have a reference to the selected Product. // So first we have to lookup the object, //...
Create a Java method that does the following: "This is the main entry point for the CTYPE command.".
Of course, here is the Java code you requested: ```java public static final <T extends Comparable<T>> int comparator(T val1, T def1, T val2, T def2) { return comparator(val1 == null? def1 : val1, val2 == null? def2 : val2); // return (val1 == null? def1 : val1).compareTo(val2 == null? def2 : val2); } ``` Hope th...
Create a Java method that does the following: "Returns the comparator of two values.".
Of course, here is the Java code you requested: ```java public EClass getIfcHumidifierType() { if (ifcHumidifierTypeEClass == null) { ifcHumidifierTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(277); } return ifcHumidifierTypeEClass; }...
Create a Java method that does the following: "Get the IfcHumidifierType attribute of the class.".
Of course, here is the Java code you requested: ```java private String parseErrorCodeFromContents(JsonNode jsonContents) { if (jsonContents == null || !jsonContents.has(errorCodeFieldName)) { return null; } String code = jsonContents.findValue(errorCodeFieldName).asText(); i...
Create a Java method that does the following: "Parse the error code from the json node.".
Of course, here is the Java code you requested: ```java public EntryBuffer clear() { for (int i = 0; i < buffer.length; i++) { buffer[i] = null; } return this; } ``` Hope this helps!
Create a Java method that does the following: "Clear the contents of the buffer.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); // Initialize each segment to be minimally sized, and let grow. for (int i = 0; i ...
Create a Java method that does the following: "Read the object from an input stream.".
Of course, here is the Java code you requested: ```java public void apply(HSSFCell cell, HSSFCellStyle cellStyle, Map<String, String> style) { int height = Math.round(CssUtils.getInt(style.get(HEIGHT)) * 255 / 12.75F); HSSFRow row = cell.getRow(); if (height > row.getHeight()) { row.setHeight((sho...
Create a Java method that does the following: "Apply the cell style to the cell.".
Of course, here is the Java code you requested: ```java public Breakpoint clearBreakpoint(int bpno) { Breakpoint old = breakpoints.remove(bpno); if (old != null) { PStm stmt = findStatement(old.location.getFile(), old.location.getStartLine()); if (stmt != null) { BreakpointManager.setBreakpoint(s...
Create a Java method that does the following: "Clear a breakpoint.".
Of course, here is the Java code you requested: ```java public ISynchronizationPoint<IOException> finishAsync() { if (finishing != null) return finishing; finishing = new SynchronizationPoint<>(); Task<Void,NoException> task = new Task.Cpu<Void,NoException>("Finishing zip compression", priority) { @Overri...
Create a Java method that does the following: "Finishes the zip compression asynchronously.".
Of course, here is the Java code you requested: ```java @Override public DeleteSimulationApplicationResult deleteSimulationApplication(DeleteSimulationApplicationRequest request) { request = beforeClientExecution(request); return executeDeleteSimulationApplication(request); } ``` Hope this hel...
Create a Java method that does the following: "Deletes a simulation application.".
Of course, here is the Java code you requested: ```java boolean findSimilarities(MathNode refTree, MathNode comTree, List<Match> similarities, boolean holdRefTree, boolean onlyOperators) { if (isIdenticalTree(refTree, comTree)) { // hit! comTree.setMarked(); similarities.add...
Create a Java method that does the following: "Find similarities.".
Of course, here is the Java code you requested: ```java private static void reportError(List messages, String fileName, int lineNr, String line, String errorMessage) { messages.add(new Date() + " ERROR in \"" + fileName + "\" at line " + lineNr + ':'); messages.add(errorMessage); } ``` Hope this helps!
Create a Java method that does the following: "Report an error in the given file.".
Of course, here is the Java code you requested: ```java protected String getMonitorName(InvocationContext context) { String className = context.getMethod().getDeclaringClass().getSimpleName(); String methodName = context.getMethod().getName(); return prefix + Manager.HIERARCHY_DELIMITER + className + Manager....
Create a Java method that does the following: "Returns the name of the monitor for the given invocation context.".
Of course, here is the Java code you requested: ```java private String waitForPattern(long timeout, TailLogBufferedReader bufferedReader, Pattern pattern, boolean searchWithinLines, long timeoutInSeconds) throws IOException { StringBuilder sb = new StringBuilder(); String result; label: ...
Create a Java method that does the following: "Wait for a pattern to match.".
Of course, here is the Java code you requested: ```java protected void bindJoinedSubClass(HibernatePersistentEntity sub, JoinedSubclass joinedSubclass, InFlightMetadataCollector mappings, Mapping gormMapping, String sessionFactoryBeanName) { bindClass(sub, joinedSubclass, ...
Create a Java method that does the following: "Binds a joined subclass to the table and the properties of the class.".
Of course, here is the Java code you requested: ```java boolean addRelatedClass(final RelType relType, final ClassInfo classInfo) { Set<ClassInfo> classInfoSet = relatedClasses.get(relType); if (classInfoSet == null) { relatedClasses.put(relType, classInfoSet = new LinkedHashSet<>(4)); ...
Create a Java method that does the following: "Add a related class.".
Of course, here is the Java code you requested: ```java public int getPort() { final Connector[] connectors = this.server.getConnectors(); checkState(connectors.length >= 1, "Server must have at least 1 connector"); // The first connector is created upon initializing the server. That's the one that has th...
Create a Java method that does the following: "Gets the port of the server.".
Of course, here is the Java code you requested: ```java @Override protected void doEnqueue(final String queue, final String jobJson) throws Exception { PoolUtils.doWorkInPool(this.jedisPool, new PoolWork<Jedis, Void>() { /** * {@inheritDoc} */ @Override ...
Create a Java method that does the following: "Enqueue a new job in the cluster.".
Of course, here is the Java code you requested: ```java private void parseAccessLog(Map<String, Object> config) { String filename = (String) config.get("access.filePath"); if (null == filename || 0 == filename.trim().length()) { return; } try { this.ncsaLog = new...
Create a Java method that does the following: "Parse the access log configuration.".
Of course, here is the Java code you requested: ```java public void sendRequest(String username, String servicename, String methodname, byte[] requestdata) throws SshException { ByteArrayWriter msg = new ByteArrayWriter(); try { msg.write(SSH_MSG_USERAUTH_REQUEST); msg.writeString(username); msg.writ...
Create a Java method that does the following: "Sends an SSH_MSG_USERAUTH_REQUEST message to the server.".
Of course, here is the Java code you requested: ```java public static boolean checkBasicAuth(HttpServletRequest servletRequest, String username, String password) { String basicAuth = servletRequest.getHeader("Authorization"); if (StringUtils.isNullOrEmptyTrimmed(basicAuth) || !basicAuth.startsWith("Basic ")) { ...
Create a Java method that does the following: "Checks if the request contains a Basic Authentication header.".
Of course, here is the Java code you requested: ```java @Pure public static File getSystemConfigurationDirectoryFor(String software) { if (software == null || "".equals(software)) { //$NON-NLS-1$ throw new IllegalArgumentException(); } final OperatingSystem os = OperatingSystem.getCurrentOS(); if (os == Op...
Create a Java method that does the following: "Replies the directory containing the configuration files for the given software.".
Of course, here is the Java code you requested: ```java protected Locale getLocaleToUse(CmsObject cms, CmsXmlContent xmlContent) { Locale contextLocale = cms.getRequestContext().getLocale(); if (xmlContent.hasLocale(contextLocale)) { return contextLocale; } Locale def...
Create a Java method that does the following: "Returns the locale used for the application.".
Of course, here is the Java code you requested: ```java public <T> T toObject(Class<T> toClass, NumConverter numConverter) { return (T) toObject(toClass, numConverter, null); } ``` Hope this helps!
Create a Java method that does the following: "Converts the object to a class with a NumConverter.".
Of course, here is the Java code you requested: ```java public Fingerprint callback(FingerprintSecureCallback fingerprintSecureCallback, String KEY_NAME){ this.fingerprintSecureCallback = fingerprintSecureCallback; this.cipherHelper = new CipherHelper(KEY_NAME); return this; } ``` Hope thi...
Create a Java method that does the following: "Set the fingerprint secure callback.".
Of course, here is the Java code you requested: ```java void removeComponent(int index) { Component component = components.get(index); components.remove(index); updateComponentOffsets(index); position.getAndUpdate((offset) -> offset - component.length); } ``` Hope this helps!
Create a Java method that does the following: "Removes a component from the set of components.".
Of course, here is the Java code you requested: ```java private boolean extendedIdentifierEquals(String eid1, String eid2) { try { return DomHelpers.compare(DomHelpers.toDocument(eid1, null), DomHelpers.toDocument(eid2, null)); } catch (MarshalException e) { return false; } } ``` Hope this helps!
Create a Java method that does the following: "Compares two extended identifiers.".
Of course, here is the Java code you requested: ```java public synchronized void mark(int limit) throws IllegalArgumentException { if (limit>_buf.length) { byte[] new_buf=new byte[limit]; System.arraycopy(_buf,_pos,new_buf,_pos,_avail-_pos); _buf=new_buf;...
Create a Java method that does the following: "Mark the buffer to be used for a new record.".
Of course, here is the Java code you requested: ```java @Override public void removeByGroupId(long groupId) { for (CommerceUserSegmentEntry commerceUserSegmentEntry : findByGroupId( groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceUserSegmentEntry); } } ``` Hope this helps!
Create a Java method that does the following: "Removes all commerce user segment entries of the requested groupId from the database. Also notifies the appropriate model listeners.".
Of course, here is the Java code you requested: ```java public <T> T getInterface(ScriptWrapper script, Class<T> class1) throws ScriptException, IOException { ClassLoader previousContextClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(ExtensionFactory....
Create a Java method that does the following: "Returns the first implementation of the specified interface.".
Of course, here is the Java code you requested: ```java public void deleteRebalancingState(RebalanceTaskInfo stealInfo) { // acquire write lock writeLock.lock(); try { RebalancerState rebalancerState = getRebalancerState(); if(!rebalancerState.remove(stealInfo)) ...
Create a Java method that does the following: "Delete a steal from the rebalancer state.".
Of course, here is the Java code you requested: ```java public static List toList(Object array) { List<Object> myList = new ArrayList<>(); Collections.addAll(myList, toObjectArray(array)); return myList; } ``` Hope this helps!
Create a Java method that does the following: "Convert an array to a list of objects.".
Of course, here is the Java code you requested: ```java public void setAuthorizationScopes(java.util.Collection<String> authorizationScopes) { if (authorizationScopes == null) { this.authorizationScopes = null; return; } this.authorizationScopes = new java.util.ArrayLis...
Create a Java method that does the following: "Sets the value of the authorizationScopes property.".
Of course, here is the Java code you requested: ```java public boolean shouldCompress(String requestUri) { String uri = requestUri.toLowerCase(); return checkSuffixes(uri, zipSuffixes); } ``` Hope this helps!
Create a Java method that does the following: "Check if the request URI should be compressed.".
Of course, here is the Java code you requested: ```java String getKeyPrefix(StatementPartitioning partitioning, DeterminismMode detMode, String joinOrder) { // no caching for inferred yet if (partitioning.isInferred()) { return null; } String joinOrderPrefix = "#"; ...
Create a Java method that does the following: "Get the key prefix for a single - column key.".
Of course, here is the Java code you requested: ```java public static String printToStr(Object o) { StringWriter sw=new StringWriter(); try { print(o,sw,false); } catch (IOException e) { sw.write("<<error>>"); } return sw.toString().trim(); } ``` Hope this helps!
Create a Java method that does the following: "Print to str.".
Of course, here is the Java code you requested: ```java private void saveElementList(CmsObject cms, List<CmsContainerElementBean> elementList, String listKey) throws CmsException { // limit the favorite list size to avoid the additional info size limit if (elementList.size() > DEFAULT_ELEMENT_LIST...
Create a Java method that does the following: "Saves the element list to the XML file.".
Of course, here is the Java code you requested: ```java @Override public byte[] rowKey(Tuple tuple) { Object objVal = tuple.getValueByField(this.rowKeyField); return toBytes(objVal); } ``` Hope this helps!
Create a Java method that does the following: "Get the row key from the tuple.".
Of course, here is the Java code you requested: ```java @Override public final double[] score0(double[] row, double offset, double[] preds) { super.scoreAllTrees(row, preds); return unifyPreds(row, offset, preds); } ``` Hope this helps!
Create a Java method that does the following: "Score all trees in the source tree.".
Of course, here is the Java code you requested: ```java Level getLevelProperty(String name, Level defaultValue) { LogManager manager = LogManager.getLogManager(); String val = manager.getProperty(name); if (val == null) { return defaultValue; } Level l = Level.parse(...
Create a Java method that does the following: "Gets the value of a class property.".
Of course, here is the Java code you requested: ```java public static QueryAtomContainer create(IAtomContainer mol, Expr.Type... opts) { Set<Expr.Type> optset = EnumSet.noneOf(Expr.Type.class); optset.addAll(Arrays.asList(opts)); QueryAtomContainer query = new QueryAtomContaine...
Create a Java method that does the following: "Create a new QueryAtomContainer from a molecule.".
Of course, here is the Java code you requested: ```java public void evaluate(DoubleSolution solution){ double aux, xi, xj; double[] fx = new double[getNumberOfObjectives()]; double[] x = new double[getNumberOfVariables()]; for (int i = 0; i < solution.getNumberOfVariables(); i++) { x[i] = so...
Create a Java method that does the following: "Evaluates the Cosine Hessian on the specified double solution.".
Of course, here is the Java code you requested: ```java public AdminInitiateAuthResult withChallengeParameters(java.util.Map<String, String> challengeParameters) { setChallengeParameters(challengeParameters); return this; } ``` Hope this helps!
Create a Java method that does the following: "Sets the challenge parameters for the authentication.".
Of course, here is the Java code you requested: ```java protected int decodeMandatoryParameters(ISUPParameterFactory parameterFactory, byte[] b, int index) throws ParameterException { int localIndex = index; index += super.decodeMandatoryParameters(parameterFactory, b, index); if (b...
Create a Java method that does the following: "This method is used to decode the mandatory parameters of a class.".
Of course, here is the Java code you requested: ```java public static Problem readProblem(File file, double bias) throws IOException, InvalidInputDataException { BufferedReader fp = new BufferedReader(new FileReader(file)); List<Double> vy = new ArrayList<Double>(); List<Feature[]> vx = new Arr...
Create a Java method that does the following: "Read a problem from a file.".
Of course, here is the Java code you requested: ```java public ProgressBar maxHint(long n) { if (n < 0) progress.setAsIndefinite(); else { progress.setAsDefinite(); progress.maxHint(n); } return this; } ``` Hope this helps!
Create a Java method that does the following: "Method maxHint.".
Of course, here is the Java code you requested: ```java public static Resource child(@NotNull Resource parentResource, @NotNull String name, @NotNull String resourceType) { return child(parentResource, name, resourceType, ValueMap.EMPTY); } ``` Hope this helps!
Create a Java method that does the following: "Create a child resource.".
Of course, here is the Java code you requested: ```java @Override public HMAC createHMACSHA1(byte[] hmacKey) throws CryptoException { try { return new BCHmacAdapter(hmacKey, "SHA1"); } catch (Exception e) { AndroidPlatform.getInstance().getLogger().logException(e.getMessage()); return null; } ...
Create a Java method that does the following: "Creates a HMAC from the given key.".
Of course, here is the Java code you requested: ```java public int length(){ if(root.child==null){ return 0; } if(length>-1){ return length; } length=root.getChildCount(); return length; } ``` Hope this helps!
Create a Java method that does the following: "Returns the number of elements in this node.".
Of course, here is the Java code you requested: ```java @Override public void removeByCommerceDiscountId(long commerceDiscountId) { for (CommerceDiscountRel commerceDiscountRel : findByCommerceDiscountId( commerceDiscountId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceDiscountRel); } } `...
Create a Java method that does the following: "Removes all commerce discount rels with the primary key from the database. Also notifies the appropriate model listeners.".
Of course, here is the Java code you requested: ```java public CmsXmlContentProperty copy() { return new CmsXmlContentProperty( m_name, m_type, m_visibility, m_widget, m_widgetConfiguration, m_ruleRegex, m_ruleType, ...
Create a Java method that does the following: "Create a deep copy of this CmsXmlContentProperty.".
Of course, here is the Java code you requested: ```java @Nullable public static VATINStructure getFromValidVATIN (@Nullable final String sVATIN) { if (StringHelper.getLength (sVATIN) > 2) for (final VATINStructure aStructure : s_aList) if (aStructure.isValid (sVATIN)) return aStructure;...
Create a Java method that does the following: "Get the structure from a valid VAT IN string.".
Of course, here is the Java code you requested: ```java public void marshall(DisassociateRoleFromGroupRequest disassociateRoleFromGroupRequest, ProtocolMarshaller protocolMarshaller) { if (disassociateRoleFromGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall...
Create a Java method that does the following: "marshalls the given parameter object.".
Of course, here is the Java code you requested: ```java private HostInfo getHostInfo() { Response response = executeMessage(ScopeMessage.HOST_INFO, null); try { return HostInfo.parseFrom(response.getPayload()); } catch (InvalidProtocolBufferException e) { throw new CommunicationException("Erro...
Create a Java method that does the following: "Get the host info from the server".
Of course, here is the Java code you requested: ```java public final void removeElementsWithTag(@Nonnull String tag) { getElements().stream() .map(ElementView::getElement) .filter(e -> e.hasTag(tag)) .forEach(this::removeElement); } ``` Hope this helps!
Create a Java method that does the following: "Removes all elements with a given tag.".
Of course, here is the Java code you requested: ```java public ServletMappingType<WebAppDescriptor> getOrCreateServletMapping() { List<Node> nodeList = model.get("servlet-mapping"); if (nodeList != null && nodeList.size() > 0) { return new ServletMappingTypeImpl<WebAppDescriptor>(this, "...
Create a Java method that does the following: "Gets the servlet mapping.".
Of course, here is the Java code you requested: ```java public boolean replace(final TransportRequest request, boolean retainMode, String... replacements) { return getOrReplaceAllIndices(request, new IndicesProvider() { @Override public String[] provide(String[] original, Object reques...
Create a Java method that does the following: "Replace all indices in the request with the given replacements.".
Of course, here is the Java code you requested: ```java public CommandAuthorization createOrUpdate(String chargingStationId, String userIdentity, Class commandClass) { EntityManager em = getEntityManager(); EntityTransaction tx = null; try { tx = em.getTransaction(); tx...
Create a Java method that does the following: "Create or update a CommandAuthorization entity.".
Of course, here is the Java code you requested: ```java public void setSize (int width, int height) { rootElement.getStyle().setWidth(width, Unit.PX); rootElement.getStyle().setHeight(height, Unit.PX); // the frame buffer may be larger (or smaller) than the logical size, depending on whether // we're o...
Create a Java method that does the following: "Sets the size of the image.".
Of course, here is the Java code you requested: ```java public void setSection (Section section) { _sections.put(key(section.x, section.y), section); } ``` Hope this helps!
Create a Java method that does the following: "Sets the section.".
Of course, here is the Java code you requested: ```java public void set(long index) throws IOException { long pos = index >> 3; try { lock().acquireUpgradableLock(); int value = mFile.read(pos); int newValue; if (value <= 0) { newValue = (...
Create a Java method that does the following: "Sets the value of a single octet in the file.".