code
stringlengths
146
48.7k
prompt
stringlengths
55
1.51k
Of course, here is the Java code you requested: ```java public Coordinate transform(Coordinate coordinate, RenderSpace from, RenderSpace to) { switch (from) { case SCREEN: switch (to) { case SCREEN: return new Coordinate(coordinate); case WORLD: return screenToWorld(coordinate); } ...
Create a Java method that does the following: "Transform a coordinate from one RenderSpace to another.".
Of course, here is the Java code you requested: ```java public static void skip(DataInputStream in) throws IOException { byte[] preamble = new byte[PREAMBLE.length]; in.readFully(preamble); if (!Arrays.equals(preamble,PREAMBLE)) return; // not a valid preamble DataInputS...
Create a Java method that does the following: "Skips the entire image.".
Of course, here is the Java code you requested: ```java public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMetricDefintionsNextWithServiceResponseAsync(final String nextPageLink) { return listMetricDefintionsNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResp...
Create a Java method that does the following: "List metric definition intions.".
Of course, here is the Java code you requested: ```java public static String getAbsoluteParent(String path, int level) { int idx = 0; int len = path.length(); while (level >= 0 && idx < len) { idx = path.indexOf('/', idx + 1); if (idx < 0) { idx = len; ...
Create a Java method that does the following: "Get the absolute parent of a path.".
Of course, here is the Java code you requested: ```java public void seqEmpty() { Data.Seq s = (Data.Seq)data; s.idx = 0; s.capa = YAML.ALLOC_CT; s.items = new Object[s.capa]; } ``` Hope this helps!
Create a Java method that does the following: "This method is called to ensure that the sequence is empty.".
Of course, here is the Java code you requested: ```java public static void pressText(Image srcImage, OutputStream to, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException { pressText(srcImage, getImageOutputStream(to), pressText, color, font, x, y, alpha); } ``` Hope thi...
Create a Java method that does the following: "Press text from Image to OutputStream.".
Of course, here is the Java code you requested: ```java Buffer pin(BlockId blk) { // Only the txs acquiring the same block will be blocked synchronized (prepareAnchor(blk)) { // Find existing buffer Buffer buff = findExistingBuffer(blk); // If there is no such buffer if (buff == null) { ...
Create a Java method that does the following: "This method is used to pin the specified block.".
Of course, here is the Java code you requested: ```java public ScanPaths determineSignatureScannerPaths(final File directory) throws BlackDuckIntegrationException { if (directory == null) { throw new IllegalArgumentException("null is not a valid directory"); } if (!directory.isDire...
Create a Java method that does the following: "Determine the paths of the scan. cli files in the given directory.".
Of course, here is the Java code you requested: ```java public final void mJavaLetter() throws RecognitionException { try { // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1379:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '$' | '_' ) |{...}?~ ( '\\u0000' .. '\\u007F' | '\\uD800' .. '\\uDBFF' ) |{...}? ...
Create a Java method that does the following: "implement method for JavaLetter".
Of course, here is the Java code you requested: ```java private int doJoin() { int s; Thread t; ForkJoinWorkerThread wt; ForkJoinPool.WorkQueue w; if ((s = status) >= 0) { if (((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)) { if (!(w = (wt = (ForkJoinWorkerTh...
Create a Java method that does the following: "Do the actual join.".
Of course, here is the Java code you requested: ```java public <T> F5<P1, P2, P3, P4, P5, T> andThen(final Function<? super R, ? extends T> f) { E.NPE(f); final F5<P1, P2, P3, P4, P5, R> me = this; return new F5<P1, P2, P3, P4, P5, T>() { @Override pu...
Create a Java method that does the following: "A helper method to combine two F5 objects.".
Of course, here is the Java code you requested: ```java public Observable<Page<CognitiveServicesAccountInner>> listByResourceGroupAsync(String resourceGroupName) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1<ServiceResponse<List<CognitiveServicesAccountInner>>, Page<Cogn...
Create a Java method that does the following: "Retrieve a list of Cognitive Services User Identity.".
Of course, here is the Java code you requested: ```java public void markChildNodes(Vector<BoxNode> list) { final Box thisBox = this.getBox(); for (Iterator<BoxNode> it = list.iterator(); it.hasNext();) { BoxNode node = it.next(); if (node != this && node.getBox().ge...
Create a Java method that does the following: "Mark all child boxes in the list as nearest parent of this box.".
Of course, here is the Java code you requested: ```java @Override public void receivePong(Tree message) { // Verify protocol version if (checkVersion) { String ver = message.get("ver", "unknown"); if (!PROTOCOL_VERSION.equals(ver)) { logger.warn("Invalid protocol version (" + ver + ")!"); return; ...
Create a Java method that does the following: "Called when a pong message is received.".
Of course, here is the Java code you requested: ```java public <T> CompletableFuture<T> patchAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return CompletableFuture.supplyAsync(() -> patch(type, closure), getExecutor()); } ``` Hope this helps!
Create a Java method that does the following: "Creates a new CompletableFuture that is asynchronously completed with the result of invoking the given closure.".
Of course, here is the Java code you requested: ```java public void info(String msg) { logHandler.info(msg); if (debugStore != null) { debugStore.log(msg); } } ``` Hope this helps!
Create a Java method that does the following: "Log a message at the INFO level.".
Of course, here is the Java code you requested: ```java public void marshall(DescribeRaidArraysRequest describeRaidArraysRequest, ProtocolMarshaller protocolMarshaller) { if (describeRaidArraysRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
Create a Java method that does the following: "marshalls the given DescribeRaidArraysRequest to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java protected void addClassRow(ClassDoc usedClass, String packageName, Content contentTree) { DocPath dp = pathString(usedClass, DocPaths.CLASS_USE.resolve(DocPath.forName(usedClass))); Content td = HtmlTree.TD(HtmlStyle.co...
Create a Java method that does the following: "Add the class row.".
Of course, here is the Java code you requested: ```java @Override protected void initView() { super.initView(); this.box = new VBox(); this.box.setAlignment(Pos.CENTER); final ScrollPane scrollPane = new ScrollPane(); scrollPane.setPrefSize(600, 600); scrollPane.se...
Create a Java method that does the following: "Initialize the view.".
Of course, here is the Java code you requested: ```java private void aa(final String alias, final String name) throws UnitExistsException, NoSuchUnitException, UnitParseException, SpecificationException, UnitDBException, PrefixDBException, OperationException, NameException, Unit...
Create a Java method that does the following: "A variant of the aa method.".
Of course, here is the Java code you requested: ```java public void marshall(Logging logging, ProtocolMarshaller protocolMarshaller) { if (logging == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(l...
Create a Java method that does the following: "marshalls the logging object to the JSON object.".
Of course, here is the Java code you requested: ```java public static boolean writeBytesToFile(byte[] bytes, File f) { try { FileOutputStream fout = new FileOutputStream(f); fout.write(bytes); fout.close(); } catch (Exception e) { System.out.println...
Create a Java method that does the following: "Write bytes to a file.".
Of course, here is the Java code you requested: ```java public static URL ensureURL(String path ) { path = systemToUnix(path); URL url; try { url = new URL(path); if( url.getProtocol().equals("jar")) { return simplifyJarPath(url); } } catch (MalformedURLException e) { // might just be a file re...
Create a Java method that does the following: "Ensure that a path is a valid URL.".
Of course, here is the Java code you requested: ```java private void deleteApplicationCFs(ApplicationDefinition appDef) { Tenant tenant = Tenant.getTenant(appDef); for (TableDefinition tableDef : appDef.getTableDefinitions().values()) { DBService.instance(tenant).deleteStoreIfPresent(obj...
Create a Java method that does the following: "Delete CFs for an application.".
Of course, here is the Java code you requested: ```java public byte[] convertToXmlByteArray(BucketCrossOriginConfiguration config) throws SdkClientException { XmlWriter xml = new XmlWriter(); xml.start("CORSConfiguration", "xmlns", Constants.XML_NAMESPACE); for (CORSRule rule : config.getRule...
Create a Java method that does the following: "Converts the given configuration to an XML byte array.".
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T, U> Single<T> using(Callable<U> resourceSupplier, Function<? super U, ? extends SingleSource<? extends T>> singleFunction, ...
Create a Java method that does the following: "Creates a new instance of a Crafter App using a single source.".
Of course, here is the Java code you requested: ```java private static Map<WriterKind, PrintWriter> initWriters(PrintWriter out, PrintWriter err) { Map<WriterKind, PrintWriter> writers = new EnumMap<>(WriterKind.class); writers.put(WriterKind.ERROR, err); writers.put(WriterKind.WARNING, err); ...
Create a Java method that does the following: "Initialize a map of writers for the log files.".
Of course, here is the Java code you requested: ```java protected Set<ClusterNode.GrantId> deleteAppFromNode( ClusterNode node, ResourceType type) { synchronized (node) { if (node.deleted) { return null; } nameToApps.remove(node.getName()); RunnableIndices r = typeToIndices.g...
Create a Java method that does the following: "Delete an app from a ClusterNode.".
Of course, here is the Java code you requested: ```java public static <T> T checkPostcondition( final T value, final boolean condition, final Function<T, String> describer) { return innerCheck(value, condition, describer); } ``` Hope this helps!
Create a Java method that does the following: "Check postcondition.".
Of course, here is the Java code you requested: ```java public List<KojiBuildInfo> listBuildsContaining( ArtifactRef artifactRef, KojiSessionInfo session ) throws KojiClientException { return computeIfAbsent( KOJI_BUILD_INFO_CONTAINING_ARTIFACT, ArtifactRef.class, List.class, artifactRe...
Create a Java method that does the following: "List builds containing the artifactRef.".
Of course, here is the Java code you requested: ```java protected <T> void addConverter(Class<T> type, Converter<T> converter) { storage.put(type, converter); } ``` Hope this helps!
Create a Java method that does the following: "Add a converter to the class.".
Of course, here is the Java code you requested: ```java public final Operation setLegacyAbac( String projectId, String zone, String clusterId, boolean enabled) { SetLegacyAbacRequest request = SetLegacyAbacRequest.newBuilder() .setProjectId(projectId) .setZone(zone) ...
Create a Java method that does the following: "Sets the legacy ABAC for a single resource.".
Of course, here is the Java code you requested: ```java public boolean isDeleted(String identifier) { ItemState lastState = changesLog.getItemState(identifier); if (lastState != null && lastState.isDeleted()) { return true; } return false; } ``` Hope this helps!
Create a Java method that does the following: "Check if the item is deleted".
Of course, here is the Java code you requested: ```java private void init() throws EFapsException { if (!this.initialized) { Listener.LOG.info("Scanning for Listener classes...."); this.classes.clear(); this.classes.addAll(new EsjpScanner().scan(EFapsListener.cla...
Create a Java method that does the following: "Method init.".
Of course, here is the Java code you requested: ```java @Override public <T> T instance(Class<T> type) { Key<T> key = Key.of(type); return instance(key); } ``` Hope this helps!
Create a Java method that does the following: "Override the default implementation of the instance method.".
Of course, here is the Java code you requested: ```java @SafeVarargs public final QueryBuilder arguments(Object...args) { set(Param.QUERY_ARGS, ""); queryArgs = args.clone(); return this; } ``` Hope this helps!
Create a Java method that does the following: "Set the query arguments.".
Of course, here is the Java code you requested: ```java public void typeMissing() { this.parameterMissing( ProtocolConstants.Parameters.Create.TYPE, "Please provide the type of the create request. Use \"" + CreateRequestType.USER.getIdentifier() + "\" to create a user, \"" + CreateRequestTy...
Create a Java method that does the following: "This method is called when the type of the create request is missing.".
Of course, here is the Java code you requested: ```java @Override public UpdatePipelineStatusResult updatePipelineStatus(UpdatePipelineStatusRequest request) { request = beforeClientExecution(request); return executeUpdatePipelineStatus(request); } ``` Hope this helps!
Create a Java method that does the following: "Updates the status of a pipelines.".
Of course, here is the Java code you requested: ```java private static Scriptable js_sort(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) { final Comparator<Object> comparator; if (args.length > 0 && Undefined.instance != args[0]) { f...
Create a Java method that does the following: "This is the js_sort method.".
Of course, here is the Java code you requested: ```java @Override public long getLong(TemporalField field) { if (field == OFFSET_SECONDS) { return totalSeconds; } else if (field instanceof ChronoField) { throw new UnsupportedTemporalTypeException("Unsupported field: " + fiel...
Create a Java method that does the following: "Gets the value of a CrazyNational calendar field as a long.".
Of course, here is the Java code you requested: ```java @Override public void writeBytes(byte[] value, int offset, int length) throws JMSException { byte[] reducedValue = new byte[length]; System.arraycopy(value, offset, reducedValue, 0, length); write(reducedValue); } ``` Hope this h...
Create a Java method that does the following: "Write a byte array to the JMSException.".
Of course, here is the Java code you requested: ```java public static boolean isPeriodActive(final Date startDate, final Date endDate) { if (startDate == null && endDate == null) { return true; } if (startDate == null) { throw new JKException("START_DATE_CAN_NOT_BE_NULL"); } if (endDate == null)...
Create a Java method that does the following: "Checks if the period between two dates is active.".
Of course, here is the Java code you requested: ```java public void applyServiceAccount(ServiceAccount serviceAccount, String sourceName) throws Exception { String namespace = getNamespace(); String id = getName(serviceAccount); Objects.requireNonNull(id, "No name for " + serviceAccount + " " +...
Create a Java method that does the following: "Apply a ServiceAccount to the Service.".
Of course, here is the Java code you requested: ```java public CrossSheetReference createCrossSheetReference(long sheetId, CrossSheetReference crossSheetReference) throws SmartsheetException { return this.createResource("sheets/" + sheetId + "/crosssheetreferences", CrossSheetReference.class, crossSheetRef...
Create a Java method that does the following: "Create a cross sheet reference.".
Of course, here is the Java code you requested: ```java public final int pageY() { if (getTouches() != null && getTouches().length() > 0) { return getTouches().get(0).getPageY(); } else { return getClientY() + GQuery.document.getScrollTop(); } } ``` Hope this helps!
Create a Java method that does the following: "Get the page y position of the element.".
Of course, here is the Java code you requested: ```java @Override public RestCollection<Event> getEvents(Token token, EventQueryAttribute queryAttribute, String queryValue) { final ResultIterator<Event> iterator = new ResultIterator<>( token, V2_EVENTS, Event.class, queryAttribute, queryValue); ...
Create a Java method that does the following: "Get the events.".
Of course, here is the Java code you requested: ```java public static <E> ImmutableMultiset<E> copyOf(E[] elements) { return copyOf(Arrays.asList(elements)); } ``` Hope this helps!
Create a Java method that does the following: "Creates an immutable multiset from the given array of elements.".
Of course, here is the Java code you requested: ```java public ClockDifference getClockDifference() throws IOException, InterruptedException { VirtualChannel channel = getChannel(); if(channel==null) throw new IOException(getNodeName()+" is offline"); return channel.call(getClockDi...
Create a Java method that does the following: "Get the clock difference for this node.".
Of course, here is the Java code you requested: ```java void addNewKey(Object key) { ensureRoom(buildKeyPosition + 1); buildKeys[buildKeyPosition++] = updateFunction.apply(key); } ``` Hope this helps!
Create a Java method that does the following: "Add a new key to the buildKey array.".
Of course, here is the Java code you requested: ```java @Override public @Nullable V getIfPresent(Object key, boolean recordStats) { V value = data.get(key); if (recordStats) { if (value == null) { statsCounter.recordMisses(1); } else { statsCounter.recordHits(1); } } ...
Create a Java method that does the following: "Get the value of the specified key from the cache.".
Of course, here is the Java code you requested: ```java public void addService(TDefinitions descriptionType) { String interfacens; String interfacename; QName qname; String name; if (soapFactory == null) soapFactory = new org.xmlsoap.schemas.wsdl.soap.Ob...
Create a Java method that does the following: "AddService Method.".
Of course, here is the Java code you requested: ```java @Override public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName, String schemaName) throws HiveSQLException { try { TGetSchemasReq req = new TGetSchemasReq(sessionHandle.toTSessionHandle()); req.setCat...
Create a Java method that does the following: "Get the schemas for the catalog and schema name.".
Of course, here is the Java code you requested: ```java public Bundle saveInstanceState(Bundle savedInstanceState) { if (savedInstanceState != null) { savedInstanceState.putInt(BUNDLE_SELECTION_HEADER, mAccountHeaderBuilder.getCurrentSelection()); } return savedInstanceState; } ...
Create a Java method that does the following: "Save the current selection in the bundle.".
Of course, here is the Java code you requested: ```java private byte[] getContentBytesForPage(int pageNum) throws IOException { RandomAccessFileOrArray f = reader.getSafeFile(); byte[] contentBytes = reader.getPageContent(pageNum, f); f.close(); return contentBytes; } ``` Hope...
Create a Java method that does the following: "Get the content bytes for a single page.".
Of course, here is the Java code you requested: ```java @Override public PutGatewayResponseResult putGatewayResponse(PutGatewayResponseRequest request) { request = beforeClientExecution(request); return executePutGatewayResponse(request); } ``` Hope this helps!
Create a Java method that does the following: "Updates the response of a CRS Gateway.".
Of course, here is the Java code you requested: ```java private String normalizeResourceName(String name) { if (name.startsWith("//")) { return "classpath:" + name; } final int firstProtocol = name.indexOf("://"); final int secondProtocol = name.indexOf("://", firstProtocol ...
Create a Java method that does the following: "Normalize the resource name.".
Of course, here is the Java code you requested: ```java public static void e(String tag, String msg) { if (logEnabled) { Log.e(tag, msg); } } ``` Hope this helps!
Create a Java method that does the following: "Log an error message with a tag.".
Of course, here is the Java code you requested: ```java @NonNull @VisibleForTesting static String buildUrlFromRideParameters(@NonNull Context context, @NonNull RideParameters rideParameters, @NonNull SessionConfiguration ...
Create a Java method that does the following: "Build a URL from the RIDE parameters.".
Of course, here is the Java code you requested: ```java public static void multAddOuter( double alpha , DMatrix4x4 A , double beta , DMatrix4 u , DMatrix4 v , DMatrix4x4 C ) { C.a11 = alpha*A.a11 + beta*u.a1*v.a1; C.a12 = alpha*A.a12 + beta*u.a1*v.a2; C.a13 = alpha*A.a13 + beta*u.a1*v.a3; ...
Create a Java method that does the following: "Multiplies two matrix elements in the outer product of A and B.".
Of course, here is the Java code you requested: ```java @Override public Request<AttachNetworkInterfaceRequest> getDryRunRequest() { Request<AttachNetworkInterfaceRequest> request = new AttachNetworkInterfaceRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true));...
Create a Java method that does the following: "Returns a request configured to attach a network interface to a user.".
Of course, here is the Java code you requested: ```java private void adaptNavigationWidth() { if (frameLayout != null && navigationFragmentContainer != null && cardView != null && toolbarLarge != null) { ViewCompat.setPaddingRelative(navigationFragmentContainer, 0, 0, ...
Create a Java method that does the following: "Adapts the width of the navigation.".
Of course, here is the Java code you requested: ```java protected static boolean locateMatchingCredentialType(final Authentication authentication, final String credentialClassType) { return StringUtils.isNotBlank(credentialClassType) && authentication.getCredentials() .stream() .anyMatc...
Create a Java method that does the following: "Locate matching credential type boolean.".
Of course, here is the Java code you requested: ```java private LinkedHashMap<String, Num> mapValues(String infix, Object... values) { LinkedHashMap<String, Num> vNames = null; int remain = 0; Matcher mat = pVariableNames.matcher(infix); while (mat.find()) { if ...
Create a Java method that does the following: "Map the values of a single class variable name to a list of values.".
Of course, here is the Java code you requested: ```java public static <T, U> Collector<T, ?, Seq<T>> maxAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) { class Accumulator { List<T> t = new ArrayList<>(); U u; void set(T t, U u) { ...
Create a Java method that does the following: "Collect sequence of all elements of type T and type U using maxAllBy method.".
Of course, here is the Java code you requested: ```java @Override protected void exportXmlData(final StringBuilder out, final int occ) { xmlEncode(getValue(occ).toString(), out); } ``` Hope this helps!
Create a Java method that does the following: "Export the XML data for a single occurrence of a record.".
Of course, here is the Java code you requested: ```java public void checkForTime(final LocalTime VALUE) { if (!isActive()) return; boolean wasInSection = contains(checkedValue); boolean isInSection = contains(VALUE); if (!wasInSection && isInSection) { fireTimeSectionEvent(...
Create a Java method that does the following: "Check for time.".
Of course, here is the Java code you requested: ```java public ManagementLockObjectInner getByResourceGroup(String resourceGroupName, String lockName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, lockName).toBlocking().single().body(); } ``` Hope this helps!
Create a Java method that does the following: "Gets a management lock object by resource group.".
Of course, here is the Java code you requested: ```java public Type makeSomethingFromGTS(List<Element> children) throws Exception { if (children.isEmpty()) return null; if (children.size() == 1) { String type = children.get(0).getAttribute("xsi:type"); if (type.equals("IVL_TS")) return makePeriodFromI...
Create a Java method that does the following: "Make something from GTS.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("nls") public static CoordinateReferenceSystem readProjectionFile( String filePath, String extension ) throws Exception { CoordinateReferenceSystem crs = null; String prjPath = null; String filePathLower = filePath.tr...
Create a Java method that does the following: "Read a CRS file from a file path and extension.".
Of course, here is the Java code you requested: ```java public static Method getReadMethod(Class<?> clazz, String propertyName) throws NoSuchMethodError { String propertyNameCapitalized = capitalize(propertyName); try { return clazz.getMethod("get" + propertyNameCapitalized); ...
Create a Java method that does the following: "Gets the read method for the specified property.".
Of course, here is the Java code you requested: ```java protected final HylaFAXClientConnectionFactory createHylaFAXClientConnectionFactory(String className) { //create new instance HylaFAXClientConnectionFactory factory=(HylaFAXClientConnectionFactory)ReflectionHelper.createInstance(className); ...
Create a Java method that does the following: "Create a new HylaFAXClientConnectionFactory instance.".
Of course, here is the Java code you requested: ```java static int main2(PrintWriter out, PrintWriter err, List<String> args) { try { final Launcher launcher = new Launcher(args, out); final Quidem quidem; try { quidem = launcher.parse(); } catch (ParseException e) { return ...
Create a Java method that does the following: "Main entry point for the SequenceService2.".
Of course, here is the Java code you requested: ```java public Permissions getEffective() { final ModeledAuthenticatedUser authenticatedUser = getCurrentUser(); final Set<String> effectiveGroups; // If this user is the currently-authenticated user, include any // additional effective ...
Create a Java method that does the following: "Returns a Permissions object representing all permissions that are granted to this user.".
Of course, here is the Java code you requested: ```java public static DoubleBinding signum(final ObservableDoubleValue d) { return createDoubleBinding(() -> Math.signum(d.get()), d); } ``` Hope this helps!
Create a Java method that does the following: "Create a binding that is used to compute the signum of a value.".
Of course, here is the Java code you requested: ```java @Override protected Locale getLocaleForNewContent( CmsObject cms, CmsSecurityManager securityManager, String resourcename, List<CmsProperty> properties) { return CmsLocaleManager.MASTER_LOCALE; } ``` Hope this hel...
Create a Java method that does the following: "Get the locale for a new content.".
Of course, here is the Java code you requested: ```java public ISeq<Genotype<G>> getGenotypes() { return _population.stream() .map(Phenotype::getGenotype) .collect(ISeq.toISeq()); } ``` Hope this helps!
Create a Java method that does the following: "Returns a sequence of genotypes from the population.".
Of course, here is the Java code you requested: ```java protected boolean valueIsNull(MapEntryValue value) { return value == null || value.type() == MapEntryValue.Type.TOMBSTONE; } ``` Hope this helps!
Create a Java method that does the following: "Returns true if the value is null.".
Of course, here is the Java code you requested: ```java public long getCount(DBObject query, DBObject fields, long limit, long skip) throws MongoException { return dbCollection.getCount(serializeFields(query), fields, limit, skip); } ``` Hope this helps!
Create a Java method that does the following: "Gets count.".
Of course, here is the Java code you requested: ```java public String getFormattedMessage(String key, Object[] args, String defaultString, boolean quiet) { if (resolver == null) resolver = TraceNLSResolver.getInstance(); return resolver.getMessage(caller, null, ivBundleName, key, args, def...
Create a Java method that does the following: "Get the message for the specified key.".
Of course, here is the Java code you requested: ```java public static Function<Object,Long> methodForLong(final String methodName, final Object... optionalParameters) { return new Call<Object,Long>(Types.LONG, methodName, VarArgsUtil.asOptionalObjectArray(Object.class,optionalParameters)); } ``` Hope th...
Create a Java method that does the following: "Creates a function that takes a long parameter and returns it.".
Of course, here is the Java code you requested: ```java public static <T1, T2> TypeFactory<Tuple2<T1, T2>> typeFactory( TypeFactory<T1> type1, TypeFactory<T2> type2 ) { return new Tuple2TypeFactory<>(type1, type2); } ``` Hope this helps!
Create a Java method that does the following: "Create a type factory for tuples of two types.".
Of course, here is the Java code you requested: ```java @GwtIncompatible("Unnecessary") private Map<String, String> constructRootRelativePathsMap() { Map<String, String> rootRelativePathsMap = new LinkedHashMap<>(); for (String mapString : config.manifestMaps) { int colonIndex = mapString.indexOf(':');...
Create a Java method that does the following: "Construct a map of exec paths to root relative paths.".
Of course, here is the Java code you requested: ```java @Action(invokeOn = InvokeOn.OBJECT_AND_COLLECTION) @ActionLayout( describedAs = "Toggle, for testing (direct) bulk actions" ) public void toggleForBulkActions() { boolean flag = getFlag() != null? getFlag(): false; setFlag(...
Create a Java method that does the following: "Toggles the flag for bulk actions.".
Of course, here is the Java code you requested: ```java public void logSetPermissions(String src, FsPermission permissions) { SetPermissionsOp op = SetPermissionsOp.getInstance(); op.set(src, permissions); logEdit(op); } ``` Hope this helps!
Create a Java method that does the following: "Add SetPermissions operation to edit log.".
Of course, here is the Java code you requested: ```java public void exiting(String sourceClass, String sourceMethod, Object result) { _log.exiting(sourceClass, sourceMethod, result); } ``` Hope this helps!
Create a Java method that does the following: "Called by the application to log the exit of the processing of a CIDCTYPE.".
Of course, here is the Java code you requested: ```java private CorruptFileBlocks methodBasedListCorruptFileBlocks(String path, String cookie) throws IOException { if (!namenodeProtocolProxy.isMethodSupported("listCorruptFileBlocks", String.class, String.class)) { LOG.info("NameNode version is ...
Create a Java method that does the following: "Method based listCorruptFileBlocks.".
Of course, here is the Java code you requested: ```java public static HttpFileBuilder ofResource(String path) { requireNonNull(path, "path"); return ofResource(HttpFile.class.getClassLoader(), path); } ``` Hope this helps!
Create a Java method that does the following: "Create a new HttpFileBuilder from a resource.".
Of course, here is the Java code you requested: ```java public static Stream<BigFloat> range(long startInclusive, long endExclusive, long step, Context context) { return range(context.valueOf(startInclusive), context.valueOf(endExclusive), context.valueOf(step)); } ``` Hope this helps!
Create a Java method that does the following: "Returns a stream of BigFloats from the given range of values.".
Of course, here is the Java code you requested: ```java public void setInputWidth(final int inputWidth) { if (inputWidth > 100) { throw new IllegalArgumentException( "inputWidth (" + inputWidth + ") cannot be greater than 100 percent."); } getOrCreateComponentModel().inputWidth = Math.max(0, inputWidth);...
Create a Java method that does the following: "Sets the input width.".
Of course, here is the Java code you requested: ```java public void setItems(java.util.Collection<Resource> items) { if (items == null) { this.items = null; return; } this.items = new java.util.ArrayList<Resource>(items); } ``` Hope this helps!
Create a Java method that does the following: "Sets the value of the items property.".
Of course, here is the Java code you requested: ```java public static <T> void whenAllDone( List<CompletionStage<T>> inputs, Runnable callback, Executor executor) { allDone(inputs).thenRunAsync(callback, executor).exceptionally(UncaughtExceptions::log); } ``` Hope this helps!
Create a Java method that does the following: "When all the sequence of tasks complete.".
Of course, here is the Java code you requested: ```java @Override public String update(Integer id, String json, boolean autoCommit) throws SQLException, IOException { final boolean isCreating = id == null; JsonNode jsonNode = getJsonNode(json); try { if (jsonNode.isArray()) { ...
Create a Java method that does the following: "Update an entity.".
Of course, here is the Java code you requested: ```java public void setAlpha (float alpha) { if (alpha < 0.0f) { alpha = 0.0f; } else if (alpha > 1.0f) { alpha = 1.0f; } if (alpha != _alphaComposite.getAlpha()) { _alphaComposite = AlphaComposite....
Create a Java method that does the following: "Sets the alpha value of the image.".
Of course, here is the Java code you requested: ```java private JMFType findChild(JMFType start, String segment) { if (start instanceof JSPrimitive || start instanceof JSDynamic || start instanceof JSEnum) return null; if (segment.charAt(0) == '[') return findChildByIndex(start, Integer.pa...
Create a Java method that does the following: "Find child by name".
Of course, here is the Java code you requested: ```java @Override public <E> E search(final Searchable<E> searchable) { try { return search(configureMatcher(searchable).asList()); } finally { MatcherHolder.unset(); } } ``` Hope this helps!
Create a Java method that does the following: "Search for a Searchable object.".
Of course, here is the Java code you requested: ```java public com.google.api.ads.adwords.axis.v201809.cm.Location[] getLocations() { return locations; } ``` Hope this helps!
Create a Java method that does the following: "Gets the locations value for this CdnAudienceSegment.".
Of course, here is the Java code you requested: ```java public static base_response unset(nitro_service client, coparameter resource, String[] args) throws Exception{ coparameter unsetresource = new coparameter(); return unsetresource.unset_resource(client,args); } ``` Hope this helps!
Create a Java method that does the following: "Use this API to unset the properties of coparameter resource. Properties that need to be unset are specified in args array.".
Of course, here is the Java code you requested: ```java public void toWEBP(File src, File dest) { try { String command = commandDir + (src.getName().endsWith(".gif") ? "/gif2webp " : "/cwebp ") + src.getPath() + " -o " + dest.getPath(); this.executeCommand(command); } catch (Exc...
Create a Java method that does the following: "Write a file to a webp file.".
Of course, here is the Java code you requested: ```java protected <Y> T getUniqueByAttribute(SingularAttribute<T, Y> attribute, Y value) { try { return getDatabaseSupport().getUniqueByAttribute(getEntityClass(), attribute, value); } catch (NoResultException ex) { ret...
Create a Java method that does the following: "Gets the unique object for the given attribute and value.".
Of course, here is the Java code you requested: ```java public void removeSessionToken() { HtmlParameterStats item = this.getParamsPanel().getSelectedParam(); if (item != null) { // If the HttpSessions extension is active, notify it of the removed session token ExtensionHttpSessions extSession = this.g...
Create a Java method that does the following: "Remove the session token from the HTML parameters panel.".