code stringlengths 146 69.7k | prompt stringlengths 55 1.5k |
|---|---|
Of course, here is the Java code you requested:
```java
public static double toNumber(String s) {
final int len = s.length();
// Skip whitespace at the start
int start = 0;
char startChar;
for (;;) {
if (start == len) {
// empty or contains only whit... | Create a Java method that does the following: "Convert a String to a double.". |
Of course, here is the Java code you requested:
```java
public void addMenuItem(CmsAdminMenuItem item, float position) {
m_container.addIdentifiableObject(item.getId(), item, position);
}
```
Hope this helps! | Create a Java method that does the following: "Adds a menu item to the container.". |
Of course, here is the Java code you requested:
```java
public Parsable<RECORD> addDissection(final String base, final String type, final String name, final int value) throws DissectionFailure {
LOG.debug("Got new (int) dissection: base={}; type={}; name=\"{}\"", base, type, name);
return addDissection... | Create a Java method that does the following: "Add a new ( int ) dissection to the record store.". |
Of course, here is the Java code you requested:
```java
private String readDocumentation() {
String result = null;
while (true) {
skipWhitespace(false);
if (pos == data.length || data[pos] != '/') {
return result != null ? result : "";
}
String comment = readComment();
res... | Create a Java method that does the following: "Read the documentation.". |
Of course, here is the Java code you requested:
```java
public void startup() {
if (isRunning) return;
Executors.getInstance().execute(new Runnable() {
@Override
public void run() {
DispatcherHandler handler = new DispatcherHandler(AndServer.getContext());
... | Create a Java method that does the following: "Starts the server.". |
Of course, here is the Java code you requested:
```java
@Override
public synchronized boolean addEntry(Principal caller, Principal principal, String permission)
{
return addEntry(caller, new SecurityAccessControl(principal, permission));
}
```
Hope this helps! | Create a Java method that does the following: "Add a new SecurityAccessControl entry to the list of entries for the specified caller.". |
Of course, here is the Java code you requested:
```java
private UIComponent removeComponentForDeletion(String id)
{
UIComponent removedComponent = _componentsMarkedForDeletion.get(_deletionLevel).remove(id);
if (removedComponent != null && _deletionLevel > 0)
{
_componentsMarke... | Create a Java method that does the following: "Remove a component from the list of components marked for deletion.". |
Of course, here is the Java code you requested:
```java
private static <S extends Sequence<S>> BlastDB build(List<S> sequences, boolean buildIdIndex,
Path path, boolean tmp) {
if (sequences.isEmpty())
throw new IllegalArgumentException("No re... | Create a Java method that does the following: "Build a BlastDB from a list of sequences.". |
Of course, here is the Java code you requested:
```java
public SelectBuilder columns(String... columns) {
for (String column : columns) {
column(column, null);
}
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Add columns to the SELECT statement.". |
Of course, here is the Java code you requested:
```java
@Override
public <T> T searchForObject(LdapQuery query, ContextMapper<T> mapper) {
SearchControls searchControls = searchControlsForQuery(query, DONT_RETURN_OBJ_FLAG);
return searchForObject(query.base(),
query.filter().encode... | Create a Java method that does the following: "Search for an object using the specified ContextMapper.". |
Of course, here is the Java code you requested:
```java
public void get(String vaultName, String resourceGroupName, String jobName, String operationId) {
getWithServiceResponseAsync(vaultName, resourceGroupName, jobName, operationId).toBlocking().single().body();
}
```
Hope this helps! | Create a Java method that does the following: "Gets a CDN image image.". |
Of course, here is the Java code you requested:
```java
ServiceBuilder<?> addInjection(ServiceBuilder<?> sb, Injector<T> injector, String name) {
return addInjection(sb, injector, serviceName(name));
}
```
Hope this helps! | Create a Java method that does the following: "Add an injection to the given ServiceBuilder.". |
Of course, here is the Java code you requested:
```java
public long readVLong() {
/* This is the original code of this method,
* but a Hotspot bug (see LUCENE-2975) corrupts the for-loop if
* readByte() is inlined. So the loop was unwinded!
byte b = readByte();
long i = b & ... | Create a Java method that does the following: "readVLong This is the code in the original version of readVLong.". |
Of course, here is the Java code you requested:
```java
private void cloneNestedFeatures(NestedDef nestedDef, ArrayList newFields, ArrayList newReferences, ArrayList newCollections)
{
ClassDescriptorDef nestedClassDef = nestedDef.getNestedType();
String prefix = nes... | Create a Java method that does the following: "Clones the features of the NestedDef.". |
Of course, here is the Java code you requested:
```java
@Nullable
public static ZonedDateTime getDateTimeFromW3COrRFC822 (@Nullable final String sDate)
{
final OffsetDateTime aDateTime = getDateTimeFromW3C (sDate);
if (aDateTime != null)
return aDateTime.toZonedDateTime ();
return getDateTimeFro... | Create a Java method that does the following: "Get the date time from W3C or RFC 822.". |
Of course, here is the Java code you requested:
```java
@Override
public FileBuilder addFile(Path source, String target) throws IOException
{
checkTarget(target);
FileBuilder fb = new FileBuilder(target, source);
fileBuilders.add(fb);
return fb;
}
```
Hope this helps... | Create a Java method that does the following: "Add a file to the set of FileBuilders.". |
Of course, here is the Java code you requested:
```java
private static Granularity granularityFromPointsLinear(double requestedDuration, int points, long assumedIntervalMillis) {
int closest = Integer.MAX_VALUE;
int diff = 0;
Granularity gran = null;
for (Granularity g : Granularity.gr... | Create a Java method that does the following: "Get the granularity from the points linear.". |
Of course, here is the Java code you requested:
```java
public static short readShort(byte b[], int offset) {
int retValue;
retValue = b[offset++] << 8;
retValue |= b[offset] & 0xff;
return (short)retValue;
}
```
Hope this helps! | Create a Java method that does the following: "Read a short from the byte array at the given offset.". |
Of course, here is the Java code you requested:
```java
public DynamicType.Builder<T> attribute(TypeAttributeAppender typeAttributeAppender) {
return new DecoratingDynamicTypeBuilder<T>(instrumentedType,
new TypeAttributeAppender.Compound(this.typeAttributeAppender, typeAttributeAppender),
... | Create a Java method that does the following: "Create a new instance of a CIDCTYPE.". |
Of course, here is the Java code you requested:
```java
CompletableFuture<Pair<VersionedTransactionData, List<StreamSegmentRecord>>> createTxnBody(final String scope,
final String stream,
... | Create a Java method that does the following: "Create a transaction body.". |
Of course, here is the Java code you requested:
```java
public final void setDefaultContentType(@NotNull final SerializedDataType type,
final EnhancedMimeType contentType) {
Contract.requireArgNotNull("type", type);
Contract.requireArgNotNull("contentType", contentType);
con... | Create a Java method that does the following: "Sets the default content type for the specified data type.". |
Of course, here is the Java code you requested:
```java
public void doFade(ColorDelta target, String groupName)
{
FadeState fadeState = timers.get(groupName);
// Set up the color interpolator.
Iterator<Color> interpolator = new ColorInterpolator(startColor, endColor, 8).iterator();
... | Create a Java method that does the following: "Fade the image of a single group.". |
Of course, here is the Java code you requested:
```java
public static String getLetters(String value) {
StringBuilder letters = new StringBuilder(value.length());
for (char chr : value.toCharArray()) {
if (Character.isLetter(chr)) {
letters.append(chr);
}
}
return letters.toStrin... | Create a Java method that does the following: "Get the letters from a String.". |
Of course, here is the Java code you requested:
```java
private static Throwable toThrowable(ResponseCommand responseCommand) throws CodecException {
RpcResponseCommand resp = (RpcResponseCommand) responseCommand;
resp.deserialize();
Object ex = resp.getResponseObject();
if (ex != null ... | Create a Java method that does the following: "Converts a response command to a Throwable.". |
Of course, here is the Java code you requested:
```java
public static boolean handleIfNoneMatch(final HttpServerExchange exchange, final ETag etag, boolean allowWeak) {
return handleIfNoneMatch(exchange, Collections.singletonList(etag), allowWeak);
}
```
Hope this helps! | Create a Java method that does the following: "Handle ifNoneMatch.". |
Of course, here is the Java code you requested:
```java
public CoreDefinitionVersion withCores(Core... cores) {
if (this.cores == null) {
setCores(new java.util.ArrayList<Core>(cores.length));
}
for (Core ele : cores) {
this.cores.add(ele);
}
return this;... | Create a Java method that does the following: "A list of cores to use.". |
Of course, here is the Java code you requested:
```java
public void marshall(EbsBlockDevice ebsBlockDevice, ProtocolMarshaller protocolMarshaller) {
if (ebsBlockDevice == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocol... | Create a Java method that does the following: "marshalls the given EbsBlockDevice to the JSON object.". |
Of course, here is the Java code you requested:
```java
public static SimpleModule getModule(final ObjectMapper mapper) {
SimpleModule module = new SimpleModule();
module.setDeserializerModifier(new BeanDeserializerModifier() {
@Override
public JsonDeserializer<?> modifyDeserial... | Create a Java method that does the following: "Gets the module.". |
Of course, here is the Java code you requested:
```java
public void setRPUnits(Integer newRPUnits) {
Integer oldRPUnits = rpUnits;
rpUnits = newRPUnits;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.FONT_RESOLUTION__RP_UNITS, oldRPUnits, rpUnits));
}
```
Ho... | Create a Java method that does the following: "Sets the RP units.". |
Of course, here is the Java code you requested:
```java
public static Token newSymbol(String type, int startLine, int startColumn) {
return new Token(Types.lookupSymbol(type), type, startLine, startColumn);
}
```
Hope this helps! | Create a Java method that does the following: "Create a new token from a symbol.". |
Of course, here is the Java code you requested:
```java
public Collection values() {
if (values == null) {
values = new AbstractCollectionView() {
public long size() throws ObjectManagerException {
return AbstractTreeMap.this.size();
}
... | Create a Java method that does the following: "Gets the values of this TreeMap.". |
Of course, here is the Java code you requested:
```java
public CloseableHttpResponse proxy(String relUrl, IncomingRequest incomingRequest, Renderer... renderers)
throws IOException, HttpErrorPage {
DriverRequest driverRequest = new DriverRequest(incomingRequest, this, relUrl);
driverRequest... | Create a Java method that does the following: "Proxy the request to the server.". |
Of course, here is the Java code you requested:
```java
public GL createSurface(SurfaceHolder holder) {
/*
* The window size has changed, so we need to create a new surface.
*/
if (mEglSurface != null && mEglSurface != EGL10.EGL_NO_SURFACE) {
... | Create a Java method that does the following: "Create a new EGL window surface.". |
Of course, here is the Java code you requested:
```java
public static boolean isMethodCall(MethodCallExpression methodCall, String methodObjectPattern, String methodPattern, int numArguments) {
return (isMethodCall(methodCall, methodObjectPattern, methodPattern) && AstUtil.getMethodArguments(methodCall).size(... | Create a Java method that does the following: "Checks if a method call expression is a method call.". |
Of course, here is the Java code you requested:
```java
public Object[] _getAttrValues() {
java.util.Collection<Object> attrValueCollection = attrs.values();
return attrValueCollection.toArray(new Object[attrValueCollection.size()]);
}
```
Hope this helps! | Create a Java method that does the following: "Returns an array of all attribute values.". |
Of course, here is the Java code you requested:
```java
private int scanToken(int startPos) {
int position = startPos;
while (position < maxPosition) {
if (!hasSurrogates) {
char c = str.charAt(position);
if ((c <= maxDelimCodePoint) && (delimiters.indexOf(c)... | Create a Java method that does the following: "ScanToken Method.". |
Of course, here is the Java code you requested:
```java
public static MethodAnnotation fromVisitedMethod(PreorderVisitor visitor) {
String className = visitor.getDottedClassName();
MethodAnnotation result = new MethodAnnotation(className, visitor.getMethodName(), visitor.getMethodSig(), visitor
... | Create a Java method that does the following: "Create a MethodAnnotation from a MethodAnnotation visitor.". |
Of course, here is the Java code you requested:
```java
public static List<Object> getList(String name){
if(getConfiguration().containsKey(name)){
return getConfiguration().getList(name);
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the list.". |
Of course, here is the Java code you requested:
```java
public List<Error> lint(String source, String options) {
if (source == null) {
throw new NullPointerException("Source must not be null.");
}
Context cx = Context.enter();
try {
Scriptable scope = cx... | Create a Java method that does the following: "Lint a source string.". |
Of course, here is the Java code you requested:
```java
@Nonnull
StringBuilder get() {
if( pool.size() == 0 ) {
return new StringBuilder();
} else {
StringBuilder builder = pool.pollLast();
builder.setLength( 0 );
return builder;
}
}
```
... | Create a Java method that does the following: "Gets the last element in the pool.". |
Of course, here is the Java code you requested:
```java
protected void writeEntry(final GZIPArchive.Entry entry) throws IOException {
// ID1 ID2 CM FLG
this.output.write(GZIPArchive.GZIP_START);
// MTIME
writeLEInt(this.output, entry.mtime);
// XFL OS
this.output.write(GZIPArchive.XFL_OS);
/* EXTR... | Create a Java method that does the following: "Write entry to output stream.". |
Of course, here is the Java code you requested:
```java
public static ThreadFactory withName(final String fmt) {
return new ThreadFactory() {
private final AtomicLong count = new AtomicLong(0);
@Override
public Thread newThread(Runnable r) {
final Thread t = BACKING_FACTORY.newThread(r);... | Create a Java method that does the following: "Create a thread factory that creates threads with the specified name.". |
Of course, here is the Java code you requested:
```java
private void setActiveGUI( final boolean isEnabled ) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
toolbar.setEnabled(isEnabled);
for( JComboBox b : algBoxes ) {
b.setEnabled(isEnabled);
}
for( JComponent b : addedCom... | Create a Java method that does the following: "Sets the active GUI.". |
Of course, here is the Java code you requested:
```java
public void clear ()
{
_modCount++;
// abandon all of our hash chains (the joy of garbage collection)
for (int i = 0; i < _buckets.length; i++) {
_buckets[i] = null;
}
// zero out our size
_size = 0... | Create a Java method that does the following: "Clear the cache.". |
Of course, here is the Java code you requested:
```java
public static LocalDateTime firstDay(String localDate) {
LocalDateTime parse = parse(localDate, DEFAULT_PATTERN);
return LocalDateTime.of(parse.getYear(), parse.getMonth(), 1, 0, 0, 0);
}
```
Hope this helps! | Create a Java method that does the following: "Get the first day of the calendar from the given date string.". |
Of course, here is the Java code you requested:
```java
private void initWsClient(BundleContext context) throws Exception {
ServiceReference serviceRef = context.getServiceReference(ConfigurationAdmin.class.getName());
ConfigurationAdmin cfgAdmin = (ConfigurationAdmin)context.getService(serviceRef);
... | Create a Java method that does the following: "Initialize the WsClient". |
Of course, here is the Java code you requested:
```java
public CmsStaticExportData getExportData(HttpServletRequest request, CmsObject cms) {
if (!isStaticExportEnabled()) {
// export is disabled
return null;
}
// build the rfs name for the export "on demand"
S... | Create a Java method that does the following: "Get the static export data for the requested resource.". |
Of course, here is the Java code you requested:
```java
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AfplibPackage.MCA__RG:
getRG().clear();
return;
}
super.eUnset(featureID);
}
```
Hope this helps! | Create a Java method that does the following: "Method called to clear the value of the feature from the object.". |
Of course, here is the Java code you requested:
```java
protected int pickBranchLit() {
int next = -1;
while (next == -1 || this.vars.get(next).assignment() != Tristate.UNDEF || !this.vars.get(next).decision())
if (this.orderHeap.empty())
return -1;
else
next = this.orderHeap.remove... | Create a Java method that does the following: "Pick a branch literal from the branch list.". |
Of course, here is the Java code you requested:
```java
Expression result(CodeChunk.Generator codeGenerator) {
Expression accessChain = buildAccessChain(base, codeGenerator, chain.iterator());
if (unpackFunction == null) {
return accessChain;
} else {
return accessType.unpackResult(accessChain... | Create a Java method that does the following: "Returns the result of the chain of the access". |
Of course, here is the Java code you requested:
```java
public T pollReadyWork() {
write.lock();
try {
return workAvailable() ? waitingWork.poll() : null;
} finally {
write.unlock();
}
}
```
Hope this helps! | Create a Java method that does the following: "Poll for a ready work.". |
Of course, here is the Java code you requested:
```java
public static byte[] get(Object from, Field field)
{
PropertyAccessor<?> accessor = PropertyAccessorFactory.getPropertyAccessor(field);
return accessor.toBytes(getObject(from, field));
}
```
Hope this helps! | Create a Java method that does the following: "Gets the bytes value of a
field.". |
Of course, here is the Java code you requested:
```java
public void start() {
if (scheduler == null) {
if (enabled) {
Scheduler.Options options = new Scheduler.Options()
.withFrequency(Scheduler.Policy.FIXED_DELAY, frequency)
.withInitialDelay(frequency)
.withStopO... | Create a Java method that does the following: "Starts the registry.". |
Of course, here is the Java code you requested:
```java
public static StringBuffer appendClosingTag(StringBuffer buffer, String tag)
{
StringBuffer _buffer = initStringBufferIfNecessary(buffer);
return doAppendClosingTag(_buffer, tag);
}
```
Hope this helps! | Create a Java method that does the following: "Append a closing tag to a StringBuffer.". |
Of course, here is the Java code you requested:
```java
public com.google.api.Logging.LoggingDestination getProducerDestinations(int index) {
return producerDestinations_.get(index);
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the producerDestinations property.". |
Of course, here is the Java code you requested:
```java
@Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
if (expression != null) {
expression.visit(v);
}
if (statements != null) {
for (AstNode s : statements) {
... | Create a Java method that does the following: "Visits this node then the expression and statements.". |
Of course, here is the Java code you requested:
```java
public void marshall(CancelWorkflowExecutionFailedEventAttributes cancelWorkflowExecutionFailedEventAttributes, ProtocolMarshaller protocolMarshaller) {
if (cancelWorkflowExecutionFailedEventAttributes == null) {
throw new SdkClientException(... | Create a Java method that does the following: "marshalls the given CancelWorkflowExecutionFailedEventAttributes to the given protocolMarshaller.". |
Of course, here is the Java code you requested:
```java
public CmsFolder readFolder(String resourcename, CmsResourceFilter filter) throws CmsException {
return m_securityManager.readFolder(m_context, addSiteRoot(resourcename), filter);
}
```
Hope this helps! | Create a Java method that does the following: "Reads a folder from the VFS.". |
Of course, here is the Java code you requested:
```java
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BpsimPackage.PROPERTY_TYPE__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
```
Hope this helps! | Create a Java method that does the following: "Override eGet to return the value of the CID property.". |
Of course, here is the Java code you requested:
```java
@Override
public long getMessageWaitTime()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getMessageWaitTime");
SibTr.exit(this,
tc, "getMessageWai... | Create a Java method that does the following: "Gets the messageWaitTime value.". |
Of course, here is the Java code you requested:
```java
public ResultMatcher isNotEqualTo(final Object expected) {
return new AbstractResultMatcher(path, configuration) {
public void doMatch(Object actual) {
Diff diff = createDiff(expected, actual);
if (diff.similar(... | Create a Java method that does the following: "Returns a ResultMatcher that matches if the JSON is not equal to the given expected object.". |
Of course, here is the Java code you requested:
```java
public static Object sum(Iterable self, Object initialValue) {
return sum(self, initialValue, false);
}
```
Hope this helps! | Create a Java method that does the following: "Sums the elements of an iterable.". |
Of course, here is the Java code you requested:
```java
public ServiceFuture<LogAnalyticsOperationResultInner> beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters, final ServiceCallback<LogAnalyticsOperationResultInner> serviceCallback) {
return ServiceFuture.fromRespon... | Create a Java method that does the following: "Export request rate by interval.". |
Of course, here is the Java code you requested:
```java
public static AuditEventType create(@Nonnull String type) {
if (isNullOrEmpty(type)) {
throw new IllegalArgumentException(ARGUMENT_ERROR + type);
}
final List<String> strings = SPLITTER.splitToList(type);
if (strings.... | Create a Java method that does the following: "Create an audit event type from a string.". |
Of course, here is the Java code you requested:
```java
public String buildSelectPlaces(String htmlAttributes) {
List<String> options = new ArrayList<String>(4);
options.add(OPTION_DECIMALPLACES_1);
options.add(OPTION_DECIMALPLACES_2);
options.add(OPTION_DECIMALPLACES_3);
optio... | Create a Java method that does the following: "Build a select place select.". |
Of course, here is the Java code you requested:
```java
public static Object readObjectFrom(String path)
{
ObjectInputStream ois = null;
try
{
ois = new ObjectInputStream(IOUtil.newInputStream(path));
Object o = ois.readObject();
ois.close();
... | Create a Java method that does the following: "read object from file". |
Of course, here is the Java code you requested:
```java
private <T> ImmutableList<Case<T>> compactCases(ImmutableList<Case<T>> cases, T defaultCaseSpec) {
// Determine the fallback/other case value.
ImmutableList<SoyMsgPart> defaultValue = null;
for (Case<T> caseAndValue : cases) {
if (Objects.equals... | Create a Java method that does the following: "Compacts a list of cases.". |
Of course, here is the Java code you requested:
```java
private void toggle() {
root.classList.toggle("completed", toggle.checked);
repository.complete(item, toggle.checked);
application.update();
}
```
Hope this helps! | Create a Java method that does the following: "Toggle the class list.". |
Of course, here is the Java code you requested:
```java
public void prependParentPath(final Map<Integer, String> parent_path) {
if (parent_path == null) {
throw new IllegalArgumentException("Parent path was null");
}
path = new TreeMap<Integer, String>();
path.putAll(parent_path);
}
```
Hope t... | Create a Java method that does the following: "Prepends the parent path to the path.". |
Of course, here is the Java code you requested:
```java
public String[] query_class() throws DevFailed {
Util.out4.println("In QueryClass command");
final int nb_class = class_list.size();
String[] ret = null;
try {
ret = new String[nb_class];
for (int i = 0; ... | Create a Java method that does the following: "Query class list.". |
Of course, here is the Java code you requested:
```java
private List<FieldSelector> getFieldSelectorsFromRequest(HttpServletRequest request) throws Exception {
String[] fieldSelectorStrings = request.getParameterValues("select");
if( null == fieldSelectorStrings ) {
return null;
}
if( 0 == fieldSelectorS... | Create a Java method that does the following: "Get the field selectors from the request.". |
Of course, here is the Java code you requested:
```java
public Map<String, String> otherElementsToMap() {
Map<String, String> map = new LinkedHashMap<String, String>();
if (otherElements != null) {
for (org.w3c.dom.Element e : otherElements) {
if (e.hasChildNodes()) {
if (e.getChildNodes().getLeng... | Create a Java method that does the following: "Returns a map of the other elements in this element s children as a Map.". |
Of course, here is the Java code you requested:
```java
public String toQueryString(Criteria criteria, CriteriaQueryBuilder queryBuilder) {
// fallback for empty criteria list
if( criterionList.isEmpty() ) {
return "1=1";
}
// build junction
StringBuilder builder = new StringBuilder... | Create a Java method that does the following: "Get the JPQL string for the specified criteria". |
Of course, here is the Java code you requested:
```java
private void setHeaderBackground(int colorResId, int drawableResId) {
if (drawableResId == -1) {
try {
header.setBackgroundColor(getResources().getColor(colorResId));
} catch (Resources.NotFoundException e) {
... | Create a Java method that does the following: "Sets the header background.". |
Of course, here is the Java code you requested:
```java
@NonNull
@Override
public ListenerToken addChangeListener(@NonNull QueryChangeListener listener) {
if (listener == null) { throw new IllegalArgumentException("listener cannot be null."); }
return addChangeListener(null, listener);
}
``... | Create a Java method that does the following: "Add a QueryChangeListener to the sequence of listeners.". |
Of course, here is the Java code you requested:
```java
public String binaryToString(Object objData)
{
initGlobals();
if (objData == null)
return Constants.BLANK;
String string = null;
synchronized (gNumberFormat)
{
if (m_ibScale != 2)
{
... | Create a Java method that does the following: "BinaryToString Method.". |
Of course, here is the Java code you requested:
```java
private void receiveMessage(ClientSocket client, DataInputStream buffer, byte from, StateConnection expected)
throws IOException
{
if (ServerImpl.checkValidity(client, from, expected))
{
final byte dest = buffer.readByt... | Create a Java method that does the following: "Receive a message from a server.". |
Of course, here is the Java code you requested:
```java
public double getVerticalIntensity( double dlat, double dlong, double year, double altitude )
{
calcGeoMag( dlat, dlong, year, altitude );
return bz;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the vertical intensity.". |
Of course, here is the Java code you requested:
```java
public void setComparator(int index, Comparator<T> comparator, boolean ascending) {
this.comparators.set(index, new InvertibleComparator<>(comparator, ascending));
}
```
Hope this helps! | Create a Java method that does the following: "Sets the comparator at the given index.". |
Of course, here is the Java code you requested:
```java
public static <T> PVectorByteBufferedIntegral3s64<T> createWithBase(
final ByteBuffer b,
final MutableLongType base,
final int offset)
{
return new PVectorByteBufferedIntegral3s64<>(b, base, offset);
}
```
Hope this helps! | Create a Java method that does the following: "Creates a new PVectorByteBufferedIntegral3s64 object with the given ByteBuffer and MutableLongType base and offset.". |
Of course, here is the Java code you requested:
```java
public VisDialog text (String text) {
if (skin == null)
throw new IllegalStateException("This method may only be used if the dialog was constructed with a Skin.");
return text(text, skin.get(LabelStyle.class));
}
```
Hope this helps! | Create a Java method that does the following: "Set the text of the dialog.". |
Of course, here is the Java code you requested:
```java
public String getTrendingQuery(String sprintStartDate,
String sprintEndDate, String sprintDeltaDate, String queryName) {
ST st = (new STGroupDir(featureSettings.getQueryFolder(), '$', '$')).getInstanceOf(queryName);
... | Create a Java method that does the following: "Get the trending query for a given query name". |
Of course, here is the Java code you requested:
```java
protected Object parseArrayContent(Class targetType, Class componentType) {
// detect special case
if (targetType == Object.class) {
targetType = List.class;
}
// continue
targetType = replaceWithMappedTypeForPath(targetType);
if (componentType... | Create a Java method that does the following: "Parses the array content.". |
Of course, here is the Java code you requested:
```java
void restoreAllInstances() {
// instancesMngr() instead of this.instancesMngr (for unit tests).
this.logger.fine( "Restoring all the instance states from the current target handlers." );
for( ManagedApplication ma : this.applicationMngr.getManagedApplicati... | Create a Java method that does the following: "Restores all the instance states from the current target handlers.". |
Of course, here is the Java code you requested:
```java
public boolean readRequest(MuxInputStream in, MuxOutputStream out)
throws IOException
{
int channel = isClient ? 3 : 2;
in.init(this, channel);
out.init(this, channel);
if (readChannel(channel) != null) {
... | Create a Java method that does the following: "Read a request from the server.". |
Of course, here is the Java code you requested:
```java
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case XbasePackage.XBLOCK_EXPRESSION__EXPRESSIONS:
return getExpressions();
}
return super.eGet(featureID, resolve, coreType);
}
```
Hope this ... | Create a Java method that does the following: "Override eGet to return the value of the CILTENTIAL_EXPRESSION.". |
Of course, here is the Java code you requested:
```java
private void addCDIFlag(WarMetaData warMetaData, DeploymentUnit deploymentUnit) {
JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData();
if (webMetaData == null) {
webMetaData = new JBossWebMetaData();
warM... | Create a Java method that does the following: "Add the CDI flag to the JBossWebMetaData.". |
Of course, here is the Java code you requested:
```java
public static void setOutlineProvider(View view, final BalloonMarkerDrawable balloonMarkerDrawable) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
UiCompatNotCrash.setOutlineProvider(view, balloonMarkerDrawable);
}
... | Create a Java method that does the following: "Set the outline provider.". |
Of course, here is the Java code you requested:
```java
private void keys(RedBlackTreeNode<Key, Value> x, Queue<Key> queue, Key lo, Key hi) {
if (x == null)
return;
int cmplo = lo.compareTo(x.getKey());
int cmphi = hi.compareTo(x.getKey());
if (cmplo < 0)
keys(x.getLeft(), queue, lo, hi);
if (cmplo <= 0... | Create a Java method that does the following: "Recursively search the subtree of the subtree x.". |
Of course, here is the Java code you requested:
```java
@TargetApi(18)
public Bundler putBinder(String key, IBinder value) {
bundle.putBinder(key, value);
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Inserts a IBinder value into the mapping of this Bundle. If the key does not exist in the bundle it will be created.". |
Of course, here is the Java code you requested:
```java
protected void handleInstallResponse(MemberState member, InstallRequest request, InstallResponse response) {
if (response.status() == Response.Status.OK) {
handleInstallResponseOk(member, request, response);
} else {
handleInstallResponseError... | Create a Java method that does the following: "Handle an install response.". |
Of course, here is the Java code you requested:
```java
@CheckReturnValue
@BackpressureSupport(BackpressureKind.SPECIAL) // take may trigger UNBOUNDED_IN
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> first(T defaultItem) {
return elementAt(0, defaultItem);
}
```
Hope this hel... | Create a Java method that does the following: "Get the first coding coding". |
Of course, here is the Java code you requested:
```java
public void setLog( Log log )
{
this.mavenLogger = log;
//Match the log level of the Java logger with that set in the Maven logger
if ( log.isDebugEnabled() )
{
javaLogger.setLevel( Level.FINE );
... | Create a Java method that does the following: "Sets the log to use.". |
Of course, here is the Java code you requested:
```java
public double[] getZeroRates(double[] maturities)
{
double[] values = new double[maturities.length];
for(int i=0; i<maturities.length; i++) {
values[i] = getZeroRate(maturities[i]);
}
return values;
}
```
Hope this helps! | Create a Java method that does the following: "Get the zero rates of the matrix.". |
Of course, here is the Java code you requested:
```java
public static InputSource getResourceAsSAXInputSource(Class<?> requestingClass, String resource)
throws ResourceMissingException, IOException {
URL url = getResourceAsURL(requestingClass, resource);
InputSource source = new InputSource... | Create a Java method that does the following: "Get a resource as a SAX InputSource". |
Of course, here is the Java code you requested:
```java
void addSubAggs(QueryConverter queryConverter, Aggregation agg, AggregationBuilder builder) {
Map<String, Aggregation> aggs = agg.getAggs();
for (String key : aggs.keySet()) {
Aggregation subAgg = aggs.get(key);
AbstractAgg... | Create a Java method that does the following: "Add sub aggs to builder". |
Of course, here is the Java code you requested:
```java
public static Graph<String, String> loadUndirectedGraphEdgeListFile(String path, int numVertices, String delim,
boolean allowMultipleEdges) throws IOException {
Graph<String, String> graph = new Graph<>(numVertices, allowMultipleEdges,... | Create a Java method that does the following: "Load an unclassified graph edge list file.". |
Of course, here is the Java code you requested:
```java
public long setRecord(final long iPosition, final ORecordId iRid, final byte[] iContent) throws IOException {
acquireExclusiveLock();
try {
long[] pos = getRelativePosition(iPosition);
final OFile file = files[(int) pos[0]];
fin... | Create a Java method that does the following: "Sets the content of a single entry in the file.". |
Of course, here is the Java code you requested:
```java
public String toStringOf(String elementName, Object element) {
try {
StringWriter writer = new StringWriter();
XmlSerializer serializer = Xml.createSerializer();
serializer.setOutput(writer);
serialize(serializer, elementName, element,... | Create a Java method that does the following: "Serialize a single element to a String.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public static <E> PartitionKey partitionKeyForEntity(PartitionStrategy strategy,
E entity, EntityAccessor<E> accessor, @Nullable PartitionKey reuseKey) {
List<FieldPartitioner> fieldPartitioners =
Accessor.getDef... | Create a Java method that does the following: "PartitionKeyForEntity This method is used to create a new instance of the class.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.