query stringlengths 7 3.3k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
Sets the current reference definition derived from the current member, and optionally some attributes.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException If an error occurs
@doc.tag type="block"
@doc.param name="attributes" optional="true" description="Attributes of the reference as name-value pairs 'name=value',
separated by commas"
@doc.param name="auto-delete" optional="true" description="Whether to automatically delete the
referenced object on object deletion"
@doc.param name="auto-retrieve" optional="true" description="Whether to automatically retrieve
the referenced object"
@doc.param name="auto-update" optional="true" description="Whether to automatically update the
referenced object"
@doc.param name="class-ref" optional="true" description="The fully qualified name of the class
owning the referenced field"
@doc.param name="database-foreignkey" optional="true" description="Whether a database foreignkey shall be created"
values="true,false"
@doc.param name="documentation" optional="true" description="Documentation on the reference"
@doc.param name="foreignkey" optional="true" description="The fields in the current type used for
implementing the reference"
@doc.param name="otm-dependent" optional="true" description="Whether the reference is dependent on otm"
@doc.param name="proxy" optional="true" description="Whether to use a proxy for the reference"
@doc.param name="proxy-prefetching-limit" optional="true" description="Specifies the amount of objects to prefetch"
@doc.param name="refresh" optional="true" description="Whether to automatically refresh the
reference"
@doc.param name="remote-foreignkey" optional="true" description="The fields in the referenced type
corresponding to the local fields (is only used for the table definition)" | [
"public void processReference(String template, Properties attributes) throws XDocletException\r\n {\r\n String name = OjbMemberTagsHandler.getMemberName();\r\n XClass type = OjbMemberTagsHandler.getMemberType();\r\n int dim = OjbMembe... | [
"public void writeNameValuePair(String name, int value) throws IOException\n {\n internalWriteNameValuePair(name, Integer.toString(value));\n }",
"public PagedList<V> convert(final PagedList<U> uList) {\n if (uList == null || uList.isEmpty()) {\n return new PagedList<V>() {\n ... |
Use this API to add dbdbprofile. | [
"public static base_response add(nitro_service client, dbdbprofile resource) throws Exception {\n\t\tdbdbprofile addresource = new dbdbprofile();\n\t\taddresource.name = resource.name;\n\t\taddresource.interpretquery = resource.interpretquery;\n\t\taddresource.stickiness = resource.stickiness;\n\t\taddresource.kcda... | [
"public void saveAsPropertyBundle() throws UnsupportedEncodingException, CmsException, IOException {\n\n switch (m_bundleType) {\n case XML:\n saveLocalization();\n loadAllRemainingLocalizations();\n createPropertyVfsBundleFiles();\n save... |
Test the list of TimephasedWork instances to see
if any of them have been modified.
@param list list of TimephasedWork instances
@return boolean flag | [
"public boolean getWorkModified(List<TimephasedWork> list)\n {\n boolean result = false;\n for (TimephasedWork assignment : list)\n {\n result = assignment.getModified();\n if (result)\n {\n break;\n }\n }\n return result;\n }"
] | [
"private List<TimephasedWork> splitWork(CostRateTable table, ProjectCalendar calendar, TimephasedWork work, int rateIndex)\n {\n List<TimephasedWork> result = new LinkedList<TimephasedWork>();\n work.setTotalAmount(Duration.getInstance(0, work.getAmountPerDay().getUnits()));\n\n while (true)\n ... |
Update the anchor based on arcore best knowledge of the world
@param scale | [
"protected void update(float scale) {\n // Updates only when the plane is in the scene\n GVRSceneObject owner = getOwnerObject();\n\n if ((owner != null) && isEnabled() && owner.isEnabled())\n {\n convertFromARtoVRSpace(scale);\n }\n }"
] | [
"@Override\n public void invert( ZMatrixRMaj inv ) {\n if( inv.numRows != n || inv.numCols != n ) {\n throw new RuntimeException(\"Unexpected matrix dimension\");\n }\n if( inv.data == t ) {\n throw new IllegalArgumentException(\"Passing in the same matrix that was deco... |
Use this API to fetch aaagroup_aaauser_binding resources of given name . | [
"public static aaagroup_aaauser_binding[] get(nitro_service service, String groupname) throws Exception{\n\t\taaagroup_aaauser_binding obj = new aaagroup_aaauser_binding();\n\t\tobj.set_groupname(groupname);\n\t\taaagroup_aaauser_binding response[] = (aaagroup_aaauser_binding[]) obj.get_resources(service);\n\t\tret... | [
"private static JSONArray parseOutgoings(ArrayList<Shape> outgoings) throws JSONException {\n if (outgoings != null) {\n JSONArray outgoingsArray = new JSONArray();\n\n for (Shape outgoing : outgoings) {\n JSONObject outgoingObject = new JSONObject();\n\n o... |
This method returns the existing folder, and if it does not exist, the
method generates it.
@param path
@param dest_dir
@return the folder
@throws BeastException | [
"public static File createFolder(String path, String dest_dir)\n throws BeastException {\n File f = new File(dest_dir);\n if (!f.isDirectory()) {\n try {\n f.mkdirs();\n } catch (Exception e) {\n logger.severe(\"Problem creating directory:... | [
"private void writeActivity(Task mpxj)\n {\n ActivityType xml = m_factory.createActivityType();\n m_project.getActivity().add(xml);\n\n Task parentTask = mpxj.getParentTask();\n Integer parentObjectID = parentTask == null ? null : parentTask.getUniqueID();\n\n xml.setActualStartDate(mpxj.... |
Publish the bundle resources directly. | [
"public void publish() {\n\n CmsDirectPublishDialogAction action = new CmsDirectPublishDialogAction();\n List<CmsResource> resources = getBundleResources();\n I_CmsDialogContext context = new A_CmsDialogContext(\"\", ContextType.appToolbar, resources) {\n\n public void focus(CmsUUID ... | [
"public String getKeySchema() throws IOException {\n Schema schema = getInputPathAvroSchema();\n String keySchema = schema.getField(keyFieldName).schema().toString();\n return keySchema;\n }",
"@Override\n\tpublic boolean retainAll(Collection<?> collection) {\n\t\tif (dao == null) {\n\t\t\... |
Initialize the container for the current application deployment
@param deploymentManager
@param deploymentServices | [
"public static void initialize(BeanManagerImpl deploymentManager, ServiceRegistry deploymentServices) {\n Container instance = new Container(RegistrySingletonProvider.STATIC_INSTANCE, deploymentManager, deploymentServices);\n Container.instance.set(RegistrySingletonProvider.STATIC_INSTANCE, instance);... | [
"public static URL buildUrl(String scheme, String host, int port, String path, Map<String, String> parameters) throws MalformedURLException {\r\n checkSchemeAndPort(scheme, port);\r\n StringBuilder buffer = new StringBuilder();\r\n if (!host.startsWith(scheme + \"://\")) {\r\n buffer... |
Returns the field definition with the specified name.
@param name The name of the desired field
@return The field definition or <code>null</code> if there is no such field | [
"public FieldDescriptorDef getField(String name)\r\n {\r\n FieldDescriptorDef fieldDef = null;\r\n\r\n for (Iterator it = _fields.iterator(); it.hasNext(); )\r\n {\r\n fieldDef = (FieldDescriptorDef)it.next();\r\n if (fieldDef.getName().equals(name))\r\n {\r\... | [
"public void deployApplication(String applicationName, URL... urls) throws IOException {\n this.applicationName = applicationName;\n\n for (URL url : urls) {\n try (InputStream inputStream = url.openStream()) {\n deploy(inputStream);\n }\n }\n }",
"publ... |
Remove a descriptor.
@param validKey This could be the {@link JdbcConnectionDescriptor}
itself, or the associated {@link JdbcConnectionDescriptor#getPBKey PBKey}. | [
"public void removeDescriptor(Object validKey)\r\n {\r\n PBKey pbKey;\r\n if (validKey instanceof PBKey)\r\n {\r\n pbKey = (PBKey) validKey;\r\n }\r\n else if (validKey instanceof JdbcConnectionDescriptor)\r\n {\r\n pbKey = ((JdbcConnectionDescripto... | [
"public Integer getBlockMaskPrefixLength(boolean network) {\n\t\tInteger prefixLen;\n\t\tif(network) {\n\t\t\tif(hasNoPrefixCache() || (prefixLen = prefixCache.networkMaskPrefixLen) == null) {\n\t\t\t\tprefixLen = setNetworkMaskPrefix(checkForPrefixMask(network));\n\t\t\t}\n\t\t} else {\n\t\t\tif(hasNoPrefixCache()... |
This method extracts data for a single calendar from a Planner file.
@param plannerCalendar Calendar data
@param parentMpxjCalendar parent of derived calendar | [
"private void readCalendar(net.sf.mpxj.planner.schema.Calendar plannerCalendar, ProjectCalendar parentMpxjCalendar) throws MPXJException\n {\n //\n // Create a calendar instance\n //\n ProjectCalendar mpxjCalendar = m_projectFile.addCalendar();\n\n //\n // Populate basic details\n ... | [
"private float getQuaternionW(float x, float y, float z) {\n return (float) Math.cos(Math.asin(Math.sqrt(x * x + y * y + z * z)));\n }",
"public static String decodeUrl(String stringToDecode) {\n try {\n return URLDecoder.decode(stringToDecode, \"UTF-8\");\n } catch (Unsupported... |
Gets the global and adds it ot the BatchExecutionresults using the alternative outIdentifier.
@param identifier
The identifier of the global
@param outIdentifier
The identifier used in the ExecutionResults to store the global.
@return | [
"public static Command newGetGlobal(String identifier,\n String outIdentifier) {\n return getCommandFactoryProvider().newGetGlobal( identifier,\n outIdentifier );\n }"
] | [
"public ClassNode addInterface(String name) {\n ClassNode intf = infoBase.node(name);\n addInterface(intf);\n return this;\n }",
"public void setAll() {\n\tshowAttributes = true;\n\tshowEnumerations = true;\n\tshowEnumConstants = true;\n\tshowOperations = true;\n\tshowConstructors = true;\... |
Get a writer implementation to push data into Canvas.
@param type Interface type you wish to get an implementation for
@param oauthToken An OAuth token to use for authentication when making API calls
@param <T> A writer implementation
@return A writer implementation class | [
"public <T extends CanvasWriter> T getWriter(Class<T> type, OauthToken oauthToken) {\n return getWriter(type, oauthToken, false);\n }"
] | [
"private void performPermissionCheck(CmsObject cms) throws CmsPermissionViolationException {\n\n if (cms.getRequestContext().getCurrentUser().isGuestUser()) {\n throw new CmsPermissionViolationException(null);\n }\n }",
"public boolean hasUppercaseVariations(int base, boolean lowerOnly... |
Injects bound fields
@param instance The instance to inject into | [
"public static <T> void injectBoundFields(T instance, CreationalContext<T> creationalContext, BeanManagerImpl manager,\n Iterable<? extends FieldInjectionPoint<?, ?>> injectableFields) {\n for (FieldInjectionPoint<?, ?> injectableField : injectableFields) {\n injectableField.inject(inst... | [
"public T removeBundle(final String moduleName, final String slot, final byte[] existingHash) {\n final ContentItem item = createBundleItem(moduleName, slot, NO_CONTENT);\n addContentModification(createContentModification(item, ModificationType.REMOVE, existingHash));\n return returnThis();\n ... |
Calculate start dates for a daily recurrence.
@param calendar current date
@param frequency frequency
@param dates array of start dates | [
"private void getDailyDates(Calendar calendar, int frequency, List<Date> dates)\n {\n while (moreDates(calendar, dates))\n {\n dates.add(calendar.getTime());\n calendar.add(Calendar.DAY_OF_YEAR, frequency);\n }\n }"
] | [
"boolean lockSharedInterruptibly(final Integer permit, final long timeout, final TimeUnit unit) throws InterruptedException {\n if (permit == null) {\n throw new IllegalArgumentException();\n }\n return sync.tryAcquireSharedNanos(permit, unit.toNanos(timeout));\n }",
"public voi... |
Returns the bit at the specified index.
@param index The index of the bit to look-up (0 is the least-significant bit).
@return A boolean indicating whether the bit is set or not.
@throws IndexOutOfBoundsException If the specified index is not a bit
position in this bit string. | [
"public boolean getBit(int index)\n {\n assertValidIndex(index);\n int word = index / WORD_LENGTH;\n int offset = index % WORD_LENGTH;\n return (data[word] & (1 << offset)) != 0;\n }"
] | [
"public Task<RemoteInsertOneResult> insertOne(final DocumentT document) {\n return dispatcher.dispatchTask(new Callable<RemoteInsertOneResult>() {\n @Override\n public RemoteInsertOneResult call() {\n return proxy.insertOne(document);\n }\n });\n }",
"public Conditionals ifModifiedSin... |
Returns the compact task records for all tasks with the given tag.
Tasks can have more than one tag at a time.
@param tag The tag to fetch tasks from.
@return Request object | [
"public CollectionRequest<Task> getTasksWithTag(String tag) {\n \n String path = String.format(\"/tags/%s/tasks\", tag);\n return new CollectionRequest<Task>(this, Task.class, path, \"GET\");\n }"
] | [
"public void beforeCompletion()\r\n {\r\n // avoid redundant calls\r\n if(beforeCompletionCall) return;\r\n\r\n log.info(\"Method beforeCompletion was called\");\r\n int status = Status.STATUS_UNKNOWN;\r\n try\r\n {\r\n JTATxManager mgr = (JTATxManager) getImp... |
Specify additional query parameters to be passed to the filter function.
@param queryParams map of key-value parameters
@return this Replication instance to set more options or trigger the replication | [
"public Replication queryParams(Map<String, Object> queryParams) {\r\n this.replication = replication.queryParams(queryParams);\r\n return this;\r\n }"
] | [
"public synchronized X509Certificate getMappedCertificate(final X509Certificate cert)\n\tthrows CertificateEncodingException,\n\tInvalidKeyException,\n\tCertificateException,\n\tCertificateNotYetValidException,\n\tNoSuchAlgorithmException,\n\tNoSuchProviderException,\n\tSignatureException,\n\tKeyStoreException,\n\t... |
Checks the orderby attribute.
@param collDef The collection descriptor
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintException If the value for orderby is invalid (unknown field or ordering) | [
"private void checkOrderby(CollectionDescriptorDef collDef, String checkLevel) throws ConstraintException\r\n {\r\n if (CHECKLEVEL_NONE.equals(checkLevel))\r\n {\r\n return;\r\n }\r\n\r\n String orderbySpec = collDef.getProperty(PropertyHelper.OJB_PROPERTY_ORDERBY);\r\n\r\n... | [
"protected X509Certificate wireUpSslWithCyberVilliansCAOdo(String host, SslListener listener) {\n host = requestOriginalHostName.get();\n\n // Add cybervillians CA(from browsermob)\n try {\n // see https://github.com/webmetrics/browsermob-proxy/issues/105\n String escapedH... |
Associate an input stream with the operation. Closing the input stream
is the responsibility of the caller.
@param in the input stream. Cannot be {@code null}
@return a builder than can be used to continue building the operation | [
"public OperationBuilder addInputStream(final InputStream in) {\n Assert.checkNotNullParam(\"in\", in);\n if (inputStreams == null) {\n inputStreams = new ArrayList<InputStream>();\n }\n inputStreams.add(in);\n return this;\n }"
] | [
"@SuppressWarnings({\"unused\", \"WeakerAccess\"})\n public UTMDetail getUTMDetails() {\n UTMDetail ud = new UTMDetail();\n ud.setSource(source);\n ud.setMedium(medium);\n ud.setCampaign(campaign);\n return ud;\n }",
"private void processResponse(Response<ByteArray, Object... |
By the time we reach this method, we should be looking at the SQLite
database file itself.
@param file SQLite database file
@return ProjectFile instance | [
"private ProjectFile readFile(File file) throws MPXJException\n {\n try\n {\n String url = \"jdbc:sqlite:\" + file.getAbsolutePath();\n Properties props = new Properties();\n m_connection = org.sqlite.JDBC.createConnection(url, props);\n\n m_documentBuilder = DocumentBuil... | [
"public NodeList getAt(String name) {\n NodeList answer = new NodeList();\n for (Object child : this) {\n if (child instanceof Node) {\n Node childNode = (Node) child;\n Object temp = childNode.get(name);\n if (temp instanceof Collection) {\n ... |
Multiply scalar value to a complex number.
@param z1 Complex Number.
@param scalar Scalar value.
@return Returns new ComplexNumber instance containing the multiply of specified complex number with the scalar value. | [
"public static ComplexNumber Multiply(ComplexNumber z1, double scalar) {\r\n return new ComplexNumber(z1.real * scalar, z1.imaginary * scalar);\r\n }"
] | [
"public static Map<String, String> getMetadataFromSequenceFile(FileSystem fs, Path path) {\n try {\n Configuration conf = new Configuration();\n conf.setInt(\"io.file.buffer.size\", 4096);\n SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, new Configuration());\... |
Closes off all connections in all partitions. | [
"public void terminateAllConnections(){\r\n\t\tthis.terminationLock.lock();\r\n\t\ttry{\r\n\t\t\t// close off all connections.\r\n\t\t\tfor (int i=0; i < this.pool.partitionCount; i++) {\r\n\t\t\t\tthis.pool.partitions[i].setUnableToCreateMoreTransactions(false); // we can create new ones now, this is an optimizati... | [
"private ChildTaskContainer getParentTask(String wbs)\n {\n ChildTaskContainer result;\n String parentWbs = getParentWBS(wbs);\n if (parentWbs == null)\n {\n result = m_projectFile;\n }\n else\n {\n result = m_taskMap.get(parentWbs);\n }\n return result... |
Get the ver
@param id
@return | [
"public Versioned<E> getVersionedById(int id) {\n Versioned<VListNode<E>> listNode = getListNode(id);\n if(listNode == null)\n throw new IndexOutOfBoundsException();\n return new Versioned<E>(listNode.getValue().getValue(), listNode.getVersion());\n }"
] | [
"@SuppressWarnings(\"unchecked\")\n public static void executeCommand(String[] args) throws IOException {\n\n OptionParser parser = getParser();\n\n // declare parameters\n List<String> metaKeys = null;\n String url = null;\n String dir = null;\n ... |
For running queries embebed in the report design
@param dr
@param layoutManager
@param con
@param _parameters
@return
@throws JRException | [
"public static JasperPrint generateJasperPrint(DynamicReport dr, LayoutManager layoutManager, Connection con, Map<String, Object> _parameters) throws JRException {\n log.info(\"generating JasperPrint\");\n JasperPrint jp;\n\n if (_parameters == null)\n _parameters = new HashMap<Strin... | [
"public static base_responses delete(nitro_service client, dnsaaaarec resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tdnsaaaarec deleteresources[] = new dnsaaaarec[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\... |
Reverses all the TransitionControllers managed by this TransitionManager | [
"public void reverse() {\n for (int i = 0, size = mTransitionControls.size(); i < size; i++) {\n mTransitionControls.get(i).reverse();\n }\n }"
] | [
"private double getExpectedProbability(double x)\n {\n double y = 1 / (standardDeviation * Math.sqrt(Math.PI * 2));\n double z = -(Math.pow(x - mean, 2) / (2 * Math.pow(standardDeviation, 2)));\n return y * Math.exp(z);\n }",
"public static vlan[] get(nitro_service service) throws Excep... |
Scans a single class for Swagger annotations - does not invoke ReaderListeners | [
"public Swagger read(Class<?> cls) {\n SwaggerDefinition swaggerDefinition = cls.getAnnotation(SwaggerDefinition.class);\n if (swaggerDefinition != null) {\n readSwaggerConfig(cls, swaggerDefinition);\n }\n\n return read(cls, \"\", null, false, new String[0], new String[0], ne... | [
"@UiHandler(\"m_everyDay\")\r\n void onEveryDayChange(ValueChangeEvent<String> event) {\r\n\r\n if (handleChange()) {\r\n m_controller.setInterval(m_everyDay.getFormValueAsString());\r\n }\r\n\r\n }",
"protected String getUniqueString(FieldDescriptor field) throws SequenceManagerExc... |
create a new instance of the class represented by the no-argument constructor provided
@param constructor the zero argument constructor for the class
@return a new instance of the class
@throws InstantiationException
@throws ClassNotPersistenceCapableException if the constructor is null or there is an
exception while trying to create a new instance | [
"public static Object instantiate(Constructor constructor) throws InstantiationException\r\n {\r\n if(constructor == null)\r\n {\r\n throw new ClassNotPersistenceCapableException(\r\n \"A zero argument constructor was not provided!\");\r\n }\r\n\r\n Objec... | [
"public static int convertBytesToInt(byte[] bytes, int offset)\n {\n return (BITWISE_BYTE_TO_INT & bytes[offset + 3])\n | ((BITWISE_BYTE_TO_INT & bytes[offset + 2]) << 8)\n | ((BITWISE_BYTE_TO_INT & bytes[offset + 1]) << 16)\n | ((BITWISE_BYTE_TO_INT & bytes[of... |
Method will be executed asynchronously. | [
"public void sendEventsFromQueue() {\n if (null == queue || stopSending) {\n return;\n }\n LOG.fine(\"Scheduler called for sending events\");\n\n int packageSize = getEventsPerMessageCall();\n\n while (!queue.isEmpty()) {\n final List<Event> list = new ArrayL... | [
"public NamespacesList<Value> getValues(String namespace, String predicate, int perPage, int page) throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n NamespacesList<Value> valuesList = new NamespacesList<Value>();\r\n parameters.put(\"method\", METH... |
Delivers the correct JSON Object for properties
@param properties
@throws org.json.JSONException | [
"private static JSONObject parseProperties(HashMap<String, String> properties) throws JSONException {\n if (properties != null) {\n JSONObject propertiesObject = new JSONObject();\n\n for (String key : properties.keySet()) {\n String propertyValue = properties.get(key);\n... | [
"public Conditionals ifModifiedSince(LocalDateTime time) {\n Preconditions.checkArgument(match.isEmpty(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MODIFIED_SINCE, HeaderConstants.IF_MATCH));\n Preconditions.checkArgument(!unModifiedSince.isPresent(), String.format(ERROR_MESSAGE, HeaderConstants... |
Decide which donor node to steal from. This is a policy implementation.
I.e., in the future, additional policies could be considered. At that
time, this method should be overridden in a sub-class, or a policy object
ought to implement this algorithm.
Current policy:
1) If possible, a stealer node that is the zone n-ary in the finalCluster
steals from the zone n-ary in the currentCluster in the same zone.
2) If there are no partition-stores to steal in the same zone (i.e., this
is the "zone expansion" use case), then a differnt policy must be used.
The stealer node that is the zone n-ary in the finalCluster determines
which pre-existing zone in the currentCluster hosts the primary partition
id for the partition-store. The stealer then steals the zone n-ary from
that pre-existing zone.
This policy avoids unnecessary cross-zone moves and distributes the load
of cross-zone moves approximately-uniformly across pre-existing zones.
Other policies to consider:
- For zone expansion, steal all partition-stores from one specific
pre-existing zone.
- Replace heuristic to approximately uniformly distribute load among
existing zones to something more concrete (i.e. track steals from each
pre-existing zone and forcibly balance them).
- Select a single donor for all replicas in a new zone. This will require
donor-based rebalancing to be run (at least for this specific part of the
plan). This would reduce the number of donor-side scans of data. (But
still send replication factor copies over the WAN.) This would require
apparatus in the RebalanceController to work.
- Set up some sort of chain-replication in which a single stealer in the
new zone steals some replica from a pre-exising zone, and then other
n-aries in the new zone steal from the single cross-zone stealer in the
zone. This would require apparatus in the RebalanceController to work.
@param currentSRP
@param finalSRP
@param stealerZoneId
@param stealerNodeId
@param stealerPartitionId
@return the node id of the donor for this partition Id. | [
"protected int getDonorId(StoreRoutingPlan currentSRP,\n StoreRoutingPlan finalSRP,\n int stealerZoneId,\n int stealerNodeId,\n int stealerPartitionId) {\n int stealerZoneNAry = finalSRP.getZoneNar... | [
"public boolean evaluate(Object feature) {\n\t\t// Checks to ensure that the attribute has been set\n\t\tif (attribute == null) {\n\t\t\treturn false;\n\t\t}\n\t\t// Note that this converts the attribute to a string\n\t\t// for comparison. Unlike the math or geometry filters, which\n\t\t// require specific types to... |
Performs a Versioned put operation with the specified composite request
object
@param requestWrapper Composite request object containing the key and the
versioned object
@return Version of the value for the successful put
@throws ObsoleteVersionException | [
"public Version putVersionedWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper)\n throws ObsoleteVersionException {\n validateTimeout(requestWrapper.getRoutingTimeoutInMs());\n for(int attempts = 0; attempts < this.metadataRefreshAttempts; attempts++) {\n try {\n ... | [
"private TableAlias getTableAliasForPath(String aPath, List hintClasses)\r\n {\r\n return (TableAlias) m_pathToAlias.get(buildAliasKey(aPath, hintClasses));\r\n }",
"private float MIN(float first, float second, float third) {\r\n\r\n float min = Integer.MAX_VALUE;\r\n if (first < min) {... |
Reads numBytes bytes, and returns the corresponding string | [
"public String read(int numBytes) throws IOException {\n Preconditions.checkArgument(numBytes >= 0);\n Preconditions.checkArgument(numBytes <= MAX_ALLOWABLE_BUFFER_SIZE);\n int numBytesRemaining = numBytes;\n // first read whatever we need from our buffer\n if (!isReadBufferEmpty()) {\n int leng... | [
"@Override\n public void onRotationSensor(long timeStamp, float rotationW, float rotationX, float rotationY, float rotationZ,\n float gyroX, float gyroY, float gyroZ) {\n GVRCameraRig cameraRig = null;\n if (mMainScene != null) {\n cameraRig = mMainScene.g... |
Parses the provided file, using the given libraryPaths and sourcePaths as context. The libraries may be either
jar files or references to directories containing class files.
The sourcePaths must be a reference to the top level directory for sources (eg, for a file
src/main/java/org/example/Foo.java, the source path would be src/main/java).
The wildcard resolver provides a fallback for processing wildcard imports that the underlying parser was unable
to resolve. | [
"public static List<ClassReference> analyze(WildcardImportResolver importResolver, Set<String> libraryPaths, Set<String> sourcePaths,\n Path sourceFile)\n {\n ASTParser parser = ASTParser.newParser(AST.JLS11);\n parser.setEnvironment(libraryPaths.toArray(new String[libraryPaths.size(... | [
"public static List<String> enableJMX(List<String> jvmArgs) {\n final String arg = \"-D\" + OPT_JMX_REMOTE;\n if (jvmArgs.contains(arg))\n return jvmArgs;\n final List<String> cmdLine2 = new ArrayList<>(jvmArgs);\n cmdLine2.add(arg);\n return cmdLine2;\n }",
"priva... |
Return the trimmed source line corresponding to the specified AST node
@param node - the Groovy AST node | [
"protected String sourceLineTrimmed(ASTNode node) {\r\n return sourceCode.line(AstUtil.findFirstNonAnnotationLine(node, sourceCode) - 1);\r\n }"
] | [
"private List<MapRow> sort(List<MapRow> rows, final String attribute)\n {\n Collections.sort(rows, new Comparator<MapRow>()\n {\n @Override public int compare(MapRow o1, MapRow o2)\n {\n String value1 = o1.getString(attribute);\n String value2 = o2.getString(attribu... |
Downloads a part of this file's contents, starting at rangeStart and stopping at rangeEnd, while reporting the
progress to a ProgressListener.
@param output the stream to where the file will be written.
@param rangeStart the byte offset at which to start the download.
@param rangeEnd the byte offset at which to stop the download.
@param listener a listener for monitoring the download's progress. | [
"public void downloadRange(OutputStream output, long rangeStart, long rangeEnd, ProgressListener listener) {\n URL url = CONTENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());\n BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, \"GET\");\n if (rangeEnd > 0) {\n ... | [
"public CollectionRequest<Project> findByTeam(String team) {\n \n String path = String.format(\"/teams/%s/projects\", team);\n return new CollectionRequest<Project>(this, Project.class, path, \"GET\");\n }",
"public static base_response unset(nitro_service client, snmpmanager resource, String[... |
Gets any previous versions of this file. Note that only users with premium accounts will be able to retrieve
previous versions of their files.
@return a list of previous file versions. | [
"public Collection<BoxFileVersion> getVersions() {\n URL url = VERSIONS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());\n BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, \"GET\");\n BoxJSONResponse response = (BoxJSONResponse) request.send();\n\n JsonObject js... | [
"public static Method getSAMMethod(Class<?> c) {\n // SAM = single public abstract method\n // if the class is not abstract there is no abstract method\n if (!Modifier.isAbstract(c.getModifiers())) return null;\n if (c.isInterface()) {\n Method[] methods = c.getMethods();\n ... |
Arbitrarily resolve the inconsistency by choosing the first object if
there is one.
@param values The list of objects
@return A single value, if one exists, taken from the input list. | [
"public List<T> resolveConflicts(List<T> values) {\n if(values.size() > 1)\n return values;\n else\n return Collections.singletonList(values.get(0));\n }"
] | [
"public Integer getInteger(String fieldName) {\n\t\ttry {\n\t\t\treturn hasValue(fieldName) ? Integer.valueOf(String.valueOf(resultMap.get(fieldName))) : null;\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new FqlException(\"Field '\" + fieldName +\"' is not a number.\", e);\n\t\t}\n\t}",
"public static b... |
Return all tenors for which data exists.
@return The tenors in months. | [
"public int[] getTenors() {\r\n\t\tSet<Integer> setTenors\t= new HashSet<>();\r\n\r\n\t\tfor(int moneyness : getGridNodesPerMoneyness().keySet()) {\r\n\t\t\tsetTenors.addAll(Arrays.asList((IntStream.of(keyMap.get(moneyness)[1]).boxed().toArray(Integer[]::new))));\r\n\t\t}\r\n\t\treturn setTenors.stream().sorted().m... | [
"public Method getMethod(Method method) {\n return getMethod(method.getReturnType(), method.getName(), method.getParameterTypes());\n }",
"void forcedUndeployScan() {\n\n if (acquireScanLock()) {\n try {\n ROOT_LOGGER.tracef(\"Performing a post-boot forced undeploy scan ... |
Append the html-code to finish a html mail message to the given buffer.
@param buffer The StringBuffer to add the html code to. | [
"protected void appenHtmlFooter(StringBuffer buffer) {\n\n if (m_configuredFooter != null) {\n buffer.append(m_configuredFooter);\n } else {\n buffer.append(\" </body>\\r\\n\" + \"</html>\");\n }\n }"
] | [
"public void linkMtoN(Object obj, CollectionDescriptor cod, boolean insert)\n {\n Object referencedObjects = cod.getPersistentField().get(obj);\n storeAndLinkMtoN(true, obj, cod, referencedObjects, insert);\n }",
"public Capsule newCapsule(String mode, Path wrappedJar) {\n final String ... |
Plots the trajectory
@param title Title of the plot
@param t Trajectory to be plotted | [
"public static Chart getTrajectoryChart(String title, Trajectory t){\n\t\tif(t.getDimension()==2){\n\t\t \tdouble[] xData = new double[t.size()];\n\t\t double[] yData = new double[t.size()];\n\t\t for(int i = 0; i < t.size(); i++){\n\t\t \txData[i] = t.get(i).x;\n\t\t \tyData[i] = t.get(i).y;\n\t\t \... | [
"void stop() {\n try {\n dm.stop(getBundleContext());\n } catch (DirectoryMonitoringException e) {\n LOG.error(\"Failed to stop \" + DirectoryMonitor.class.getName() + \" for the directory \" + monitoredDirectory, e);\n }\n declarationsFiles.clear();\n declar... |
Use this API to add nsacl6. | [
"public static base_response add(nitro_service client, nsacl6 resource) throws Exception {\n\t\tnsacl6 addresource = new nsacl6();\n\t\taddresource.acl6name = resource.acl6name;\n\t\taddresource.acl6action = resource.acl6action;\n\t\taddresource.td = resource.td;\n\t\taddresource.srcipv6 = resource.srcipv6;\n\t\tad... | [
"public static Object getFieldValue(Object object, String fieldName) {\n try {\n return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object);\n } catch (IllegalArgumentException e) {\n throw new RuntimeException(e);\n } catch (IllegalAccessException e) {\n... |
Subtract a complex number.
@param z1 Complex Number.
@param scalar Scalar value.
@return Returns new ComplexNumber instance containing the subtract of specified complex number with a scalar value. | [
"public static ComplexNumber Subtract(ComplexNumber z1, double scalar) {\r\n return new ComplexNumber(z1.real - scalar, z1.imaginary);\r\n }"
] | [
"private Table getTable(String name)\n {\n Table table = m_tables.get(name);\n if (table == null)\n {\n table = EMPTY_TABLE;\n }\n return table;\n }",
"public static appfwjsoncontenttype[] get(nitro_service service, options option) throws Exception{\n\t\tappfwjsoncontenttype o... |
Return true if the expression is a constructor call on any of the named classes, with any number of parameters.
@param expression - the expression
@param classNames - the possible List of class names
@return as described | [
"public static boolean isConstructorCall(Expression expression, List<String> classNames) {\r\n return expression instanceof ConstructorCallExpression && classNames.contains(expression.getType().getName());\r\n }"
] | [
"public final void setOrientation(int orientation) {\n mOrientation = orientation;\n mOrientationState = getOrientationStateFromParam(mOrientation);\n invalidate();\n if (mOuterAdapter != null) {\n mOuterAdapter.setOrientation(mOrientation);\n }\n\n }",
"public boo... |
Process the graphical indicator criteria for a single column.
@param type field type
@return indicator criteria data | [
"private GraphicalIndicatorCriteria processCriteria(FieldType type)\n {\n GraphicalIndicatorCriteria criteria = new GraphicalIndicatorCriteria(m_properties);\n criteria.setLeftValue(type);\n\n int indicatorType = MPPUtility.getInt(m_data, m_dataOffset);\n m_dataOffset += 4;\n criteria.set... | [
"public void register(Delta delta) {\n\t\tfinal IResourceDescription newDesc = delta.getNew();\n\t\tif (newDesc == null) {\n\t\t\tremoveDescription(delta.getUri());\n\t\t} else {\n\t\t\taddDescription(delta.getUri(), newDesc);\n\t\t}\n\t}",
"private String getCachedETag(HttpHost host, String file) {\n Map<... |
Makes a DocumentReaderAndWriter based on
flags.plainTextReaderAndWriter. Useful for reading in
untokenized text documents or reading plain text from the command
line. An example of a way to use this would be to return a
edu.stanford.nlp.wordseg.Sighan2005DocumentReaderAndWriter for
the Chinese Segmenter. | [
"public DocumentReaderAndWriter<IN> makePlainTextReaderAndWriter() {\r\n String readerClassName = flags.plainTextDocumentReaderAndWriter;\r\n // We set this default here if needed because there may be models\r\n // which don't have the reader flag set\r\n if (readerClassName == null) {\r\n readerCl... | [
"public ServerRedirect addServerMapping(String sourceHost, String destinationHost, String hostHeader) {\n JSONObject response = null;\n\n ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();\n params.add(new BasicNameValuePair(\"srcUrl\", sourceHost));\n params.add... |
Ensures that the primary keys required by the given reference are present in the referenced class.
@param modelDef The model
@param refDef The reference
@throws ConstraintException If there is a conflict between the primary keys | [
"private void ensureReferencedPKs(ModelDef modelDef, ReferenceDescriptorDef refDef) throws ConstraintException\r\n {\r\n String targetClassName = refDef.getProperty(PropertyHelper.OJB_PROPERTY_CLASS_REF);\r\n ClassDescriptorDef targetClassDef = modelDef.getClass(targetClassName);\r\n\r... | [
"public static boolean checkDuplicateElements(DMatrixSparseCSC A ) {\n A = A.copy(); // create a copy so that it doesn't modify A\n A.sortIndices(null);\n return !checkSortedFlag(A);\n }",
"private List<DomainControllerData> readFromFile(String directoryName) {\n List<DomainControll... |
Prints some basic documentation about this program. | [
"public static void printDocumentation() {\n\t\tSystem.out\n\t\t\t\t.println(\"********************************************************************\");\n\t\tSystem.out.println(\"*** Wikidata Toolkit: GenderRatioProcessor\");\n\t\tSystem.out.println(\"*** \");\n\t\tSystem.out\n\t\t\t\t.println(\"*** This program wil... | [
"private static <D, T> D createDaoFromConfig(ConnectionSource connectionSource, Class<T> clazz) throws SQLException {\n\t\t// no loaded configs\n\t\tif (configMap == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tDatabaseTableConfig<T> config = (DatabaseTableConfig<T>) configMap.get... |
Creates the server setup, depending on the protocol flags.
@return the configured server setups. | [
"private ServerSetup[] createServerSetup() {\n List<ServerSetup> setups = new ArrayList<>();\n if (smtpProtocol) {\n smtpServerSetup = createTestServerSetup(ServerSetup.SMTP);\n setups.add(smtpServerSetup);\n }\n if (smtpsProtocol) {\n smtpsServerSetup = ... | [
"public static FileOutputStream openResultFileOuputStream(\n\t\t\tPath resultDirectory, String filename) throws IOException {\n\t\tPath filePath = resultDirectory.resolve(filename);\n\t\treturn new FileOutputStream(filePath.toFile());\n\t}",
"private int slopSize(Versioned<Slop> slopVersioned) {\n int nByt... |
Takes a model and an SCXMLFrontier and decomposes the Frontier into a Map of Strings to Strings
These strings can be sent over a network to get a Frontier past a 'gap'
@param frontier the Frontier
@param modelText the model
@return the map of strings representing a decomposition | [
"public Map<String, String> decompose(Frontier frontier, String modelText) {\r\n if (!(frontier instanceof SCXMLFrontier)) {\r\n return null;\r\n }\n\r\n TransitionTarget target = ((SCXMLFrontier) frontier).getRoot().nextState;\r\n Map<String, String> variables = ((SCXMLFronti... | [
"public void pause(ServerActivityCallback requestCountListener) {\n if (paused) {\n throw ServerLogger.ROOT_LOGGER.serverAlreadyPaused();\n }\n this.paused = true;\n listenerUpdater.set(this, requestCountListener);\n if (activeRequestCountUpdater.get(this) == 0) {\n ... |
In case we cannot delete a directory create a marker to recheck whether we can garbage collect some not
referenced directories and files.
@param file the directory | [
"protected void failedToCleanupDir(final File file) {\n checkForGarbageOnRestart = true;\n PatchLogger.ROOT_LOGGER.cannotDeleteFile(file.getAbsolutePath());\n }"
] | [
"public GroovyMethodDoc[] methods() {\n Collections.sort(methods);\n return methods.toArray(new GroovyMethodDoc[methods.size()]);\n }",
"public boolean hasValue(String fieldName) {\n\t\treturn resultMap.containsKey(fieldName) && resultMap.get(fieldName) != null;\n\t}",
"protected void processTu... |
Checks if a property's type is valid to be included in the report.
@param _property the property.
@return true if the property is is of a valid type. | [
"private static boolean isValidPropertyClass(final PropertyDescriptor _property) {\n final Class type = _property.getPropertyType();\n return Number.class.isAssignableFrom(type) || type == String.class || Date.class.isAssignableFrom(type) || type == Boolean.class;\n }"
] | [
"public static String getStateKey(CmsResourceState state) {\n\n StringBuffer sb = new StringBuffer(STATE_PREFIX);\n sb.append(state);\n sb.append(STATE_POSTFIX);\n return sb.toString();\n\n }",
"public static base_response add(nitro_service client, sslcipher resource) throws Excepti... |
Delete a file ignoring failures.
@param file file to delete | [
"public static final void deleteQuietly(File file)\n {\n if (file != null)\n {\n if (file.isDirectory())\n {\n File[] children = file.listFiles();\n if (children != null)\n {\n for (File child : children)\n {\n ... | [
"private Bpmn2Resource unmarshall(JsonParser parser,\n String preProcessingData) throws IOException {\n try {\n parser.nextToken(); // open the object\n ResourceSet rSet = new ResourceSetImpl();\n rSet.getResourceFactoryRegistry().getExtens... |
Binds a script bundle to a scene.
@param scriptBundle
The {@code GVRScriptBundle} object containing script binding information.
@param scene
The scene to bind to.
@throws IOException if script bundle file cannot be read.
@throws GVRScriptException if script processing error occurs. | [
"public void bindScriptBundleToScene(GVRScriptBundle scriptBundle, GVRScene scene) throws IOException, GVRScriptException {\n for (GVRSceneObject sceneObject : scene.getSceneObjects()) {\n bindBundleToSceneObject(scriptBundle, sceneObject);\n }\n }"
] | [
"public static boolean isLogDownloadAvailable(CliGuiContext cliGuiCtx) {\n ModelNode readOps = null;\n try {\n readOps = cliGuiCtx.getExecutor().doCommand(\"/subsystem=logging:read-children-types\");\n } catch (CommandFormatException | IOException e) {\n return false;\n ... |
Delete a database for a given path and userId.
@param appInfo the info for this application
@param serviceName the name of the associated service
@param clientFactory the associated factory that creates clients
@param userId the id of the user's to delete
@return true if successfully deleted, false if not | [
"public static boolean deleteDatabase(final StitchAppClientInfo appInfo,\n final String serviceName,\n final EmbeddedMongoClientFactory clientFactory,\n final String userId) {\n final String dataDir ... | [
"private static boolean isAssignableFrom(Type from, GenericArrayType to) {\n\t\tType toGenericComponentType = to.getGenericComponentType();\n\t\tif (toGenericComponentType instanceof ParameterizedType) {\n\t\t\tType t = from;\n\t\t\tif (from instanceof GenericArrayType) {\n\t\t\t\tt = ((GenericArrayType) from).getG... |
Use this API to change responderhtmlpage. | [
"public static base_response change(nitro_service client, responderhtmlpage resource) throws Exception {\n\t\tresponderhtmlpage updateresource = new responderhtmlpage();\n\t\tupdateresource.name = resource.name;\n\t\treturn updateresource.perform_operation(client,\"update\");\n\t}"
] | [
"public void setTimewarpInt(String timewarp) {\n\n try {\n m_userSettings.setTimeWarp(Long.valueOf(timewarp).longValue());\n } catch (Exception e) {\n m_userSettings.setTimeWarp(-1);\n }\n }",
"public static String encodeHost(String host, String encoding) throws Unsup... |
Reads, stems, and prints the trees in the file.
@param args Usage: WordStemmer file | [
"public static void main(String[] args) {\r\n Treebank treebank = new DiskTreebank();\r\n treebank.loadPath(args[0]);\r\n WordStemmer ls = new WordStemmer();\r\n for (Tree tree : treebank) {\r\n ls.visitTree(tree);\r\n System.out.println(tree);\r\n }\r\n }"
] | [
"private List<T> computePagedList(List<T> result, HeaderAndBody httpResponse, JSONObject where, Pipe<T> requestingPipe) {\n ReadFilter previousRead = null;\n ReadFilter nextRead = null;\n\n if (PageConfig.MetadataLocations.WEB_LINKING.equals(pageConfig.getMetadataLocation())) {\n Str... |
Leave a group.
@see <a href="http://www.flickr.com/services/api/flickr.groups.leave.html">lickr.groups.leave</a> for a description of the various behaviors possible
when a user leaves a group.
@param groupId
- the id of the group to leave
@param deletePhotos
- delete photos by this user from group | [
"public void leave(String groupId, Boolean deletePhotos) throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_LEAVE);\r\n parameters.put(\"group_id\", groupId);\r\n parameters.put(\"delete_photos\", deletePhoto... | [
"public static linkset get(nitro_service service, String id) throws Exception{\n\t\tlinkset obj = new linkset();\n\t\tobj.set_id(id);\n\t\tlinkset response = (linkset) obj.get_resource(service);\n\t\treturn response;\n\t}",
"public void addCell(TableLayoutCell cell) {\n GridBagConstraints constraints = cel... |
Locates a task within a child task container which matches the supplied UUID.
@param parent child task container
@param uuid required UUID
@return Task instance or null if the task is not found | [
"private Task findChildTaskByUUID(ChildTaskContainer parent, UUID uuid)\n {\n Task result = null;\n\n for (Task task : parent.getChildTasks())\n {\n if (uuid.equals(task.getGUID()))\n {\n result = task;\n break;\n }\n }\n\n return result;\n ... | [
"public synchronized boolean undoRoleMappingRemove(final Object removalKey) {\n HashMap<String, RoleMappingImpl> newRoles = new HashMap<String, RoleMappingImpl>(roleMappings);\n RoleMappingImpl toRestore = removedRoles.remove(removalKey);\n if (toRestore != null && newRoles.containsKey(toRestor... |
Get info for a given topic
@param topicId
Unique identifier of a topic for a given group {@link Topic}.
@return A group topic
@throws FlickrException
@see <a href="http://www.flickr.com/services/api/flickr.groups.discuss.topics.getInfo.html">API Documentation</a> | [
"public Topic getTopicInfo(String topicId) throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_TOPICS_GET_INFO);\r\n parameters.put(\"topic_id\", topicId);\r\n\r\n Response response = transportAPI.get(transpor... | [
"private String resolveExpressionString(final String unresolvedString) throws OperationFailedException {\n\n // parseAndResolve should only be providing expressions with no leading or trailing chars\n assert unresolvedString.startsWith(\"${\") && unresolvedString.endsWith(\"}\");\n\n // Default... |
Get a property as a string or throw an exception.
@param key the property name | [
"@Override\n public final String getString(final String key) {\n String result = optString(key);\n if (result == null) {\n throw new ObjectMissingException(this, key);\n }\n return result;\n }"
] | [
"private void harvestReturnValues(\r\n ProcedureDescriptor proc,\r\n Object obj,\r\n PreparedStatement stmt)\r\n throws PersistenceBrokerSQLException\r\n {\r\n // If the procedure descriptor is null or has no return values or\r\n // if the statement is not a callable sta... |
Scan all the class path and look for all classes that have the Format
Annotations. | [
"public static void scanClassPathForFormattingAnnotations() {\n\n\t\tExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 2);\n\n\t\t// scan classpath and filter out classes that don't begin with \"com.nds\"\n\t\tReflections reflections = new Reflections(\"com.... | [
"public Stats getPhotostreamStats(Date date) throws FlickrException {\n return getStats(METHOD_GET_PHOTOSTREAM_STATS, null, null, date);\n }",
"public static JRDesignExpression getReportConnectionExpression() {\n JRDesignExpression connectionExpression = new JRDesignExpression();\n connect... |
Creates a ServiceCall from a paging operation.
@param first the observable to the first page
@param next the observable to poll subsequent pages
@param callback the client-side callback
@param <E> the element type
@return the future based ServiceCall | [
"public static <E> ServiceFuture<List<E>> fromPageResponse(Observable<ServiceResponse<Page<E>>> first, final Func1<String, Observable<ServiceResponse<Page<E>>>> next, final ListOperationCallback<E> callback) {\n final AzureServiceFuture<List<E>> serviceCall = new AzureServiceFuture<>();\n final Paging... | [
"public void setBody(String body) {\n byte[] bytes = body.getBytes(StandardCharsets.UTF_8);\n this.bodyLength = bytes.length;\n this.body = new ByteArrayInputStream(bytes);\n }",
"private void populateCurrencySettings(Record record, ProjectProperties properties)\n {\n properties.set... |
Adds a new child widget to the panel, attaching its Element to the
specified container Element.
@param child the child widget to be added
@param container the element within which the child will be contained | [
"protected void add(Widget child, Element container) {\n\n // Detach new child.\n child.removeFromParent();\n\n // Logical attach.\n getChildren().add(child);\n\n // Physical attach.\n DOM.appendChild(container, child.getElement());\n\n // Adopt.\n adopt(child... | [
"public static DMatrixSparseTriplet uniform(int numRows , int numCols , int nz_total ,\n double min , double max , Random rand ) {\n // Create a list of all the possible element values\n int N = numCols*numRows;\n if( N < 0 )\n throw new ... |
This method reads a two byte integer from the input stream.
@param is the input stream
@return integer value
@throws IOException on file read error or EOF | [
"protected int readShort(InputStream is) throws IOException\n {\n byte[] data = new byte[2];\n if (is.read(data) != data.length)\n {\n throw new EOFException();\n }\n\n return (MPPUtility.getShort(data, 0));\n }"
] | [
"public int getPartition(byte[] key,\n byte[] value,\n int numReduceTasks) {\n try {\n /**\n * {@link partitionId} is the Voldemort primary partition that this\n * record belongs to.\n */\n int par... |
Checks if ranges contain the uid
@param idRanges the id ranges
@param uid the uid
@return true, if ranges contain given uid | [
"public static boolean containsUid(IdRange[] idRanges, long uid) {\r\n if (null != idRanges && idRanges.length > 0) {\r\n for (IdRange range : idRanges) {\r\n if (range.includes(uid)) {\r\n return true;\r\n }\r\n }\r\n }\r\n ... | [
"private void merge(Integer cid1, Integer cid2) {\n Collection<String> klass1 = classix.get(cid1);\n Collection<String> klass2 = classix.get(cid2);\n\n // if klass1 is the smaller, swap the two\n if (klass1.size() < klass2.size()) {\n Collection<String> tmp = klass2;\n klass2 = klass1;\n ... |
Returns the number of key-value mappings in this map for the third key.
@param firstKey
the first key
@param secondKey
the second key
@return Returns the number of key-value mappings in this map for the third key. | [
"public int size(final K1 firstKey, final K2 secondKey) {\n\t\t// existence check on inner map\n\t\tfinal HashMap<K2, HashMap<K3, V>> innerMap1 = map.get(firstKey);\n\t\tif( innerMap1 == null ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t// existence check on inner map1\n\t\tfinal HashMap<K3, V> innerMap2 = innerMap1.get(... | [
"public static String replaceParameters(final InputStream stream) {\n String content = IOUtil.asStringPreservingNewLines(stream);\n return resolvePlaceholders(content);\n }",
"public static dnstxtrec[] get(nitro_service service, dnstxtrec_args args) throws Exception{\n\t\tdnstxtrec obj = new dnst... |
If X == null then the solution is written into B. Otherwise the solution is copied
from B into X. | [
"@Override\n public void solve(DMatrixRBlock B, DMatrixRBlock X) {\n if( B.blockLength != blockLength )\n throw new IllegalArgumentException(\"Unexpected blocklength in B.\");\n\n DSubmatrixD1 L = new DSubmatrixD1(decomposer.getT(null));\n\n if( X != null ) {\n if( X.bl... | [
"public void addControllerType(GVRControllerType controllerType)\n {\n if (cursorControllerTypes == null)\n {\n cursorControllerTypes = new ArrayList<GVRControllerType>();\n }\n else if (cursorControllerTypes.contains(controllerType))\n {\n return;\n ... |
Detect if the given object has a PK field represents a 'null' value. | [
"public boolean hasNullPKField(ClassDescriptor cld, Object obj)\r\n {\r\n FieldDescriptor[] fields = cld.getPkFields();\r\n boolean hasNull = false;\r\n // an unmaterialized proxy object can never have nullified PK's\r\n IndirectionHandler handler = ProxyHelper.getIndirectionHandler(o... | [
"private void createTimephasedData(ProjectFile file, ResourceAssignment assignment, List<TimephasedWork> timephasedPlanned, List<TimephasedWork> timephasedComplete)\n {\n if (timephasedPlanned.isEmpty() && timephasedComplete.isEmpty())\n {\n Duration totalMinutes = assignment.getWork().convertUn... |
List details of all calendars in the file.
@param file ProjectFile instance | [
"private static void listCalendars(ProjectFile file)\n {\n for (ProjectCalendar cal : file.getCalendars())\n {\n System.out.println(cal.toString());\n }\n }"
] | [
"public Metadata add(String path, List<String> values) {\n JsonArray arr = new JsonArray();\n for (String value : values) {\n arr.add(value);\n }\n this.values.add(this.pathToProperty(path), arr);\n this.addOp(\"add\", path, arr);\n return this;\n }",
"priva... |
Transfer the ownership of an application to another user.
@param appName App name. See {@link #listApps} for a list of apps that can be used.
@param to Username of the person to transfer the app to. This is usually in the form of "user@company.com". | [
"public void transferApp(String appName, String to) {\n connection.execute(new SharingTransfer(appName, to), apiKey);\n }"
] | [
"private void registerRequirement(RuntimeRequirementRegistration requirement) {\n assert writeLock.isHeldByCurrentThread();\n CapabilityId dependentId = requirement.getDependentId();\n if (!capabilities.containsKey(dependentId)) {\n throw ControllerLogger.MGMT_OP_LOGGER.unknownCapabi... |
Obtain override ID
@param overrideIdentifier can be the override ID or class name
@return
@throws Exception | [
"public static Integer convertOverrideIdentifier(String overrideIdentifier) throws Exception {\n Integer overrideId = -1;\n\n try {\n // there is an issue with parseInt where it does not parse negative values correctly\n boolean isNegative = false;\n if (overrideIdenti... | [
"private static boolean matches(Type from, Type to, Map<String, Type> typeMap) {\n\t\tif (to.equals(from))\n\t\t\treturn true;\n\n\t\tif (from instanceof TypeVariable) {\n\t\t\treturn to.equals(typeMap.get(((TypeVariable<?>) from).getName()));\n\t\t}\n\n\t\treturn false;\n\t}",
"private static boolean hasSelfPerm... |
Use this API to fetch appfwhtmlerrorpage resource of given name . | [
"public static appfwhtmlerrorpage get(nitro_service service, String name) throws Exception{\n\t\tappfwhtmlerrorpage obj = new appfwhtmlerrorpage();\n\t\tobj.set_name(name);\n\t\tappfwhtmlerrorpage response = (appfwhtmlerrorpage) obj.get_resource(service);\n\t\treturn response;\n\t}"
] | [
"private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,\r\n int length, String action) {\r\n return createRetentionPolicy(api, name, type, length, action, null);\r\n }",
"public void setA... |
Suite end. | [
"private void emitSuiteEnd(AggregatedSuiteResultEvent e, int suitesCompleted) throws IOException {\n assert showSuiteSummary;\n\n final StringBuilder b = new StringBuilder();\n final int totalErrors = this.totalErrors.addAndGet(e.isSuccessful() ? 0 : 1);\n b.append(String.format(Locale.ROOT, \"%sComplet... | [
"public void add(K key, V value) {\r\n if (treatCollectionsAsImmutable) {\r\n Collection<V> newC = cf.newCollection();\r\n Collection<V> c = map.get(key);\r\n if (c != null) {\r\n newC.addAll(c);\r\n }\r\n newC.add(value);\r\n map.put(key, newC); // replacing the old collecti... |
Sets the top padding character for all cells in the row.
@param paddingTopChar new padding character, ignored if null
@return this to allow chaining | [
"public AT_Row setPaddingTopChar(Character paddingTopChar) {\r\n\t\tif(this.hasCells()){\r\n\t\t\tfor(AT_Cell cell : this.getCells()){\r\n\t\t\t\tcell.getContext().setPaddingTopChar(paddingTopChar);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t}"
] | [
"public static Set<Map<String, Object>> setify(ObjectMapper mapper, Object source) {\n return (Set<Map<String, Object>>) collectify(mapper, source, Set.class);\n }",
"public static BoxAPIConnection getTransactionConnection(String accessToken, String scope) {\n return BoxTransactionalAPIConnection... |
Use this context as prototype for a new mutable builder. The new builder is
pre-populated with the current settings of this context instance. | [
"public ContentAssistContext.Builder copy() {\n\t\tBuilder result = builderProvider.get();\n\t\tresult.copyFrom(this);\n\t\treturn result;\n\t}"
] | [
"public static base_responses update(nitro_service client, nsrpcnode resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tnsrpcnode updateresources[] = new nsrpcnode[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\tup... |
Returns a OkHttpClient that ignores SSL cert errors
@return | [
"private static OkHttpClient getUnsafeOkHttpClient() {\n try {\n // Create a trust manager that does not validate certificate chains\n final TrustManager[] trustAllCerts = new TrustManager[] {\n new X509TrustManager() {\n @Override\n ... | [
"public static hanode_routemonitor6_binding[] get(nitro_service service, Long id) throws Exception{\n\t\thanode_routemonitor6_binding obj = new hanode_routemonitor6_binding();\n\t\tobj.set_id(id);\n\t\thanode_routemonitor6_binding response[] = (hanode_routemonitor6_binding[]) obj.get_resources(service);\n\t\treturn... |
Additional bean deployment archives are used for extentions, synthetic annotated types and beans which do not come from a bean archive.
@param beanClass
@return the additional bean deployment archive | [
"protected WeldBeanDeploymentArchive createAdditionalBeanDeploymentArchive() {\n WeldBeanDeploymentArchive additionalBda = new WeldBeanDeploymentArchive(ADDITIONAL_BDA_ID, Collections.synchronizedSet(new HashSet<String>()), null);\n additionalBda.getServices().addAll(getServices().entrySet());\n ... | [
"public BoxAPIResponse send(ProgressListener listener) {\n if (this.api == null) {\n this.backoffCounter.reset(BoxGlobalSettings.getMaxRequestAttempts());\n } else {\n this.backoffCounter.reset(this.api.getMaxRequestAttempts());\n }\n\n while (this.backoffCounter.ge... |
Create the metadata which gets send to the DC when registering.
@param hostInfo the local host info
@param productConfig the product config
@param ignoredResourceRegistry registry of ignored resources
@return the host info | [
"public static ModelNode createLocalHostHostInfo(final LocalHostControllerInfo hostInfo, final ProductConfig productConfig,\n final IgnoredDomainResourceRegistry ignoredResourceRegistry, final Resource hostModelResource) {\n final ModelNode info = new ModelNode();\... | [
"private TableAlias getTableAliasForPath(String aPath, String aUserAlias, List hintClasses)\r\n {\r\n if (aUserAlias == null)\r\n {\r\n return getTableAliasForPath(aPath, hintClasses);\r\n }\r\n else\r\n {\r\n\t\t\treturn getTableAliasForPath(aUserAlias + ALIAS_SEPAR... |
Peeks the current top of the stack or returns null if the stack is empty
@return the current top of the stack or returns null if the stack is empty | [
"public static CombinedInterceptorAndDecoratorStackMethodHandler peekIfNotEmpty() {\n Stack stack = interceptionContexts.get();\n if (stack == null) {\n return null;\n }\n return stack.peek();\n }"
] | [
"public int getBoneIndex(String bonename)\n {\n for (int i = 0; i < getNumBones(); ++i)\n\n if (mBoneNames[i].equals(bonename))\n return i;\n return -1;\n }",
"public Set<ConstraintViolation> validate() {\r\n\t\tSet<ConstraintViolation> errors = new LinkedHashSet<Cons... |
Clear history for a client
@param profileId ID of profile
@param clientUUID UUID of client | [
"public void clearHistory(int profileId, String clientUUID) {\n PreparedStatement query = null;\n\n try (Connection sqlConnection = sqlService.getConnection()) {\n String sqlQuery = \"DELETE FROM \" + Constants.DB_TABLE_HISTORY + \" \";\n\n // see if profileId is null or not (-1)... | [
"public void useNewRESTServiceWithOldClient() throws Exception {\n List<Object> providers = createJAXRSProviders();\n\n com.example.customerservice.CustomerService customerService = JAXRSClientFactory\n .createFromModel(\"http://localhost:\" + port + \"/examples/direct/new-rest\", \n ... |
Creates an object instance from the Scala class name
@param className the Scala class name
@return An Object instance | [
"public Object newInstance(String className) {\n try {\n return classLoader.loadClass(className).newInstance();\n } catch (Exception e) {\n throw new ScalaInstanceNotFound(className);\n }\n }"
] | [
"public RedwoodConfiguration loggingClass(final Class<?> classToIgnoreInTraces){\r\n tasks.add(new Runnable() { public void run() { Redwood.addLoggingClass(classToIgnoreInTraces.getName()); } });\r\n return this;\r\n }",
"void handleFacebookError(HttpStatus statusCode, FacebookError error) {\n\t\tif (error... |
returns the abstract method from a SAM type, if it is a SAM type.
@param c the SAM class
@return null if nothing was found, the method otherwise | [
"public static Method getSAMMethod(Class<?> c) {\n // SAM = single public abstract method\n // if the class is not abstract there is no abstract method\n if (!Modifier.isAbstract(c.getModifiers())) return null;\n if (c.isInterface()) {\n Method[] methods = c.getMethods();\n ... | [
"private void computeUnnamedParams() {\n unnamedParams.addAll(rawArgs.stream().filter(arg -> !isNamedParam(arg)).collect(Collectors.toList()));\n }",
"public List<TimephasedCost> getTimephasedActualCost()\n {\n if (m_timephasedActualCost == null)\n {\n Resource r = getResource();\n ... |
Generates and writes the sql for inserting the currently contained data objects.
@param model The database model
@param platform The platform
@param writer The output stream | [
"public void createInsertionSql(Database model, Platform platform, Writer writer) throws IOException\r\n {\r\n for (Iterator it = _beans.iterator(); it.hasNext();)\r\n {\r\n writer.write(platform.getInsertSql(model, (DynaBean)it.next()));\r\n if (it.hasNext())\r\n {... | [
"private void setExpressionForPrecalculatedTotalValue(\n\t\t\tDJCrosstabColumn[] auxCols, DJCrosstabRow[] auxRows, JRDesignExpression measureExp, DJCrosstabMeasure djmeasure,\n\t\t\tDJCrosstabColumn crosstabColumn, DJCrosstabRow crosstabRow, String meausrePrefix) {\n\n\t\tString rowValuesExp = \"new Object[]{\";\n\... |
Retrieves list of inbox messages based on given userId
@param userId String userid
@return ArrayList of {@link CTMessageDAO} | [
"synchronized ArrayList<CTMessageDAO> getMessages(String userId){\n final String tName = Table.INBOX_MESSAGES.getName();\n Cursor cursor;\n ArrayList<CTMessageDAO> messageDAOArrayList = new ArrayList<>();\n try{\n final SQLiteDatabase db = dbHelper.getWritableDatabase();\n ... | [
"private static void writeToLog(Logger logger, Level level, String pattern, Exception exception) {\n if (level == Level.ERROR) {\n logger.error(pattern, exception);\n } else if (level == Level.INFO) {\n logger.info(pattern);\n } else if (level == Level.DEBUG) {\n logger.debug(pattern);\n ... |
Print rate.
@param rate Rate instance
@return rate value | [
"public static final BigDecimal printRate(Rate rate)\n {\n BigDecimal result = null;\n if (rate != null && rate.getAmount() != 0)\n {\n result = new BigDecimal(rate.getAmount());\n }\n return result;\n }"
] | [
"public void setInRGB(IntRange inRGB) {\r\n this.inRed = inRGB;\r\n this.inGreen = inRGB;\r\n this.inBlue = inRGB;\r\n\r\n CalculateMap(inRGB, outRed, mapRed);\r\n CalculateMap(inRGB, outGreen, mapGreen);\r\n CalculateMap(inRGB, outBlue, mapBlue);\r\n }",
"private List... |
Produces all tuples of size n chosen from a list of variable names
@param variables the list of variable names to make tuples of
@param nWise the size of the desired tuples
@return all tuples of size nWise | [
"public List<Set<String>> makeNWiseTuples(String[] variables, int nWise) {\r\n List<Set<String>> completeTuples = new ArrayList<>();\r\n makeNWiseTuplesHelper(completeTuples, variables, 0, new HashSet<String>(), nWise);\n\r\n return completeTuples;\r\n }"
] | [
"static void tryAutoAttaching(final SlotReference slot) {\n if (!MetadataFinder.getInstance().getMountedMediaSlots().contains(slot)) {\n logger.error(\"Unable to auto-attach cache to empty slot {}\", slot);\n return;\n }\n if (MetadataFinder.getInstance().getMetadataCache(... |
Get the class name without the qualified package name.
@param className the className to get the short name for
@return the class name of the class without the package name
@throws IllegalArgumentException if the className is empty | [
"public static String getShortName(String className) {\n\t\tAssert.hasLength(className, \"Class name must not be empty\");\n\t\tint lastDotIndex = className.lastIndexOf(PACKAGE_SEPARATOR);\n\t\tint nameEndIndex = className.indexOf(CGLIB_CLASS_SEPARATOR);\n\t\tif (nameEndIndex == -1) {\n\t\t\tnameEndIndex = classNam... | [
"public static vpnclientlessaccesspolicy[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{\n\t\tvpnclientlessaccesspolicy obj = new vpnclientlessaccesspolicy();\n\t\toptions option = new options();\n\t\toption.set_filter(filter);\n\t\tvpnclientlessaccesspolicy[] response = (vpnclientless... |
Extract where the destination is reshaped to match the extracted region
@param src The original matrix which is to be copied. Not modified.
@param srcX0 Start column.
@param srcX1 Stop column+1.
@param srcY0 Start row.
@param srcY1 Stop row+1.
@param dst Where the submatrix are stored. Modified. | [
"public static void extract( DMatrix src,\n int srcY0, int srcY1,\n int srcX0, int srcX1,\n DMatrix dst ) {\n ((ReshapeMatrix)dst).reshape(srcY1-srcY0,srcX1-srcX0);\n extract(src,srcY0,srcY1,srcX0,srcX1,dst,0,... | [
"public static ModelMBean createModelMBean(Object o) {\n try {\n ModelMBean mbean = new RequiredModelMBean();\n JmxManaged annotation = o.getClass().getAnnotation(JmxManaged.class);\n String description = annotation == null ? \"\" : annotation.description();\n Mode... |
Returns the u component of a coordinate from a texture coordinate set.
@param vertex the vertex index
@param coords the texture coordinate set
@return the u component | [
"public float getTexCoordU(int vertex, int coords) {\n if (!hasTexCoords(coords)) {\n throw new IllegalStateException(\n \"mesh has no texture coordinate set \" + coords);\n }\n \n checkVertexIndexBounds(vertex);\n /* bound checks for coords are done ... | [
"private boolean compareBytes(byte[] lhs, byte[] rhs, int rhsOffset)\n {\n boolean result = true;\n for (int loop = 0; loop < lhs.length; loop++)\n {\n if (lhs[loop] != rhs[rhsOffset + loop])\n {\n result = false;\n break;\n }\n }\n return (re... |
Set an enterprise text value.
@param index text index (1-40)
@param value text value | [
"public void setEnterpriseText(int index, String value)\n {\n set(selectField(AssignmentFieldLists.ENTERPRISE_TEXT, index), value);\n }"
] | [
"@Override\n protected void addBuildInfoProperties(BuildInfoBuilder builder) {\n if (envVars != null) {\n for (Map.Entry<String, String> entry : envVars.entrySet()) {\n builder.addProperty(BuildInfoProperties.BUILD_INFO_ENVIRONMENT_PREFIX + entry.getKey(), entry.getValue());\n ... |
Checks the available space and sets max-height to the details field-set. | [
"private void onShow() {\n\n if (m_detailsFieldset != null) {\n m_detailsFieldset.getContentPanel().getElement().getStyle().setPropertyPx(\n \"maxHeight\",\n getAvailableHeight(m_messageWidget.getOffsetHeight()));\n }\n }"
] | [
"public void convertToDense() {\n switch ( mat.getType() ) {\n case DSCC: {\n DMatrix m = new DMatrixRMaj(mat.getNumRows(), mat.getNumCols());\n ConvertDMatrixStruct.convert((DMatrix) mat, m);\n setMatrix(m);\n } break;\n case FSCC... |
Get the permission information for the specified photo.
This method requires authentication with 'read' permission.
@param photoId
The photo id
@return The Permissions object
@throws FlickrException | [
"public Permissions getPerms(String photoId) throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_GET_PERMS);\r\n\r\n parameters.put(\"photo_id\", photoId);\r\n\r\n Response response = transport.get(transport.g... | [
"protected void mergeSameWork(LinkedList<TimephasedWork> list)\n {\n LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();\n\n TimephasedWork previousAssignment = null;\n for (TimephasedWork assignment : list)\n {\n if (previousAssignment == null)\n {\n ... |
Substitute the variables in the given expression with the
values from the resolver
@param pResolver
@param pExpression | [
"public static String replaceVariables( final VariableResolver pResolver, final String pExpression, final String pOpen, final String pClose ) {\n final char[] open = pOpen.toCharArray();\n final char[] close = pClose.toCharArray();\n\n final StringBuilder out = new StringBuilder();\n Str... | [
"public static<T> Vendor<T> vendor(Callable<T> f) {\n\treturn j.vendor(f);\n }",
"public static String toSafeFileName(String name) {\n int size = name.length();\n StringBuilder builder = new StringBuilder(size * 2);\n for (int i = 0; i < size; i++) {\n char c = name.charAt(i);\n... |
Returns a description String based on the defined command and options.
Useful when printing "help" info etc. | [
"public String printHelp(String commandName) {\n int maxLength = 0;\n int width = 80;\n List<ProcessedOption> opts = getOptions();\n for (ProcessedOption o : opts) {\n if(o.getFormattedLength() > maxLength)\n maxLength = o.getFormattedLength();\n }\n\n ... | [
"public static boolean isDouble(CharSequence self) {\n try {\n Double.valueOf(self.toString().trim());\n return true;\n } catch (NumberFormatException nfe) {\n return false;\n }\n }",
"static DocumentVersionInfo getRemoteVersionInfo(final BsonDocument remot... |
Initializes the components.
@param components the components | [
"private void initComponents(List<CmsSetupComponent> components) {\n\n for (CmsSetupComponent component : components) {\n CheckBox checkbox = new CheckBox();\n checkbox.setValue(component.isChecked());\n checkbox.setCaption(component.getName() + \" - \" + component.getDescrip... | [
"private RowKeyAndTuple createAndPutAssociationRowForInsert(Serializable key, PersistentCollection collection,\n\t\t\tAssociationPersister associationPersister, SharedSessionContractImplementor session, int i, Object entry) {\n\t\tRowKeyBuilder rowKeyBuilder = initializeRowKeyBuilder();\n\t\tTuple associationRow = ... |
Don't use input, it's match values might have been reset in the
loop that looks for the first possible match.
@param pairIndex TODO
@param result TODO
@return TODO | [
"protected ExpectState prepareClosure(int pairIndex, MatchResult result) {\n /* TODO: potentially remove this?\n {\n System.out.println( \"Begin: \" + result.beginOffset(0) );\n System.out.println( \"Length: \" + result.length() );\n System.out.println( \"Current: \" +... | [
"@Override\n public CopticDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {\n return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);\n }",
"public String getRemoteUrl(String defaultRemoteUrl) {\n if (StringUtils.isBlank(defaultRemoteUrl)) {\n RemoteConfig remoteConfig... |
Converts a date to an instance date bean.
@return the instance date bean. | [
"public CmsJspInstanceDateBean getToInstanceDate() {\n\n if (m_instanceDate == null) {\n m_instanceDate = new CmsJspInstanceDateBean(getToDate(), m_cms.getRequestContext().getLocale());\n }\n return m_instanceDate;\n }"
] | [
"public int color(Context ctx) {\n if (mColorInt == 0 && mColorRes != -1) {\n mColorInt = ContextCompat.getColor(ctx, mColorRes);\n }\n return mColorInt;\n }",
"I_CmsSerialDateServiceAsync getService() {\r\n\r\n if (SERVICE == null) {\r\n SERVICE = GWT.create(I... |
To be used with AutoText class constants ALIGMENT_LEFT, ALIGMENT_CENTER and ALIGMENT_RIGHT
@param aligment
@return | [
"public static HorizontalBandAlignment buildAligment(byte aligment){\n\t\tif (aligment == RIGHT.getAlignment())\n\t\t\treturn RIGHT;\n\t\telse if (aligment == LEFT.getAlignment())\n\t\t\treturn LEFT;\n\t\telse if (aligment == CENTER.getAlignment())\n\t\t\treturn CENTER;\n\n\t\treturn LEFT;\n\t}"
] | [
"public void setDatesWithCheckState(Collection<CmsPair<Date, Boolean>> datesWithCheckInfo) {\n\n SortedSet<Date> dates = new TreeSet<>();\n m_checkBoxes.clear();\n for (CmsPair<Date, Boolean> p : datesWithCheckInfo) {\n addCheckBox(p.getFirst(), p.getSecond().booleanValue());\n ... |
Implement the persistence handler for storing the group properties. | [
"void persist(final String key, final String value, final boolean enableDisableMode, final boolean disable, final File file) throws IOException, StartException {\n persist(key, value, enableDisableMode, disable, file, null);\n }"
] | [
"public void setColorRange(int firstIndex, int lastIndex, int color) {\n\t\tfor (int i = firstIndex; i <= lastIndex; i++)\n\t\t\tmap[i] = color;\n\t}",
"private List<Key> getScatterKeys(\n int numSplits, Query query, PartitionId partition, Datastore datastore)\n throws DatastoreException {\n Query.Bu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.