code stringlengths 146 69.7k | prompt stringlengths 55 1.5k |
|---|---|
Of course, here is the Java code you requested:
```java
public MessageBean setLocation(final Attributes atts) {
final MessageBean ret = new MessageBean(this);
final URI xtrf = toURI(atts.getValue(ATTRIBUTE_NAME_XTRF));
if (xtrf != null) {
ret.srcFile = xtrf;
}
final ... | Create a Java method that does the following: "Set the location of the message bean.". |
Of course, here is the Java code you requested:
```java
@BetaApi
public final NetworkEndpointGroup getNetworkEndpointGroup(String networkEndpointGroup) {
GetNetworkEndpointGroupHttpRequest request =
GetNetworkEndpointGroupHttpRequest.newBuilder()
.setNetworkEndpointGroup(networkEndpointGroup... | Create a Java method that does the following: "Gets the NetworkEndpointGroup resource that contains the specified network endpoint group.". |
Of course, here is the Java code you requested:
```java
public static Single<Boolean> remove(CacheConfigBean cacheConfigBean, String cacheKey) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheObjectRemove", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", ... | Create a Java method that does the following: "Remove a single cache object from cache.". |
Of course, here is the Java code you requested:
```java
public boolean update(String url, String md5) throws CommandExecutionException {
if (url == null || md5 == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
if (md5.length() != 32) throw new CommandExec... | Create a Java method that does the following: "Update an existing CID language file.". |
Of course, here is the Java code you requested:
```java
protected void maybeLoadConstructors ()
{
if (_ctorList == null) {
_ctorList = new ArrayList<Member>();
Constructor<?>[] ctors = _clazz.getConstructors();
for (int i = 0; i < ctors.length; ++i) {
_ct... | Create a Java method that does the following: "Load the constructors.". |
Of course, here is the Java code you requested:
```java
public static void writeLongBigEndian(ByteBuffer io, long value) {
io.put((byte)((value >> 56) & 0xFF));
io.put((byte)((value >> 48) & 0xFF));
io.put((byte)((value >> 40) & 0xFF));
io.put((byte)((value >> 32) & 0xFF));
io.put((byte)((value >> 24) &... | Create a Java method that does the following: "Write a long in big - endian format to the given ByteBuffer.". |
Of course, here is the Java code you requested:
```java
public JsonResponse getBlast(Integer blastId) throws IOException {
Blast blast = new Blast();
blast.setBlastId(blastId);
return apiGet(blast);
}
```
Hope this helps! | Create a Java method that does the following: "Get a specific blast". |
Of course, here is the Java code you requested:
```java
public String generateMarkov(int length, int context, String seed) {
String str = seed;
while (str.length() < length) {
String prefix = str.substring(Math.max(str.length() - context, 0), str.length());
TrieNode node = inner.matchPredictor(pref... | Create a Java method that does the following: "Generate Markov from a sequence of characters.". |
Of course, here is the Java code you requested:
```java
public void setName(String name)
{
_name = name;
if (_jClass != null)
_jClass.getConstantPool().addUTF8(name);
}
```
Hope this helps! | Create a Java method that does the following: "Sets the name of the segment.". |
Of course, here is the Java code you requested:
```java
public static ClassStub parseClass(URL url) throws IOException {
SoftReference<ClassStub> ref = StubCache.map.get(url);
ClassStub stub = ref == null ? null : ref.get();
if (stub == null) {
DecompilingVisitor visitor = new Decom... | Create a Java method that does the following: "Parse a class from a URL.". |
Of course, here is the Java code you requested:
```java
static String[] listToArray(List<String> elements, String defaultValue){
if (elements == null || elements.isEmpty()) return new String[]{defaultValue};
String[] elementsArr = new String[elements.size()];
elements.toArray(elementsArr);
... | Create a Java method that does the following: "Convert a list of strings to an array of strings.". |
Of course, here is the Java code you requested:
```java
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WStyledText text = (WStyledText) component;
XmlStringBuilder xml = renderContext.getWriter();
String textString = text.getText();
if (textString != nul... | Create a Java method that does the following: "Renders the given WStyledText.". |
Of course, here is the Java code you requested:
```java
public void deleteClassPipeProperties(String className,
String pipeName, List<String> propertyNames) throws DevFailed {
databaseDAO.deleteClassPipeProperties(this, className, pipeName, propertyNames);
}
```
Ho... | Create a Java method that does the following: "Delete a list of properties from a class pipe". |
Of course, here is the Java code you requested:
```java
public YearWeek minusWeeks(long weeksToSubtract) {
if (weeksToSubtract == 0) {
return this;
}
LocalDate mondayOfWeek = atDay(DayOfWeek.MONDAY).minusWeeks(weeksToSubtract);
return YearWeek.from(mondayOfWeek);
}
```
... | Create a Java method that does the following: "Gets a YearWeek representing the specified number of weeks.". |
Of course, here is the Java code you requested:
```java
private void moveRowsBasedOnPriority() {
for (RowNumber myNumber : overs.keySet()) {
Over over = overs.get(myNumber);
int newIndex = rowOrder.indexOf(new RowNumber(over.getOver()));
rowOrder.remove(myNumber);
... | Create a Java method that does the following: "Move rows based on priority.". |
Of course, here is the Java code you requested:
```java
public static String getTitleFromApptentivePush(Intent intent) {
if (!ApptentiveInternal.checkRegistered()) {
return null;
}
if (intent != null) {
return getTitleFromApptentivePush(intent.getExtras());
}
return null;
}
```
Hope this helps! | Create a Java method that does the following: "Get the title from the intent". |
Of course, here is the Java code you requested:
```java
protected void removeSnapshotIdFromSpaceProps(String spaceId) {
log.debug("Removing " + Constants.SNAPSHOT_ID_PROP +
" property from space " + spaceId);
Map<String, String> spaceProps =
snapshotProvider.getSpaceProper... | Create a Java method that does the following: "Remove the snapshot id from the space properties.". |
Of course, here is the Java code you requested:
```java
public EthBlock getFirstBlock(boolean includeTransactions)
{
try
{
return web3j.ethGetBlockByNumber(DefaultBlockParameterName.EARLIEST, includeTransactions).send();
}
catch (IOException ex)
{
LOG... | Create a Java method that does the following: "Gets the first block.". |
Of course, here is the Java code you requested:
```java
public FessMessages addErrorsFailedToUploadStopwordsFile(String property) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_failed_to_upload_stopwords_file));
return this;
}
```
Hope this helps! | Create a Java method that does the following: "Adds the errors failed to upload stopwords file.". |
Of course, here is the Java code you requested:
```java
public CommandLine addSubcommand(String name, Object command) {
return addSubcommand(name, command, new String[0]);
}
```
Hope this helps! | Create a Java method that does the following: "Add a subcommand to the command line.". |
Of course, here is the Java code you requested:
```java
public CreateVolumePermissionModifications withRemove(CreateVolumePermission... remove) {
if (this.remove == null) {
setRemove(new com.amazonaws.internal.SdkInternalList<CreateVolumePermission>(remove.length));
}
for (CreateVol... | Create a Java method that does the following: "Sets the value of the remove parameter.". |
Of course, here is the Java code you requested:
```java
public static SipMessage frame(final Buffer buffer) throws IOException {
if (true)
return frame2(buffer);
if (!couldBeSipMessage(buffer)) {
throw new SipParseException(0, "Cannot be a SIP message because is doesnt start wi... | Create a Java method that does the following: "Create a new SIP message from the given buffer.". |
Of course, here is the Java code you requested:
```java
@Override
public boolean performAccessibilityAction(int action, Bundle arguments) {
if (super.performAccessibilityAction(action, arguments)) {
return true;
}
int changeMultiplier = 0;
int forward;
int backw... | Create a Java method that does the following: "Override this method to perform the accessibility action.". |
Of course, here is the Java code you requested:
```java
private static List<String> convertSpecialStringTags(List<String> extraArgs) {
if (extraArgs == null) {
return null;
}
List<String> args = new ArrayList<String>();
for (String arg : extraArgs) {
args.add(Str... | Create a Java method that does the following: "Convert special string tags to a list of strings.". |
Of course, here is the Java code you requested:
```java
public static void main(String[] args) {
Counter<String> c2 = new ClassicCounter<String>();
c2.incrementCount("p", 13);
c2.setCount("q", 12);
c2.setCount("w", 5);
c2.incrementCount("x", 7.5);
// System.out.println(getDistribution(c2)... | Create a Java method that does the following: "Main method for the
example.". |
Of course, here is the Java code you requested:
```java
public synchronized boolean receive(Tree message) {
// Update timestamp
if (timeoutMillis > 0) {
timeoutAt = System.currentTimeMillis() + timeoutMillis;
}
// Check sequence number
long seq = message.get("seq", -1);
if (seq > -1) {
if... | Create a Java method that does the following: "Handles a message received from the remote node.". |
Of course, here is the Java code you requested:
```java
protected char[][] valuateInvertedNoteChars() {
short noteDuration = note.getStrictDuration();
char[] c1 = null, c2 = null;
if (note.isRest()){
c1 = new char[] { getMusicalFont().getRestChar(noteDuration) };
}
else {
if (noteDuration <= Not... | Create a Java method that does the following: "Returns the char array of characters which are inverted in the note.". |
Of course, here is the Java code you requested:
```java
public static double getAngle(double xDiff, double yDiff) {
double angle = 0;
// logger.debug("getAngle->xDiff: " + xDiff);
// logger.debug("getAngle->yDiff: " + yDiff);
if (xDiff >= 0 && yDiff >= 0) {
angle = Math.at... | Create a Java method that does the following: "Get the angle between two points.". |
Of course, here is the Java code you requested:
```java
public EList<JvmTypeParameter> getTypeParameters()
{
if (typeParameters == null)
{
typeParameters = new EObjectContainmentWithInverseEList<JvmTypeParameter>(JvmTypeParameter.class, this, TypesPackage.JVM_EXECUTABLE__TYPE_PARAMETERS, TypesPackage.JVM_TYPE_... | Create a Java method that does the following: "Replies the type parameters.". |
Of course, here is the Java code you requested:
```java
public void binding(String varName, Object o, boolean dynamic)
{
ctx.set(varName, o, dynamic);
// ctx.globalVar.put(varName, o);
if (dynamic)
{
ctx.objectKeys.add(varName);
}
}
```
Hope this helps! | Create a Java method that does the following: "Binding a variable to an object.". |
Of course, here is the Java code you requested:
```java
public void updateTree(CmsUUID id) {
CmsObject cms = A_CmsUI.getCmsObject();
updateResourceInTree(cms, id);
}
```
Hope this helps! | Create a Java method that does the following: "Updates the resource in the tree.". |
Of course, here is the Java code you requested:
```java
public E set(int index, E element) {
hashCodeUpToDate = false;
E oldValue = elementData(index);
elementData[index] = element;
return oldValue;
}
```
Hope this helps! | Create a Java method that does the following: "Sets the element at the given index.". |
Of course, here is the Java code you requested:
```java
@Override
public ResultTransformer createMapping(final App app, final String sourceType, final String targetType, final Map<String, String> propertyMappings, final Map<String, String> transforms) throws FrameworkException {
try (final Tx tx = app.tx()) {
... | Create a Java method that does the following: "Create a mapping between two virtual types.". |
Of course, here is the Java code you requested:
```java
@Override
public JSONObject toJSON() throws JSONException {
JSONObject json = super.toJSON();
JSONArray features = new JSONArray();
for (Feature feature : this.mFeatures) {
features.put(feature.toJSON());
}
... | Create a Java method that does the following: "Returns a JSONObject representation of the CRAs language.". |
Of course, here is the Java code you requested:
```java
static Plugin getPluginMetadata(final Class<?> cls) throws PluginException {
// try to get plugin provider name
final String pluginname;
if (!cls.isAnnotationPresent(Plugin.class)) {
throw new PluginException("No Plugin annotat... | Create a Java method that does the following: "Get the plugin metadata for the class.". |
Of course, here is the Java code you requested:
```java
@Override
public int[] getIndices() {
if (used == indices.length)
return indices;
int[] tmpIndices = new int[used];
for (int i = 0; i < used; i++) {
tmpIndices[i] = indices[i];
}
return tmpIndices;... | Create a Java method that does the following: "Get the indices of the image.". |
Of course, here is the Java code you requested:
```java
@Override
protected void flushAndSync(boolean durable) throws IOException {
if (outputStream == null) {
throw new IOException("Trying to use aborted output stream!");
}
if (doubleBuf.isFlushed()) {
return;
}
// Under the covers, ... | Create a Java method that does the following: "Flush and sync the output stream.". |
Of course, here is the Java code you requested:
```java
public static String formatHeader(int[] maximums, String[] headers) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < headers.length; i++)
sb = sb.append(formatIn(headers[i], maximums[i], false)).append(GAP);
return... | Create a Java method that does the following: "Format a header string.". |
Of course, here is the Java code you requested:
```java
void setLocale(Locale locale)
{
m_resourceNames = LocaleData.getStringArray(locale, LocaleData.RESOURCE_NAMES);
String name;
m_resourceNumbers.clear();
for (int loop = 0; loop < m_resourceNames.length; loop++)
{
name = ... | Create a Java method that does the following: "Set the locale.". |
Of course, here is the Java code you requested:
```java
public final void save(final String comment, final boolean sortByKey) throws IOException, MergeException, LockingFailedException {
save(new String[] { comment }, sortByKey);
}
```
Hope this helps! | Create a Java method that does the following: "Saves the data of this object to the file.". |
Of course, here is the Java code you requested:
```java
public Timestamp getTimestamp(int columnIndex,
Calendar cal) throws SQLException {
TimestampData t = (TimestampData) getColumnInType(columnIndex,
Type.SQL_TIMESTAMP);
if (t == null) {
ret... | Create a Java method that does the following: "Gets the value of the designated column as a Timestamp object.". |
Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<Page<ActivityInner>>> listByModuleWithServiceResponseAsync(final String resourceGroupName, final String automationAccountName, final String moduleName) {
return listByModuleSinglePageAsync(resourceGroupName, automationAcc... | Create a Java method that does the following: "List all activity activities in a module.". |
Of course, here is the Java code you requested:
```java
public static CorpusFormat forName(@NonNull String name) {
String format = StringUtils.trim(name).toUpperCase();
boolean isOPL = format.endsWith("_OPL");
final String normFormat = format.replaceAll("_OPL$", "").trim();
if (formats.contains... | Create a Java method that does the following: "Get a CorpusFormat object from a name.". |
Of course, here is the Java code you requested:
```java
public ImmutableList<TargetAtom> getCQ(DatabaseRelationDefinition table) {
ImmutableList.Builder<TargetAtom> atoms = ImmutableList.builder();
//Class Atom
ImmutableTerm sub = generateSubject(table, false);
atoms.add(getAtom(getTableIRI(table.getID()), s... | Create a Java method that does the following: "Returns the CQ of the given table.". |
Of course, here is the Java code you requested:
```java
@Override
public void onMouseDown(MouseDownEvent event) {
if (isActive()) {
if (BboxService.contains(object.getUserBounds(), getUserCoordinate(event))) {
dragHandler.onMouseDown(event);
event.stopPropagation();
}
}
}
```
Hope this helps! | Create a Java method that does the following: "Override onMouseDown to handle mouse down events.". |
Of course, here is the Java code you requested:
```java
@Override
public InternalWsResource resolveResource(String resourceURI) {
if (resourceURI == null || resourceURI.length() == 0)
return null;
String normalPath = PathUtils.normalize(resourceURI);
if (PathUtils.containsSymb... | Create a Java method that does the following: "Resolves a resource from the given URI.". |
Of course, here is the Java code you requested:
```java
protected void configureColor(ColorConfigurable configurable, String objectName) {
Assert.notNull(configurable, "configurable");
Assert.notNull(objectName, "objectName");
Color color = loadColor(objectName + ".foreground");
if (color != null)
configur... | Create a Java method that does the following: "Configures the color for the specified object.". |
Of course, here is the Java code you requested:
```java
private ProxyType extendedProxyTypeAsProxyType(ExtendedProxyType pt) {
switch (pt) {
case DRAFT_RFC:
return ProxyType.DRAFT_RFC;
case LEGACY:
return ProxyType.LEGACY;
case RFC3820:
return ProxyType.RFC3820;
default:
... | Create a Java method that does the following: "Convert an extended proxy type to a proxy type.". |
Of course, here is the Java code you requested:
```java
public void resetResult(Object result)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "resetResult");
if (result != null)
((HashSet)result).clear();
if (TraceComponent.isAnyTracingEnabled() && tc.is... | Create a Java method that does the following: "Reset the result of a CRA". |
Of course, here is the Java code you requested:
```java
@Override
public <T> TimerStatus<T> getTimerStatus(long taskId) throws Exception {
TransactionController tranController = new TransactionController();
TaskRecord taskRecord = null;
try {
tranController.preInvoke();
... | Create a Java method that does the following: "Get the TimerStatus object for the given task id.". |
Of course, here is the Java code you requested:
```java
public static String data(byte[] data, int offset, int length) {
InputStream in = null;
try {
in = new ByteArrayInputStream(data, offset, length);
return stream(in, length);
} catch (IOException e) {
e.p... | Create a Java method that does the following: "This method is used to read a byte array of bytes into a String.". |
Of course, here is the Java code you requested:
```java
public Type toPrimitive() {
if (mPrimitive) {
return this;
}
else {
Class<?> primitive = convertToPrimitive(mObjectClass);
if (primitive.isPrimitive()) { return new Type(primitive); }
else { ... | Create a Java method that does the following: "Returns a new type with the primitive type.". |
Of course, here is the Java code you requested:
```java
public int get_timeout_millis(final Connection connection) throws DevFailed {
build_connection(connection);
// Check if TACO device
if (connection.url.protocol == TACO) {
return connection.taco_device.get_rpc_timeout();
} else {
// Else TANG... | Create a Java method that does the following: "Get the timeout in milliseconds for a connection". |
Of course, here is the Java code you requested:
```java
@Override
public GetResourceMetricsResult getResourceMetrics(GetResourceMetricsRequest request) {
request = beforeClientExecution(request);
return executeGetResourceMetrics(request);
}
```
Hope this helps! | Create a Java method that does the following: "Retrieves the metrics for a resource.". |
Of course, here is the Java code you requested:
```java
@Override
public DescribeAlarmHistoryResult describeAlarmHistory(DescribeAlarmHistoryRequest request) {
request = beforeClientExecution(request);
return executeDescribeAlarmHistory(request);
}
```
Hope this helps! | Create a Java method that does the following: "Retrieves the history of an alarm.". |
Of course, here is the Java code you requested:
```java
public ResolvedMultipartLocation resolveMultipartLocation(MultipartLocationName location, boolean fuzzy)
throws ClavinException {
// find all component locations in the gazetteer
QueryBuilder queryBuilder = new QueryBuilder()
... | Create a Java method that does the following: "Resolves aMultipartLocation object to a ResolvedMultipartLocation object.". |
Of course, here is the Java code you requested:
```java
public static Element drawLp(SVGPlot svgp, Projection2D proj, NumberVector mid, double radius, double p) {
final double[] v_mid = mid.toArray();
final long[] dims = proj.getVisibleDimensions2D();
double kappax = p > 1 ? Math.min(1.3, 4. * (2 * FastMa... | Create a Java method that does the following: "Draw a Lp plot.". |
Of course, here is the Java code you requested:
```java
public static PropertyChain loadPropertyChain() {
try {
final Properties traceeDefaultFileProperties = new TraceePropertiesFileLoader().loadTraceeProperties(TraceePropertiesFileLoader.TRACEE_DEFAULT_PROPERTIES_FILE);
final Properties traceeFileProperties ... | Create a Java method that does the following: "Load the property chain from the system properties.". |
Of course, here is the Java code you requested:
```java
@Override
public R visitThrows(ThrowsTree node, P p) {
R r = scan(node.getExceptionName(), p);
r = scanAndReduce(node.getDescription(), p, r);
return r;
}
```
Hope this helps! | Create a Java method that does the following: "Visit a Throws tree.". |
Of course, here is the Java code you requested:
```java
public static Object getInjectValue(String string) {
Matcher m = pattern.matcher(string);
StringBuffer sb = new StringBuffer();
// Parse the content inside pattern "${}" when this pattern is found
while (m.find()) {
// ... | Create a Java method that does the following: "Get the object value from a string.". |
Of course, here is the Java code you requested:
```java
public ServiceFuture<RegistryInner> beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback<RegistryInner> serviceCallback) {
return ServiceFuture.fromResponse(beginUpdateWit... | Create a Java method that does the following: "Updates an existing CIDCTYPE registry.". |
Of course, here is the Java code you requested:
```java
public Observable<ServiceResponse<ListStreamingLocatorsResponseInner>> listStreamingLocatorsWithServiceResponseAsync(String resourceGroupName, String accountName, String assetName) {
if (this.client.subscriptionId() == null) {
throw new Illega... | Create a Java method that does the following: "List Streaming Locators. List Streaming Locators.". |
Of course, here is the Java code you requested:
```java
public static Object instantiate(Class clazz) throws InstantiationException
{
Object result = null;
try
{
result = ClassHelper.newInstance(clazz);
}
catch(IllegalAccessException e)
{
... | Create a Java method that does the following: "Creates an instance of the
class.". |
Of course, here is the Java code you requested:
```java
public static AlluxioStatusException from(Status status) {
Preconditions.checkNotNull(status, "status");
Preconditions.checkArgument(status != Status.OK, "OK is not an error status");
String message = status.getDescription();
Throwable cause = sta... | Create a Java method that does the following: "Converts an Alluxio status to an Alluxio status exception.". |
Of course, here is the Java code you requested:
```java
public List<String> getRemoteRepositoryUrls() {
List<String> urls = new ArrayList<String>();
for( RemoteRepository repo : getRemoteRepositories() ) {
urls.add( repo.getUrl() );
}
return urls;
}
```
Hope th... | Create a Java method that does the following: "Gets the remote repository URLs.". |
Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@Override
public EList<IfcRepresentation> getRepresentationsInContext() {
return (EList<IfcRepresentation>) eGet(
Ifc4Package.Literals.IFC_REPRESENTATION_CONTEXT__REPRESENTATIONS_IN_CONTEXT, true);
}
```
Hope this hel... | Create a Java method that does the following: "Method to allow derived classes to override the methods to provide their own implementation of the
interface.". |
Of course, here is the Java code you requested:
```java
public static MathUtil getInstance() {
if (instance == null) {
synchronized (MathUtilImpl.class) {
if (instance == null) {
MathUtilImpl impl = new MathUtilImpl();
impl.initialize();
instance = impl;
}
... | Create a Java method that does the following: "Get the instance of the MathUtil class.". |
Of course, here is the Java code you requested:
```java
public boolean containsAddedBlocksOnTiers(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
return internalGetAddedBlocksOnTiers().getMap().containsKey(key);
}
```
Hope this helps! | Create a Java method that does the following: "Replies if the entry contains a block on the tier.". |
Of course, here is the Java code you requested:
```java
public static void assertEquals(String message, double expected,
double actual, double delta) {
if (doubleIsDifferent(expected, actual, delta)) {
failNotEquals(message, Double.valueOf(expected), Double.valueOf(actual));
}
... | Create a Java method that does the following: "Asserts that two double values are equal.". |
Of course, here is the Java code you requested:
```java
public final void mT__55() throws RecognitionException {
try {
int _type = T__55;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalPureXbase.g:53:7: ( '::' )
// InternalPureXbase.g:53:9: '::'
{
... | Create a Java method that does the following: "Use this method to perform the T__55 operation on a T__55 input.". |
Of course, here is the Java code you requested:
```java
protected void sortModel()
{
setExecutionStatus(UIStructurBrowser.ExecutionStatus.SORT);
try {
getObject4Event().executeEvents(EventType.UI_TABLE_EVALUATE, ParameterValues.CLASS, this);
if (getSortDirection() == SortDi... | Create a Java method that does the following: "Sort the model.". |
Of course, here is the Java code you requested:
```java
public synchronized int getPredictedTotal(T predicted) {
int total = 0;
for (T actual : classes) {
total += getCount(actual, predicted);
}
return total;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the predicted total count of all classes in the class hierarchy.". |
Of course, here is the Java code you requested:
```java
public List<HealthDependencyPresenter> getDependencies() {
List<HealthDependencyPresenter> dependencies = Lists.newArrayList();
if (dto.getDependencies().isPresent()) {
for (HealthDependencyDto dependencyDto : dto.getDependencies().get()) {
... | Create a Java method that does the following: "Get the dependencies of the health service". |
Of course, here is the Java code you requested:
```java
public static String doGet(String host, String path,
Map<String, String> headers,
Map<String, String> queries) throws Exception {
return EntityUtils.toString(doGetResponse(host, path, headers, ... | Create a Java method that does the following: "Get a single resource from a URL.". |
Of course, here is the Java code you requested:
```java
public void billingAccount_phonebook_bookKey_phonebookContact_id_PUT(String billingAccount, String bookKey, Long id, OvhPhonebookContact body) throws IOException {
String qPath = "/telephony/{billingAccount}/phonebook/{bookKey}/phonebookContact/{id}";
StringB... | Create a Java method that does the following: "Update a phonebook contact". |
Of course, here is the Java code you requested:
```java
public static boolean print(NetcdfFile nc, String command, Writer out, ucar.nc2.util.CancelTask ct)
throws IOException {
WantValues showValues = WantValues.none;
boolean ncml = false;
boolean strict = false;
String varNames = null;
S... | Create a Java method that does the following: "Print a CML file with command". |
Of course, here is the Java code you requested:
```java
public static void addAggregateFunctions(String functions){
if(StringUtil.isNotEmpty(functions)){
String[] funs = functions.split(",");
for (int i = 0; i < funs.length; i++) {
AGGREGATE_FUNCTIONS.add(funs[i].toUpper... | Create a Java method that does the following: "Add aggregate functions to the list of functions to aggregate.". |
Of course, here is the Java code you requested:
```java
private void handleTargetNsDecl()
throws XMLStreamException
{
mAnyDTDppFeatures = true;
char c = skipObligatoryDtdWs();
String name;
// Explicit namespace name?
if (isNameStartChar(c)) {
... | Create a Java method that does the following: "Handle the TARGETNS declaration.". |
Of course, here is the Java code you requested:
```java
public static base_responses add(nitro_service client, lbmonitor resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
lbmonitor addresources[] = new lbmonitor[resources.length];
for (int i=0;i<re... | Create a Java method that does the following: "Use this API to add lbmonitor resources.". |
Of course, here is the Java code you requested:
```java
@Override
public void publish(String channel, Tree message) {
if (writer != null) {
byte[] packet = null;
try {
// Parse channel
int s = channel.indexOf('.');
if (s == -1) {
logger.warn("Invalid channel syntax (" + channel + ")!");
... | Create a Java method that does the following: "Publishes a message to a channel.". |
Of course, here is the Java code you requested:
```java
public void rotate(Quaternion rotation) {
Transform3D tr = new Transform3D();
tr.setRotation(rotation);
transform(tr);
}
```
Hope this helps! | Create a Java method that does the following: "Rotate the matrix by the given quaternion.". |
Of course, here is the Java code you requested:
```java
public Point2 sub(Point2 that) {
return new Point2(x - that.x, y - that.y);
}
```
Hope this helps! | Create a Java method that does the following: "Returns the subtraction of this vector with the given one.". |
Of course, here is the Java code you requested:
```java
public BidiWrappingText spanWrappingText(@Nullable Dir dir, String str, boolean isHtml) {
if (dir == null) {
dir = estimateDirection(str, isHtml);
}
StringBuilder beforeText = new StringBuilder();
StringBuilder afterText = new StringBuilder... | Create a Java method that does the following: "Span wrapping text.". |
Of course, here is the Java code you requested:
```java
public String getFieldName() {
if (!visitingField) {
throw new IllegalStateException("getFieldName called while not visiting field");
}
if (fieldName == null) {
fieldName = getStringFromIndex(field.getNameIndex());
... | Create a Java method that does the following: "Get the name of the field.". |
Of course, here is the Java code you requested:
```java
protected X509CRL downloadCRLFromWeb(String crlURL) throws IOException, CertificateVerificationException {
URL url = new URL(crlURL);
try (InputStream crlStream = url.openStream()) {
CertificateFactory cf = CertificateFactory.getIns... | Create a Java method that does the following: "Download a CRL from the given URL.". |
Of course, here is the Java code you requested:
```java
@Override
protected void doRecv ( Response response ) throws IOException {
CommonServerMessageBlock resp = (CommonServerMessageBlock) response;
this.negotiated.setupResponse(response);
try {
if ( this.smb2 ) {
... | Create a Java method that does the following: "This method is called by the client to handle the response from the server.". |
Of course, here is the Java code you requested:
```java
public static <E> Multiset.Entry<E> immutableEntry(@NullableDecl E e, int n) {
return new ImmutableEntry<E>(e, n);
}
```
Hope this helps! | Create a Java method that does the following: "Returns an immutable entry of the given element.". |
Of course, here is the Java code you requested:
```java
public static CmsRelationType valueOf(String name) throws CmsIllegalArgumentException {
CmsRelationType result = valueOfInternal(name);
if (result == null) {
// no type found
throw new CmsIllegalArgumentException(
... | Create a Java method that does the following: "Returns the relation type with the given name.". |
Of course, here is the Java code you requested:
```java
public static void main(String[] args) throws IOException {
long startTime = System.nanoTime();
Stream<Path> paths = Files.walk(Paths.get(inputpath));
paths.forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".pcm"... | Create a Java method that does the following: "Main method to run the test.". |
Of course, here is the Java code you requested:
```java
public ListConfig getListConfig(String name) {
return ConfigUtils.getConfig(configPatternMatcher, listConfigs, name, ListConfig.class);
}
```
Hope this helps! | Create a Java method that does the following: "Gets a list config by name.". |
Of course, here is the Java code you requested:
```java
private void loadExtensions(Collection<Resource> javaScriptResources,
Collection<Resource> cssResources,
Set<String> toleratedAuthProviders) {
// Retrieve and validate extensions directory
File extensionsDir = new File(env... | Create a Java method that does the following: "Load all extensions from the extensions directory.". |
Of course, here is the Java code you requested:
```java
public void removeAppender(Appender appender) {
boolean wasAttached = aai.isAttached(appender);
if (wasAttached) {
aai.removeAppender(appender);
fireRemoveAppenderEvent(appender);
}
}
```
Hope this helps! | Create a Java method that does the following: "Removes the appender from the log.". |
Of course, here is the Java code you requested:
```java
public DisassociateResourceShareRequest withResourceArns(String... resourceArns) {
if (this.resourceArns == null) {
setResourceArns(new java.util.ArrayList<String>(resourceArns.length));
}
for (String ele : resourceArns) {
... | Create a Java method that does the following: "A list of resource ARNs to disassociate from.". |
Of course, here is the Java code you requested:
```java
public BoxFile.Info uploadFile(FileUploadParams uploadParams) {
URL uploadURL = UPLOAD_FILE_URL.build(this.getAPI().getBaseUploadURL());
BoxMultipartRequest request = new BoxMultipartRequest(getAPI(), uploadURL);
JsonObject fieldJSON = ne... | Create a Java method that does the following: "Uploads a file to the Box Developer s App.". |
Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "maligngroup")
public JAXBElement<MaligngroupType> createMaligngroup(MaligngroupType value) {
return new JAXBElement<MaligngroupType>(_Maligngroup_QNAME, MaligngroupType.class, n... | Create a Java method that does the following: "Create an instance of MaligngroupType". |
Of course, here is the Java code you requested:
```java
public static void sort(int[] data, Comparator<? super DBIDRef> comp) {
sort(data, 0, data.length, comp);
}
```
Hope this helps! | Create a Java method that does the following: "Sort the given array of integers using the specified comparator.". |
Of course, here is the Java code you requested:
```java
public void willEnterPlace (final PlaceObject plobj)
{
// keep a handle on our place object
_plobj = plobj;
if (_view != null) {
// let the UI hierarchy know that we've got our place
PlaceViewUtil.dispatchWillE... | Create a Java method that does the following: "Called by the PlaceController to inform us that a place object has been entered.". |
Of course, here is the Java code you requested:
```java
public java.util.List<Target> getTargets() {
if (targets == null) {
targets = new com.amazonaws.internal.SdkInternalList<Target>();
}
return targets;
}
```
Hope this helps! | Create a Java method that does the following: "Gets the value of the targets property.". |
Of course, here is the Java code you requested:
```java
public void setYCSizeD(Integer newYCSizeD) {
Integer oldYCSizeD = ycSizeD;
ycSizeD = newYCSizeD;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.IID__YC_SIZE_D, oldYCSizeD, ycSizeD));
}
```
Hope this hel... | Create a Java method that does the following: "Sets the YCSizeD value.". |
Of course, here is the Java code you requested:
```java
private void waitGet_(long timeout) throws InterruptedException {
// wait on a member of the lock array
int lockIndex = getQueueIndex(getQueueLocks_, getQueueCounter_, true);
synchronized (getQueueLocks_[lockIndex]) {
try {
... | Create a Java method that does the following: "Wait for a get operation.". |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.