code
stringlengths
146
69.7k
prompt
stringlengths
55
1.5k
Of course, here is the Java code you requested: ```java public static String hashHex(byte[] data, String alg) throws NoSuchAlgorithmException { return toHex(hash(data, alg)); } ``` Hope this helps!
Create a Java method that does the following: "Returns a hex string of the given data.".
Of course, here is the Java code you requested: ```java public final Object start(int priority) { started_date = new Date(); if (parent_process != null || in_process) { return_object = null; doRun(); return return_object; } ...
Create a Java method that does the following: "Starts the thread.".
Of course, here is the Java code you requested: ```java public static void addMapping(GraphRewrite event, String pattern, Class<? extends WindupVertexFrame> type) { getMappings(event, pattern).add(type); } ``` Hope this helps!
Create a Java method that does the following: "Add a mapping between a pattern and a WindupVertexFrame.".
Of course, here is the Java code you requested: ```java public ServiceFuture<List<EventSubscriptionInner>> listRegionalByResourceGroupForTopicTypeAsync(String resourceGroupName, String location, String topicTypeName, final ServiceCallback<List<EventSubscriptionInner>> serviceCallback) { return ServiceFuture.fr...
Create a Java method that does the following: "Gets a list of event subscriptions for a topic type.".
Of course, here is the Java code you requested: ```java public void addPropertyColumn(String propertyName, Class propertyType, TableCellRenderer renderer) { addPropertyColumn(propertyName).withRenderer(renderer); } ``` Hope this helps!
Create a Java method that does the following: "Add a property column to the base class.".
Of course, here is the Java code you requested: ```java public String transform(Map<?, ?> map) { StringBuilder sb = new StringBuilder(); for (Object key : map.keySet()) { sb.append(getSeparatorSequence()); String keyString = key != null ? key.toString() : getNullValue(); sb.append(keyString); sb.append...
Create a Java method that does the following: "Transform a Map into a String.".
Of course, here is the Java code you requested: ```java @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case GeometryPackage.GEOMETRY_INFO: { GeometryInfo geometryInfo = (GeometryInfo) theEObject; T result = caseGeometryInfo(geometryInfo); if (result =...
Create a Java method that does the following: "Override the default doSwitch method for the given classifierID.".
Of course, here is the Java code you requested: ```java public int getComponentEnabledSettingFlags(ComponentName componentName) { ComponentState state = componentList.get(componentName); return state != null ? state.flags : 0; } ``` Hope this helps!
Create a Java method that does the following: "Get the flags of the component enabled setting for the specified component.".
Of course, here is the Java code you requested: ```java private static Key str2Key_impl(String s) { String key = s; byte[] kb = new byte[(key.length() - 1) / 2]; int i = 0, j = 0; if( (key.length() > 2) && (key.charAt(0) == '%') && (key.charAt(1) >= '0') && (key.charAt(1) <= '9') ) { // Dehexalat...
Create a Java method that does the following: "Convert a string to a key.".
Of course, here is the Java code you requested: ```java public void setUpdates(java.util.Collection<ByteMatchSetUpdate> updates) { if (updates == null) { this.updates = null; return; } this.updates = new java.util.ArrayList<ByteMatchSetUpdate>(updates); } ``` Hope ...
Create a Java method that does the following: "Sets the value of the updates property.".
Of course, here is the Java code you requested: ```java public String getPseudoClassName() { String name = getClass().getSimpleName().toLowerCase(); name = name.replace('_', '-'); return name; } ``` Hope this helps!
Create a Java method that does the following: "Get the pseudo class name.".
Of course, here is the Java code you requested: ```java public static <T> IndexChangeAdapter forProperty( ExecutionContext context, NodeTypePredicate matcher, String workspaceName, ...
Create a Java method that does the following: "Create an IndexChangeAdapter for a property.".
Of course, here is the Java code you requested: ```java protected void renderColumnFooterCell(FacesContext facesContext, ResponseWriter writer, UIColumn uiColumn, String footerStyleClass, int colspan) throws IOException { renderColumnFooterCell(facesContext, writer, uiColumn, uiColumn.getFooter(), fo...
Create a Java method that does the following: "Renders the footer cell of the given column.".
Of course, here is the Java code you requested: ```java private static Consumer<ByteBuffer> unmapper() { final Lookup lookup = lookup(); try { // *** sun.misc.Unsafe unmapping (Java 9+) *** final Class<?> unsafeClass = Class.forName("sun.misc.Unsafe"); // first check...
Create a Java method that does the following: "Unmapper method.".
Of course, here is the Java code you requested: ```java public synchronized void message(String tag, Object msg, Frame frame, long time) { if (!_initialized) defaultInit(); ...
Create a Java method that does the following: "Logs a message to all sinks.".
Of course, here is the Java code you requested: ```java @Indexable(type = IndexableType.REINDEX) @Override public CPDefinitionLink addCPDefinitionLink( CPDefinitionLink cpDefinitionLink) { cpDefinitionLink.setNew(true); return cpDefinitionLinkPersistence.update(cpDefinitionLink); } ``` Hope this helps!
Create a Java method that does the following: "Adds the cp definition link to the database. Also notifies the appropriate model listeners.".
Of course, here is the Java code you requested: ```java @Override public Map<String, Type> getSubObjects() { Map<String, Type> result = super.getSubObjects(); result.put("Filters", FilterReports.class); return result; } ``` Hope this helps!
Create a Java method that does the following: "Override this method to return a map of all the objects that are subobjects of this class.".
Of course, here is the Java code you requested: ```java @Override public JSONObject toJsonObject() throws JSONException { JSONObject returnVal = super.toJsonObject(); //Can Create... if(this.isCanCreate() != null) { returnVal.put(JSONMapping.CAN_CREATE, ...
Create a Java method that does the following: "Override toJsonObject to return a JSONObject with the appropriate properties.".
Of course, here is the Java code you requested: ```java public boolean heartbeat(ClusterNodeInfo clusterNodeInfo) throws DisallowedNode { ClusterNode node = nameToNode.get(clusterNodeInfo.name); if (!canAllowNode(clusterNodeInfo.getAddress().getHost())) { if (node != null) { node.heartbeat(cl...
Create a Java method that does the following: "heartbeat the cluster node with the specified information".
Of course, here is the Java code you requested: ```java Optional<ExecutableElement> findAccessibleNoArgumentInstanceMethod(TypeElement classElement, String methodName) { return ElementFilter.methodsIn(elementUtils.getAllMembers(classElement)) .stream().filter(m -> m.getSimpleName().toString().e...
Create a Java method that does the following: "Find accessible no argument instance method.".
Of course, here is the Java code you requested: ```java public static String compactPath(String path) { if (path == null || path.length() == 0) return path; int state = 0; int end = path.length(); int i = 0; loop: while (i < end) { char c = path...
Create a Java method that does the following: "Compact a path.".
Of course, here is the Java code you requested: ```java @Nonnull public SoyValueProvider convert(@Nullable Object obj) { SoyValueProvider convertedPrimitive = convertCheap(obj); if (convertedPrimitive != null) { return convertedPrimitive; } return convertNonPrimitive(obj); } ``` Hope this he...
Create a Java method that does the following: "Converts a non - null object to a Cheap or non - primitive object.".
Of course, here is the Java code you requested: ```java public static Collection<Comparable<?>> getDatabaseShardingValues(final String logicTable) { return null == HINT_MANAGER_HOLDER.get() ? Collections.<Comparable<?>>emptyList() : HINT_MANAGER_HOLDER.get().databaseShardingValues.get(logicTable); } ``` H...
Create a Java method that does the following: "Gets the database sharding values.".
Of course, here is the Java code you requested: ```java public void setDatesWithCheckState(Collection<CmsPair<Date, Boolean>> datesWithCheckInfo) { SortedSet<Date> dates = new TreeSet<>(); m_checkBoxes.clear(); for (CmsPair<Date, Boolean> p : datesWithCheckInfo) { addCheckBox(p.get...
Create a Java method that does the following: "Sets the dates with check state.".
Of course, here is the Java code you requested: ```java @Override public UpdateAliasResult updateAlias(UpdateAliasRequest request) { request = beforeClientExecution(request); return executeUpdateAlias(request); } ``` Hope this helps!
Create a Java method that does the following: "Updates an existing ACS language alias.".
Of course, here is the Java code you requested: ```java @Override public boolean needsTaskCommit(TaskAttemptContext context ) throws IOException { return workPath != null && outputFileSystem.exists(workPath); } ``` Hope this helps!
Create a Java method that does the following: "Checks if the task needs to be committed.".
Of course, here is the Java code you requested: ```java void sortVerticesSimpleByY_(AttributeStreamOfInt32 points, int begin_, int end_) { if (m_bucket_sort == null) m_bucket_sort = new BucketSort(); m_bucket_sort.sort(points, begin_, end_, new EditShapeBucketSortHelper( this)); } ``` Hope this helps!
Create a Java method that does the following: "Sort vertices in a simple by Y.".
Of course, here is the Java code you requested: ```java public void afterStatementCreate(java.sql.Statement stmt) throws PlatformException { super.afterStatementCreate(stmt); // Check for OracleStatement-specific row prefetching support final Method methodSetRowPrefetch; meth...
Create a Java method that does the following: "Override afterStatementCreate to set the row prefetch size in the database.".
Of course, here is the Java code you requested: ```java protected void setValueToField(Field field, Object bean, Object value) { try { field.setAccessible(true); field.set(bean, value); } catch (Exception e) { throw new PropertyLoaderException( St...
Create a Java method that does the following: "Set the value of the field in the given bean to the given value.".
Of course, here is the Java code you requested: ```java public static String timestampToString(Timestamp ts) { return TIMESTAMP_FORMAT.get().format(ts) + String.format(".%09d-00:00", ts.getNanos()); } ``` Hope this helps!
Create a Java method that does the following: "Returns a string representation of the given timestamp.".
Of course, here is the Java code you requested: ```java public SettingsPack inactivityTimeout(int value) { sp.set_int(settings_pack.int_types.inactivity_timeout.swigValue(), value); return this; } ``` Hope this helps!
Create a Java method that does the following: "Set the inactivity timeout value.".
Of course, here is the Java code you requested: ```java static MessageType mergeInto(MessageType toMerge, MessageType mergedSchema) { return mergeInto(toMerge, mergedSchema, true); } ``` Hope this helps!
Create a Java method that does the following: "Merge the given schema into the given schema.".
Of course, here is the Java code you requested: ```java public static Iterable<?> asIterable(final Object o) { if(isArray(o)) { return new Iterable<Object>() { private Object array = o; private int index; @Override public Iterator<Object> iterator() ...
Create a Java method that does the following: "Returns an Iterable of the OWL interface.".
Of course, here is the Java code you requested: ```java public <E extends Edge> Map<Graph<E>,Result> findMotifs(final Graph<E> g, final int motifSize, int numRandomGraphs, MotifFilter filter) { Counter<Graph<E>> inGraph = new IsomorphicGraphCounter<Graph<E>>(); ...
Create a Java method that does the following: "Find the motifs in the given graph.".
Of course, here is the Java code you requested: ```java public void stop() { try { if (CollectionUtils.isEmpty(consumer.subscription())) { consumer.unsubscribe(); } } finally { consumer.close(Duration.ofMillis(10 * 1000L)); } } ``` Hope t...
Create a Java method that does the following: "Stop the application.".
Of course, here is the Java code you requested: ```java private boolean httpMethodSupportsBody(HttpMethod method) { return HttpMethod.POST.equals(method) || HttpMethod.PUT.equals(method) || HttpMethod.DELETE.equals(method) || HttpMethod.PATCH.equals(method); } ``` Hope this helps!
Create a Java method that does the following: "Checks if the given HTTP method supports body.".
Of course, here is the Java code you requested: ```java public void init(App app, Rec record, Map<String,Object> properties) { m_app = app; } ``` Hope this helps!
Create a Java method that does the following: "Initialize this object.".
Of course, here is the Java code you requested: ```java public int[] execute() { /* * Heuristics to improve performance: Reduce rows and columns by their * smallest element, compute an initial non-zero dual feasible solution * and create a greedy matching from workers to jobs of the ...
Create a Java method that does the following: "Execute the test.".
Of course, here is the Java code you requested: ```java protected static AVIMMessage parseTypedMessage(AVIMMessage message) { int messageType = getMessageType(message.getContent()); if (messageType != 0) { Class<? extends AVIMTypedMessage> clazz = messageTypesRepository.get(messageType); if (clazz ...
Create a Java method that does the following: "parse typed message".
Of course, here is the Java code you requested: ```java private NodeUsageReport getReportUnprotected(String trackerName) { NodeUsageReport usageReport = usageReports.get(trackerName); if (usageReport == null) { usageReport = new NodeUsageReport(trackerName, 0, 0, 0, 0, 0, 0, 0); usageReports.put(tr...
Create a Java method that does the following: "Get the NodeUsageReport for the specified tracker name.".
Of course, here is the Java code you requested: ```java public void removeProvider(UserTransactionProvider provider) { UserTransactionProviderImpl impl = providers.get(provider); if (impl != null) { delegator.removeProvider(impl); providers.remove(provider); } } ``` Ho...
Create a Java method that does the following: "Removes a user transaction provider from this user transaction.".
Of course, here is the Java code you requested: ```java public static <T extends ImageBase<T>> BackgroundStationaryBasic<T> stationaryBasic(@Nonnull ConfigBackgroundBasic config , ImageType<T> imageType ) { config.checkValidity(); switch( imageType.getFamily() ) { case GRAY: return new BackgroundStationa...
Create a Java method that does the following: "Creates a BackgroundStationaryBasic background implementation based on the given configuration.".
Of course, here is the Java code you requested: ```java public Stream<List<String>> stream() { return Streams.asStream(new RowIterator()).onClose(Unchecked.runnable(this::close)); } ``` Hope this helps!
Create a Java method that does the following: "Returns a stream of the rows in this table.".
Of course, here is the Java code you requested: ```java private boolean isHandlerRequest(final HttpServletRequest request) { String apiHandlerValue = request.getParameter(PATH_API); return PATH_HANDLER.equals(apiHandlerValue) && retrieveCacheKey(request) != null; } ``` Hope this helps!
Create a Java method that does the following: "Checks if the request is a handler request.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case TypesPackage.JVM_CUSTOM_ANNOTATION_VALUE__VALUES: getValues().clear(); getValues().addAll((Collection<? extends EObject>)newVal...
Create a Java method that does the following: "Override the eSet method for the XalanCustomAnnotationValue interface.".
Of course, here is the Java code you requested: ```java public static void cursorStringToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, c...
Create a Java method that does the following: "Reads a String out of a Cursor and puts it into a ContentValues.".
Of course, here is the Java code you requested: ```java @Override public <X extends Archive<X>> Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter, final ArchiveFormat archiveFormat) { Validate.notNull(type, "Type must be specified"); Validate.notNull(filter, "Filter must be ...
Create a Java method that does the following: "Get the list of archives of the specified type matching the specified filter and archive format.".
Of course, here is the Java code you requested: ```java public T visitTernaryExpression(TernaryExpression elm, C context) { for (Expression element : elm.getOperand()) { visitElement(element, context); } return null; } ``` Hope this helps!
Create a Java method that does the following: "Visit a TernaryExpression. This method will be called for every node in the tree that is a TernaryExpression.".
Of course, here is the Java code you requested: ```java public void marshall(Connector connector, ProtocolMarshaller protocolMarshaller) { if (connector == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.mars...
Create a Java method that does the following: "marshalls the given connector to the JSON object.".
Of course, here is the Java code you requested: ```java @Override public Bulkhead bulkhead(String name, String configName) { return computeIfAbsent(name, () -> Bulkhead.of(name, getConfiguration(configName) .orElseThrow(() -> new ConfigurationNotFoundException(configName)))); } ``` Hope this helps!
Create a Java method that does the following: "Gets bulkhead by name and configuration name.".
Of course, here is the Java code you requested: ```java public GetMetricStatisticsResult withDatapoints(Datapoint... datapoints) { if (this.datapoints == null) { setDatapoints(new com.amazonaws.internal.SdkInternalList<Datapoint>(datapoints.length)); } for (Datapoint ele : datapoint...
Create a Java method that does the following: "Adds the datapoints value to the result.".
Of course, here is the Java code you requested: ```java public AbstractIntList times(int times) { AbstractIntList newList = new IntArrayList(times*size()); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } ``` Hope this helps!
Create a Java method that does the following: "Creates a new list of the specified number of times from this list.".
Of course, here is the Java code you requested: ```java public static int scanUntilAndMatchPrefix(Bytes bytes, BufRange result, byte separator, int fromPos, int toPos, int searchPrefix) { byte b0, b1, b2, b3; int p = fromPos; if (p <= toPos) { b0 = bytes.get(p); ...
Create a Java method that does the following: "Scan until the given prefix is found in the bytes.".
Of course, here is the Java code you requested: ```java public long processedCount() { long size = 0; for (Worker worker : workers) { size += worker.processed.inc(); } return size; } ``` Hope this helps!
Create a Java method that does the following: "Gets the number of processed items in the system.".
Of course, here is the Java code you requested: ```java @Override public void close() { if (this.closed) { return; } this.closed = true; if (this.raf != null) { /* * everything is written already. just update the header for * record count and the END_OF_DATA mark */ try { this.header....
Create a Java method that does the following: "Close the DBF file.".
Of course, here is the Java code you requested: ```java public static void archiveFile(@NotNull final ArchiveOutputStream out, @NotNull final VirtualFileDescriptor source, final long fileSize) throws IOException { if (!source.hasContent()) {...
Create a Java method that does the following: "Archive a file.".
Of course, here is the Java code you requested: ```java public Boolean closeOrder(String outTradeNo){ checkNotNullAndEmpty(outTradeNo, "outTradeNo"); Map<String, String> closeParams = new TreeMap<>(); put(closeParams, WepayField.OUT_TRADE_NO, outTradeNo); buildCloseParams(closeParams); ...
Create a Java method that does the following: "Close an order.".
Of course, here is the Java code you requested: ```java public static <S extends Iterator<? extends T>, T> Iterator<T> iteratorOverIterators(Iterator<S> iteratorsIterator) { Objects.requireNonNull(iteratorsIterator, "The iteratorsIterator is null"); return new CombiningIt...
Create a Java method that does the following: "Returns an iterator over the iterators.".
Of course, here is the Java code you requested: ```java protected void addOptions(final ParserData parserData, final IOptionsNode node, final String[] vars, final int startPos, final String originalInput, int lineNumber) throws ParsingException { // Process each variable in vars starting from the s...
Create a Java method that does the following: "Add options.".
Of course, here is the Java code you requested: ```java public boolean computeNextOctave() { currentOctave += 1; if( currentOctave > lastOctave ) { return false; } if( octaveImages[numScales].width <= 5 || octaveImages[numScales].height <= 5) return false; // the 2nd image from the top of the stack h...
Create a Java method that does the following: "Computes the next octave.".
Of course, here is the Java code you requested: ```java private void digit(StringBuilder rtn) { while (cfml.isValidIndex()) { if (!cfml.isCurrentDigit()) break; rtn.append(cfml.getCurrentLower()); cfml.next(); } } ``` Hope this helps!
Create a Java method that does the following: "This method is called to append a digit to a StringBuilder.".
Of course, here is the Java code you requested: ```java protected static void binarySearch(ModifiableDoubleDBIDList index, DoubleDBIDListIter iter, double val) { // Binary search. TODO: move this into the DoubleDBIDList class. int left = 0, right = index.size(); while(left < right) { final int mid = ...
Create a Java method that does the following: "Binary search for the value in the index.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") private int unsafeCompare(@NullableDecl Object o1, @NullableDecl Object o2) { Comparator<? super E> comparator = comparator(); return (comparator == null) ? ((Comparable<Object>) o1).compareTo(o2) : ((Compa...
Create a Java method that does the following: "Compare two Categorical objects.".
Of course, here is the Java code you requested: ```java public static String[] getMethodParamNames(final Method m) { if (METHOD_NAMES_POOL.containsKey(m)) return METHOD_NAMES_POOL.get(m); final String[] paramNames = new String[m.getParameterTypes().length]; final String n = m.getDec...
Create a Java method that does the following: "Gets the method parameter names.".
Of course, here is the Java code you requested: ```java public Crud<T, K> table(String table) { return new LazyCrud<T, K>(this, table); } ``` Hope this helps!
Create a Java method that does the following: "Create a new instance of the Crud class.".
Of course, here is the Java code you requested: ```java public void addDatabase(Database database) { if (m_databaseCollection == null) m_databaseCollection = new DatabaseCollection(this); m_databaseCollection.addDatabase(database); } ``` Hope this helps!
Create a Java method that does the following: "Add a database to the exception.".
Of course, here is the Java code you requested: ```java protected boolean close() { if (isLoaded()) { for (int i = 0; i < stats.length; i++) { if (stats[i] != null) { if (!stats[i].isLoaded()) { stats[i] = null; } } } retu...
Create a Java method that does the following: "Close the resource.".
Of course, here is the Java code you requested: ```java private ClassNode getGenericsResolvedTypeOfFieldOrProperty(AnnotatedNode an, ClassNode type) { if (!type.isUsingGenerics()) return type; Map<String, GenericsType> connections = new HashMap(); //TODO: inner classes mean a different this-typ...
Create a Java method that does the following: "Get the generics resolved type of a field or property.".
Of course, here is the Java code you requested: ```java private DeleteSecurityGroupResponseType deleteSecurityGroup(final String securityGroupId) { DeleteSecurityGroupResponseType ret = new DeleteSecurityGroupResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockSecurityGroupContr...
Create a Java method that does the following: "Delete SecurityGroup response.".
Of course, here is the Java code you requested: ```java public static Reader reader(Format type, InputStream in) { return reader(type, in, defaultDefaultReadHandler()); } ``` Hope this helps!
Create a Java method that does the following: "Returns a reader for the given input stream.".
Of course, here is the Java code you requested: ```java public void chooseChoiceIndex(int choiceIdx) throws Exception { List<Choice> choices = getCurrentChoices(); Assert(choiceIdx >= 0 && choiceIdx < choices.size(), "choice out of range"); // Replace callstack with the one from the thread at the choosing point...
Create a Java method that does the following: "Choose a choice from the current choices.".
Of course, here is the Java code you requested: ```java public String selectedOption() { if (isNotPresentSelect()) { return null; } WebElement webElement = element.getWebElement(); Select dropdown = new Select(webElement); WebElement option = dropdown.getFirstSelecte...
Create a Java method that does the following: "Gets the text of the first selected option in the element.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("WeakerAccess") @SuppressLint("RtlHardcoded") @VisibleForTesting static int textGravity(@NonNull Table.Alignment alignment, boolean cellTextCenterVertical) { final int gravity; switch (alignment) { case...
Create a Java method that does the following: "Get the text gravity for a single alignment.".
Of course, here is the Java code you requested: ```java public static DiscountCurveInterface createDiscountFactorsFromForwardRates(String name, TimeDiscretization tenor, RandomVariable [] forwardRates) { DiscountCurveInterpolation discountFactors = new DiscountCurveInterpolation(name); RandomVariable df = forwardR...
Create a Java method that does the following: "Creates a discount factors curve from the forward rates.".
Of course, here is the Java code you requested: ```java private static String getRelativePath(File src, File target) { String[] srcComponents = getCanonicalPath(src).replace(File.separatorChar, '/').split("/"); String[] targetComponents = getCanonicalPath(target).replace(File.separatorChar, '/').split(...
Create a Java method that does the following: "Get the relative path of a file to a file.".
Of course, here is the Java code you requested: ```java public NamedMethodType<SessionBeanType<T>> getOrCreateTimeoutMethod() { Node node = childNode.getOrCreate("timeout-method"); NamedMethodType<SessionBeanType<T>> timeoutMethod = new NamedMethodTypeImpl<SessionBeanType<T>>(this, "timeout-method", chi...
Create a Java method that does the following: "Get the named method that is created by the session bean.".
Of course, here is the Java code you requested: ```java public void performCollapse(boolean hasFocus) { internalEditInProgress = true; if (!hasFocus) { // Display +x thingy/ellipse if appropriate final Editable text = getText(); if (text != null && hiddenContent == n...
Create a Java method that does the following: "Collapse the text field.".
Of course, here is the Java code you requested: ```java public static GeoPosition getPosition(Point2D pixelCoordinate, int zoom, TileFactoryInfo info) { // p(" --bitmap to latlon : " + coord + " " + zoom); double wx = pixelCoordinate.getX(); double wy = pixelCoordinate.getY(); // th...
Create a Java method that does the following: "Get the position of a bitmap at a given zoom".
Of course, here is the Java code you requested: ```java public void close() throws IOException { try { file.close(); UnsignedInteger32 requestid; while (outstandingRequests.size() > 0) { requestid = (UnsignedInteger32) outstandingRequests .elementAt(0); outstandingRequests.removeElementAt(0);...
Create a Java method that does the following: "Close the file and close all the outstanding requests.".
Of course, here is the Java code you requested: ```java public void marshall(ApplicationSettings applicationSettings, ProtocolMarshaller protocolMarshaller) { if (applicationSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
Create a Java method that does the following: "marshalls the given applicationSettings to the JSON object.".
Of course, here is the Java code you requested: ```java void onSurfaceChanged(int width, int height) { Log.v(TAG, "onSurfaceChanged"); final VrAppSettings.EyeBufferParams.DepthFormat depthFormat = mApplication.getAppSettings().getEyeBufferParams().getDepthFormat(); mApplication.getConfiguratio...
Create a Java method that does the following: "Called when the surface has changed.".
Of course, here is the Java code you requested: ```java private void findResolvConf(String file) { InputStream in = null; try { in = new FileInputStream(file); } catch (FileNotFoundException e) { return; } InputStreamReader isr = new InputStreamReader(in); BufferedReader br = new BufferedReader(isr); List ...
Create a Java method that does the following: "This method is used to find the resolv configuration file.".
Of course, here is the Java code you requested: ```java void deleteNoRefCheck(Session session, Row row) { Object[] data = row.getData(); fireBeforeTriggers(session, Trigger.DELETE_BEFORE, data, null, null); if (isView) { return; } deleteNoCheck(session, row); ...
Create a Java method that does the following: "Delete the record from the database.".
Of course, here is the Java code you requested: ```java public Texture createTexture (IDimension size, Texture.Config config) { return createTexture(size.width(), size.height(), config); } ``` Hope this helps!
Create a Java method that does the following: "Create a texture with the specified size and configuration.".
Of course, here is the Java code you requested: ```java public synchronized void start() { _buffer=new ByteArrayISO8859Writer(_bufferSize); _reopen=false; if (_started) return; if (_out==null && _filename!=null) { try { ...
Create a Java method that does the following: "Start the sequence of processing.".
Of course, here is the Java code you requested: ```java public static PlainDate of( int year, int month, int dayOfMonth ) { return PlainDate.create(year, month, dayOfMonth, null, true); } ``` Hope this helps!
Create a Java method that does the following: "Gets a PlainDate object from the passed in calendar year month and dayOfMonth.".
Of course, here is the Java code you requested: ```java protected void unlockSingleton(EJSDeployedSupport s) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "unlockSingleton: " + this + ", " + s); if (s != null &&...
Create a Java method that does the following: "Unlock the singleton EJSDeployedSupport object.".
Of course, here is the Java code you requested: ```java protected boolean activityAlreadyContainsJobDeclarationEventType(List<EventSubscriptionJobDeclaration> jobDeclarationsForActivity, EventSubscriptionJobDeclaration jobDeclaration){ for(EventSub...
Create a Java method that does the following: "Checks if the activity already contains the given event type.".
Of course, here is the Java code you requested: ```java @Override public EClass getIfcCostValue() { if (ifcCostValueEClass == null) { ifcCostValueEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(151); } return ifcCostValueEClass; } ``` Hope th...
Create a Java method that does the following: "Get the IfcCostValueEClass attribute of the IfcCostValue class.".
Of course, here is the Java code you requested: ```java public final PersistenceServiceUnit getPersistenceServiceUnit() throws Exception { lock.readLock().lock(); try { if (destroyed) throw new IllegalStateException(); if (persistenceServiceUnit == null) { ...
Create a Java method that does the following: "Gets the persistenceServiceUnit.".
Of course, here is the Java code you requested: ```java long getEntryDataStartOffsetWithinPhysicalZipFile() throws IOException, InterruptedException { if (entryDataStartOffsetWithinPhysicalZipFile == -1L) { // Create zipfile slice reader for zip entry try (RecycleOnClose<ZipFileSliceRea...
Create a Java method that does the following: "Get the entry data start offset within the physical zip file.".
Of course, here is the Java code you requested: ```java public static int getType(Number val) { if (val instanceof Integer) { return INT; } else if (val instanceof Long) { return LONG; } else if (val instanceof Short) { return SHORT; } else if (val ins...
Create a Java method that does the following: "Get the type of the number".
Of course, here is the Java code you requested: ```java public long getNumberOfQueuedMessages() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getNumberOfQueuedMessages"); long depth = itemStream.getTotalMsgCount(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryE...
Create a Java method that does the following: "Returns the number of queued messages in the itemStream.".
Of course, here is the Java code you requested: ```java private void loadConfigurationFiles() { // Parse the first annotation found (manage overriding) final Configuration conf = ClassUtility.getLastClassAnnotation(this.getClass(), Configuration.class); // Conf variable cannot be null because...
Create a Java method that does the following: "Load the configuration files.".
Of course, here is the Java code you requested: ```java public byte[] getBinary(String attrName) { Object val = attributes.get(attrName); return toByteArray(val); } ``` Hope this helps!
Create a Java method that does the following: "Gets a binary attribute.".
Of course, here is the Java code you requested: ```java @Override public void removeInstanceChangeListener(String serviceName, ServiceInstanceChangeListener listener) throws ServiceException { ServiceInstanceUtils.validateManagerIsStarted(isStarted.get()); ServiceInstanceUtils.validateServiceName(s...
Create a Java method that does the following: "Remove a ServiceInstanceChangeListener from the Service.".
Of course, here is the Java code you requested: ```java @Override protected void handleEvents(final String EVENT_TYPE) { super.handleEvents(EVENT_TYPE); if ("VISIBILITY".equals(EVENT_TYPE)) { Helper.enableNode(titleText, !tile.getTitle().isEmpty()); Helper.enableNode(text, tile...
Create a Java method that does the following: "Override handleEvents to set the node properties.".
Of course, here is the Java code you requested: ```java private void transformResource(CmsResource resource, Function<String, String> transformation) throws CmsException, UnsupportedEncodingException { CmsFile file = getCms().readFile(resource); if (CmsResourceTypeXmlContent.isXmlContent(file)) { ...
Create a Java method that does the following: "Transforms a resource into a single hierarchical class.".
Of course, here is the Java code you requested: ```java @Override public void claimWork() throws InterruptedException { synchronized (cluster.allWorkUnits) { for (String workUnit : getUnclaimed()) { if (isPeggedToMe(workUnit)) { claimWorkPeggedToMe(workUn...
Create a Java method that does the following: "Claim a work.".
Of course, here is the Java code you requested: ```java public void init() throws IOException { try { if (zooKeeper.exists(zooKeeperParentPath, false) == null) { zooKeeper.create(zooKeeperParentPath, new byte[] { '0' }, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); LOG.info...
Create a Java method that does the following: "Initialize the object.".