code
stringlengths
10
174k
nl
stringlengths
3
129k
public int addOrderTerm(String termTypeId,BigDecimal termValue,Long termDays){ return addOrderTerm(termTypeId,termValue,termDays,null); }
Add an orderTerm to the order
protected void scanMethods(ClassFile cf){ List<?> methods=cf.getMethods(); if (methods == null) { return; } for ( Object obj : methods) { MethodInfo method=(MethodInfo)obj; if (scanMethodAnnotations) { AnnotationsAttribute visible=(AnnotationsAttribute)method.getAttribute(AnnotationsAttribute...
Scanns both the method and its parameters for annotations.
public Fountain(){ super(); }
Needed by CGLib
public static Settings init(String tag){ return printer.init(tag); }
It is used to change the tag
protected void systemsMenu(JMenuBar menuBar,WindowInterface wi){ ActiveSystemsMenu.addItems(menuBar); }
Show only active systems in the menu bar. <p> Alternately, you might want to use <code>menuBar.add(new jmri.jmrix.SystemsMenu());</code>
public void considerRegionXRegion(GeoRegion r,GeoRegion region){ GeoArray rBoundary=r.getPoints(); Geo rPoint=rBoundary.get(0,new Geo()); GeoArray regionBoundary=region.getPoints(); Geo regionPoint=regionBoundary.get(0,new Geo()); if (Intersection.isPointInPolygon(rPoint,regionBoundary) || Intersection.isPoin...
Puts the region in the Collector if r intersects with it.
@SuppressWarnings({"unchecked","rawtypes"}) public static int selectPivotIndex(Object ar[],int left,int right,Comparator comparator){ int midIndex=(left + right) / 2; int lowIndex=left; if (comparator.compare(ar[lowIndex],ar[midIndex]) >= 0) { lowIndex=midIndex; midIndex=left; } if (comparator.compare...
Select an appropriate pivot within the [left, right] range. For now, pick 'middle' of three values [left, mid, right]
protected CDFTsr(CDFTsr parent,int dataOffset,int dataStride,int transformOffset,int m){ c=parent.c; c3=parent.c3; s=parent.s; s3=parent.s3; this.m=m; N=1 << m; N8=N / 8; N4=N / 4; this.xoffset=dataOffset; this.xstride=dataStride; this.Xoffset=transformOffset; f=c.length / N8; reflect=2 * c.le...
Instantiates a new CDFTsr - called by a parent CDFTsr.
@NotNull public LineWrapPositionStrategy forEditor(@NotNull Editor editor){ LineWrapPositionStrategy result=getDefaultImplementation(); Project project=editor.getProject(); if (project != null && !project.isDisposed()) { PsiFile psiFile=PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());...
Asks to get wrap position strategy to use for the document managed by the given editor.
public Instances pruneToK(Instances neighbours,double[] distances,int k){ if (neighbours == null || distances == null || neighbours.numInstances() == 0) { return null; } if (k < 1) { k=1; } int currentK=0; double currentDist; for (int i=0; i < neighbours.numInstances(); i++) { currentK++; ...
Prunes the list to contain the k nearest neighbors. If there are multiple neighbors at the k'th distance, all will be kept.
@Override public void addParameter(String type,Map<String,Object> processVariables,String uuidElement,Map<String,String> emailParameter) throws MissingParameterException { CnATreeElement element=getRemindService().retrieveElement(uuidElement,RetrieveInfo.getPropertyInstance()); if (element == null) { throw new ...
Param uuidElement is always null for this email handler. (non-Javadoc)
private static int readTypeid(final BufferedReader in) throws IOException { final String line=in.readLine(); return Integer.parseInt(line.substring(line.lastIndexOf(' ') + 1)); }
Reads a typeid from the specified input.
@Override protected void initData(){ }
Initialize the Activity data
public void addFilePart(String fieldName,File uploadFile,String fileType) throws IOException { log.debug("add file field: " + fieldName + "; file: "+ uploadFile+ "; type: "+ fileType); String fileName=uploadFile.getName(); writer.append("--" + boundary).append(LINE_FEED); writer.append("Content-Disposition: for...
Adds an upload file section to the request. MIME type of the file is explicitly set.
private void replace(String name){ String value=filter.replace(name); if (value == null) { text.append("${"); text.append(name); text.append("}"); } else { text.append(value); } }
This will replace the accumulated for an system variable name with the value of that system variable. If a value does not exist for the variable name, then the name is put into the value so that the value remains unmodified.
public static boolean isEarlierTransaction(MCostDetail cd,int C_AcctSchema_ID,int M_CostType_ID,int M_CostElement_ID,String costingLevel){ MTransaction trx=new MTransaction(cd.getCtx(),cd.getM_Transaction_ID(),cd.get_TrxName()); MCostDetail last_cd=getLastTransaction(trx,C_AcctSchema_ID,M_CostType_ID,M_CostElement_...
Detect if Cost Detail delayed entry
public boolean hasSymbol(){ return hasExtension(Symbol.class); }
Returns whether it has the stock symbol for the position.
public final void init(ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException { factorySpi.engineInit(spec); }
Initializes this factory with a source of provider-specific trust material. <P> In some cases, initialization parameters other than a keystore may be needed by a provider. Users of that particular provider are expected to pass an implementation of the appropriate <CODE>ManagerFactoryParameters</CODE> as defined by the...
public void forceShow(){ forceShow(DEFAULT_WELCOME_SCREEN_REQUEST); }
Always shows the welcome screen
public AList(){ }
Creates an empty list.
public void java_lang_Thread_currentThread(SootMethod method,ReferenceVariable thisVar,ReferenceVariable returnVar,ReferenceVariable params[]){ helper.assignObjectTo(returnVar,Environment.v().getThreadObject()); }
Returns the single variable pointing to all thread objects. This makes our analysis conservative on thread objects. public static native java.lang.Thread currentThread();
public void testAttached() throws Throwable { final ViewAttachTestActivity activity=getActivity(); for (int i=0; i < 20; i++) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); SystemClock.sleep(250); activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);...
Make sure that onAttachedToWindow and onDetachedToWindow is called in the correct order. The ViewAttachTestActivity contains a view that will throw a RuntimeException if onDetachedToWindow and onAttachedToWindow are called in the wrong order. 1. Initiate the activity 2. Perform a series of orientation changes to the ac...
public void writeParameter(String id,int dimension,double value,double lower,double upper,XMLWriter writer){ ArrayList<Attribute.Default> attributes=new ArrayList<Attribute.Default>(); if (id != null && id.length() > 0) { attributes.add(new Attribute.Default<String>(XMLParser.ID,id)); } if (dimension > 1) {...
write a parameter
public static long floorDiv(final long x,final long y){ long r=x / y; if ((x ^ y) < 0 && r * y != x) { r--; } return r; }
Returns the largest long <= dividend/divisor. Unlike "/" operator, which rounds towards 0, this division rounds towards -Infinity (which give different result when the exact result is negative).
public static double MCSCE3fitness(boolean useTrainingData,GEPIndividual ind,double parameters[]){ double bestValueThreshold=parameters[0]; double secondBestValueThreshold; if (parameters.length < 2) secondBestValueThreshold=bestValueThreshold; else secondBestValueThreshold=parameters[1]; double MCSCE=MCSC...
MCSCE3 Simple classification error for multiple chromosome classification problems <br> For each object (example) the expected values of the dependent variables are given by a BINARY vector of length equal to the number of classes (chromosomes). So each row in an example will look like: <br> x1, x2, ... xn, class1, c...
public void check(){ if (sLogger.isActivated()) { sLogger.debug("Check presence service"); } if (!mWatcherInfoSubscriber.isSubscribed()) { if (sLogger.isActivated()) { sLogger.debug("Subscribe manager not yet started for watcher-info"); } if (mWatcherInfoSubscriber.subscribe()) { if (s...
Check the IMS service
@Override public void onDestroy(){ if (ctlr != null) { ctlr.destroy(); } super.onDestroy(); }
Standard lifecycle method, for when the fragment is utterly, ruthlessly destroyed. Passed along to the CameraController, because why should the fragment have all the fun?
public Shape createScrollCap(int x,int y,int w,int h){ path.reset(); path.moveTo(x,y); path.lineTo(x,y + h); path.lineTo(x + w,y + h); addScrollGapPath(x,y,w,h,true); path.closePath(); return path; }
Return a path for a scroll bar cap. This is used when the buttons are placed together at the opposite end of the scroll bar.
public void resetCropOverlayView(){ if (initializedCropWindow) { initCropWindow(mBitmapRect); invalidate(); } }
Resets the crop overlay view.
public final boolean hasDataScheme(String scheme){ return mDataSchemes != null && mDataSchemes.contains(scheme); }
Is the given data scheme included in the filter? Note that if the filter does not include any scheme, false will <em>always</em> be returned.
private void send(String message) throws WebSocketException { if (getReadyState() != ReadyState.OPEN) { messages2send.add(message); return; } try { ws.send(message); } catch ( JavaScriptException e) { throw new WebSocketException(e.getMessage(),e); } }
Transmit text data over WebSocket.
public void onItemPinned(int position){ final DialogFragment dialog=ItemPinnedMessageDialogFragment.newInstance(position); getSupportFragmentManager().beginTransaction().add(dialog,FRAGMENT_TAG_ITEM_PINNED_DIALOG).commit(); }
This method will be called when a list item is pinned
public void addAll(Collection<? extends T> collection){ int pos; synchronized (mLock) { pos=getItemCount(); mObjects.addAll(collection); } if (mNotifyOnChange) notifyItemRangeInserted(pos,collection.size()); }
Adds the specified Collection at the end of the array.
private void updatePaths(){ synchronized (chartData) { for ( ChartValueSeries chartValueSeries : series) { chartValueSeries.getPath().reset(); } drawPaths(); closePaths(); } }
Updates paths. The path needs to be updated any time after the data or the dimensions change.
private void buildDialog(){ buildShell(); buildImage(); buildDescription(); buildLogin(); buildPassword(); if (this.displayRememberPassword) { buildRememberPassword(); } buildButtons(); }
Build the dialog box
@Override public boolean isActive(){ return amIActive; }
Used by the Whitebox GUI to tell if this plugin is still running.
protected void sendFunctionGroup5(){ int data=0x00 | (f28 ? 0x80 : 0) | (f27 ? 0x40 : 0)| (f26 ? 0x20 : 0)| (f25 ? 0x10 : 0)| (f24 ? 0x08 : 0)| (f23 ? 0x04 : 0)| (f22 ? 0x02 : 0)| (f21 ? 0x01 : 0); MrcMessage m=MrcMessage.getSendFunction(6,addressLo,addressHi,data); if (m != null) { tc.sendMrcMessage(m); } ...
Send the message to set the state of functions F21 to F28. MRC Group 6
public boolean isOptional(){ return false; }
<!-- begin-user-doc --> <!-- end-user-doc -->
static private String SHORT_Max(){ short tempValue=Short.MAX_VALUE; return String.valueOf(tempValue); }
Get the max value for a short
public static Instances PSTransformation(Instances D,int L,String cname,int p,int n){ D=new Instances(D); HashMap<LabelSet,Integer> distinctCombinations=PSUtils.countCombinationsSparse(D,L); if (p > 0) MLUtils.pruneCountHashMap(distinctCombinations,p); if (distinctCombinations.size() <= 1 && p > 0) { Syst...
Transform instances into a multi-class representation.
public static void isValidBaseParam(Parameter param,VOPricedParameter voPricedParam) throws ValidationException { ParameterDefinition parameterDefinition=param.getParameterDefinition(); if (parameterDefinition == null || parameterDefinition.getValueType() == ParameterValueType.STRING) { ValidationException ve=n...
Verifies that the parameter is based on a value type that is allowed for priced parameters.
private void nextToken(int start){ fToken=fScanner.previousToken(start - 1,JavaHeuristicScanner.UNBOUND); fPreviousPos=start; fPosition=fScanner.getPosition() + 1; try { fLine=fDocument.getLineOfOffset(fPosition); } catch ( BadLocationException e) { fLine=-1; } }
Reads the next token in backward direction of <code>start</code> from the heuristic scanner and sets the fields <code>fToken, fPreviousPosition</code> and <code>fPosition</code> accordingly.
public MoveStep(MovePath path,MoveStepType type,TreeMap<Integer,Vector<Integer>> targets){ this(path,type); launched=targets; if ((type == MoveStepType.UNLOAD) || (type == MoveStepType.LAUNCH) || (type == MoveStepType.DROP)|| (type == MoveStepType.UNDOCK)) { hasEverUnloaded=true; } else { hasEverUnload...
Create a step with the units to launch or drop.
public void clear(){ resourceCache.clear(); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE,"Cache Cleared"); } }
<p>Empty the cache.</p>
public EmptyStackException(){ }
Constructs a new <code>EmptyStackException</code> with <tt>null</tt> as its error message string.
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:02:44.045 -0500",hash_original_method="5E53006C9FF9FBE366053539294E0761",hash_generated_method="12D474F4EE7FD734B7A6F0F15AC87567") public TestFailure(Test failedTest,Throwable...
Constructs a TestFailure with the given test and exception.
public int nodeCount(){ return nodes == null ? 0 : nodes.size(); }
return the number of nodes in the is way
@Override protected EClass eStaticClass(){ return N4JSPackage.Literals.DOUBLE_LITERAL; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void addTo(EncodedStringValue value){ mPduHeaders.appendEncodedStringValue(value,PduHeaders.TO); }
Add a "To" value.
@SideEffectFree public void entering(@Nullable String sourceClass,@Nullable String sourceMethod,@Nullable Object param1){ throw new RuntimeException(); }
Log a method entry, with one parameter. <p> This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY {0}", log level FINER, and the given sourceMethod, sourceClass, and parameter is logged. <p>
public ImportDeclarationItemProvider(AdapterFactory adapterFactory){ super(adapterFactory); }
This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc -->
public static CertPath genCertPath(int howMany,int startID){ Certificate[] certs=new Certificate[howMany]; for (int i=0; i < howMany; i++) { certs[i]=new TestCertificate(Integer.toString(startID + i)); } return new TestCertPath(certs); }
Generates and returns an instance of TestCertPath.<br> TestCertificate-s included in the CertPath will be uniq (will have different numbers passed to their ctor-s).<br> The second arguments shows which number will have the first Certificate in the CertPath. The second certificate will have (startID+1) number and so on.
public ActivationGroupDesc(String className,String location,MarshalledObject<?> data,Properties overrides,CommandEnvironment cmd){ this.props=overrides; this.env=cmd; this.data=data; this.location=location; this.className=className; }
Specifies an alternate group implementation and execution environment to be used for the group.
public static void main(String[] args) throws Throwable { HasExpiringCertTest test=new HasExpiringCertTest(); test.start(); }
The test signs and verifies a jar that contains entries whose signer certificate will expire within six months (hasExpiringCert). Warning message is expected.
private void emitDocComment(DocComment comment){ if (!comment.isExcluded()) { int type=comment.getType(); if (type == DocComment.PACKAGE) emitPackage(comment); else if (type == DocComment.CLASS || type == DocComment.INTERFACE) emitClass(comment); else if (type >= DocComment.FUNCTION && type ...
Appends a specific comment to the StringBuilder.
public boolean hasAccepts(){ return super.hasElement(Accept.KEY); }
Returns whether it has the accept elements.
public void process(DistributionMessage msg){ process(msg,true); }
Makes note of a reply from a member. If all members have replied, the waiting thread is signaled. This method can be overridden to provide customized functionality, however the overriden method should always invoke <code>super.process()</code>.
protected void updateClearButtonAction(){ clearButton.setEnabled(!textField.getText().equals("")); }
To update the state of the Clear button
public String debugDump(){ stringRepresentation=""; Class<?> myclass=getClass(); sprint(myclass.getName()); sprint("{"); Field[] fields=myclass.getDeclaredFields(); for (int i=0; i < fields.length; i++) { Field f=fields[i]; int modifier=f.getModifiers(); if ((modifier & Modifier.PRIVATE) == Modi...
An introspection based string formatting method. We need this because in this package (although it is an exact duplicate of the one in the superclass) because it needs to access the protected members of the other objects in this class.
public PTQuery_GroupBy Count() throws PTQueryException { PTQuery_GroupBy copy=new PTQuery_GroupBy(this); copy.aggregate.add(new AggVar(null,Agg.COUNT)); return copy; }
Counts the number of tuples in each group
protected void announceSeedsFromReader(BufferedReader reader){ String s; Iterator<String> iter=new RegexLineIterator(new LineReadingIterator(reader),RegexLineIterator.COMMENT_LINE,RegexLineIterator.NONWHITESPACE_ENTRY_TRAILING_COMMENT,RegexLineIterator.ENTRY); while (iter.hasNext()) { s=iter.next(); if (C...
Announce all seeds (and nonseed possible-directive lines) from the given Reader
private static boolean isStackTraceLikelyConflictive(Throwable throwable,Class<? extends Activity> activityClass){ do { StackTraceElement[] stackTrace=throwable.getStackTrace(); for ( StackTraceElement element : stackTrace) { if ((element.getClassName().equals("android.app.ActivityThread") && element...
INTERNAL method that checks if the stack trace that just crashed is conflictive. This is true in the following scenarios: - The application has crashed while initializing (handleBindApplication is in the stack) - The error activity has crashed (activityClass is in the stack)
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:57.981 -0400",hash_original_method="28C4BDB6A5F83B4A2D726F32ED4863B2",hash_generated_method="E32BFE1A45F547A449DD6FA2E38BCE1D") public void checkAndNotify(){ for ( FileAlterationListener listener : listen...
Check whether the file and its chlidren have been created, modified or deleted.
public static void assertUtilityClassWellDefined(final Class<?> classObject) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { assertTrue("class must be final",Modifier.isFinal(classObject.getModifiers())); assertEquals("There must be only one constructor",1,c...
Based on http://stackoverflow.com/a/10872497/3848666
public static void textRight(double x,double y,String s){ offscreen.setFont(font); FontMetrics metrics=offscreen.getFontMetrics(); double xs=scaleX(x); double ys=scaleY(y); int ws=metrics.stringWidth(s); int hs=metrics.getDescent(); offscreen.drawString(s,(float)(xs - ws),(float)(ys + hs)); draw(); }
Write the given text string in the current font, right-aligned at (x, y).
public static String checkProtectedView(HttpServletRequest request,HttpServletResponse response){ HttpSession session=request.getSession(); String viewNameId=RequestHandler.getRequestUri(request.getPathInfo()); GenericValue userLogin=(GenericValue)session.getAttribute("userLogin"); Delegator delegator=(Delegato...
An HTTP WebEvent handler that checks to see if an userLogin should be tarpitted The decision is made in regard of number of hits in last period of time
public void start(){ if (mActivity == null && mFragment == null && mSupportFragment == null) { throw new RuntimeException("You must pass Activity/Fragment by calling withActivity/withFragment/withSupportFragment method"); } if (mRequestCode == null) { throw new RuntimeException("You must pass request code...
Open Material File Picker activity. You should set Activity or Fragment before calling this method
public void visitTryCatchBlock(Label start,Label end,Label handler,String type){ if (mv != null) { mv.visitTryCatchBlock(start,end,handler,type); } }
Visits a try catch block.
@Override public IStriterator append(Iterator iter){ return addFilter(new Appender(iter)); }
append the iteration
public static void main(String[] args){ Locale.setDefault(Locale.US); OsmViewerPlusApp demo=new OsmViewerPlusApp(args); demo.getFrame().readMap(DataResource.getULMFileResource()); demo.showFrame(); }
Start application with program arg <code>-screenwidth=xx</code> (with xx the width in cm) or <code>-screensize=yy</code> (with yy measured diagonally in inch).
public void store(float value){ }
Stores the float value in the memory location pointed to by the current instance.
private ParseTree(List<ParseTreeNode> roots,Map<PhraseChunk,ParseTreeNode> chunkToNode,Map<WordToken,ParseTreeNode> wordToNode){ this.root=new ParseTreeNode(roots); this.chunkToNode=chunkToNode; this.wordToNode=wordToNode; }
Instantiates a new parses the tree.
public MobilityTrace(List<Location> locations){ this.locations=locations; }
Create a new mobility trace using the given list of locations.
private void addParentFimIgnore(FimIgnore initialFimIgnore){ Path directory=context.getAbsoluteCurrentDirectory(); while (false == directory.equals(context.getRepositoryRootDir())) { directory=directory.getParent(); if (directory == null) { break; } FimIgnore fimIgnore=loadFimIgnore(directory)...
If Fim is started from a sub-directory, it loads the parent .fimignore files and merge all the filesToIgnoreInAllDirectories.
public String toString(){ StringBuilder sb=new StringBuilder(); sb.append("================== SourcePackage ======================\n"); sb.append(this.header.toString()); sb.append(String.format("instance_uid = 0x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%n",this.instance_uid[0],this.insta...
A method that returns a string representation of a parsed Source Package object
public static String encodeObject(java.io.Serializable serializableObject){ return encodeObject(serializableObject,NO_OPTIONS); }
Serializes an object and returns the Base64-encoded version of that serialized object. If the object cannot be serialized or there is another error, the method will return <tt>null</tt>. The object is not GZip-compressed before being encoded.
private IJavaElement resolvePackage() throws JavaModelException { char[] signature=fProposal.getDeclarationSignature(); if (signature != null) { String typeName=String.valueOf(signature); typeName=typeName.replace('.',IPath.SEPARATOR); return fJavaProject.findElement(new Path(typeName)); } return nu...
Resolves to a PackageFragment.
public Object runSafely(Catbert.FastStack stack) throws Exception { sage.msg.SystemMessage sm=getSysMsg(stack); if (sm != null) { return sm.getMessageVarNames(); } else return null; }
Returns the names of the variables associated with the specified SystemMessage. Depending upon the type of message; different variables will be assigned that can be used to do further analysis/processing on the message or to guide the user through resolution steps. The actual values can be retrieved with GetSystemMessa...
public synchronized StringBuffer replace(int start,int end,String string){ replace0(start,end,string); return this; }
Replaces the characters in the specified range with the contents of the specified string.
public static void main(String... a) throws Exception { TestBase.createCaller().init().test(); }
Run just this test.
@NonNull public static Animator color(int from,int to,float duration){ return color(from,to,duration,null); }
Animates transition between specified colors
public void visitMultiANewArrayInsn(String desc,int dims){ if (mv != null) { mv.visitMultiANewArrayInsn(desc,dims); } }
Visits a MULTIANEWARRAY instruction.
private void discoverClusterIdentification(StorageSystem vplex,VPlexApiClient client){ try { if (vplex.getVplexAssemblyIdtoClusterId() != null && !vplex.getVplexAssemblyIdtoClusterId().isEmpty()) { return; } List<VPlexClusterInfo> clusterInfoList=client.getClusterInfoLite(); StringMap assemblyId...
Implementation for discovering assembly ID (serial number) to cluster id (0 or 1) mapping used in placement algorithms such as RP and VPLEX.
public AttachTodoExample(){ oredCriteria=new ArrayList<Criteria>(); }
This method was generated by MyBatis Generator. This method corresponds to the database table attach_todo
private boolean checkUserGroupWithPermissionKeys(String label,Set<String> acls){ boolean resourceUsingUserGroup=false; if (CollectionUtils.isEmpty(acls)) { _log.warn("Invalid acls"); return resourceUsingUserGroup; } for ( String acl : acls) { if (StringUtils.isBlank(acl)) { _log.debug("Invali...
Checks whether the given the user group is present in the given acls or role-assignment set.
public void add(int i){ final int removed=buffer[position]; final boolean removedFromBag=frequencies.remove(removed); assert removedFromBag; buffer[position]=i; frequencies.add(i); position+=1; if (position == maxSize) { position=0; } }
Add a new item to this ring buffer, potentially removing the oldest entry from this buffer if it is already full.
private static void uploadConfiguration(){ System.out.println("Uploading configuration..."); service.uploadSolrClusterConfigurationDirectory(SOLR_CLUSTER_ID,CONFIG_NAME,new File(CONFIG_DIRECTORY)).execute(); System.out.println("Uploaded configuration."); }
Upload the collection configuration from the local filesystem. This is a retrieve-and-rank API as solrj does not offer a programmatic API to upload configuration.
public void update(AnActionEvent event){ final Presentation presentation=event.getPresentation(); final DataContext context=event.getDataContext(); final Project project=CommonDataKeys.PROJECT.getData(context); final StructuralSearchPlugin plugin=(project == null) ? null : StructuralSearchPlugin.getInstance(pro...
Updates the state of the action
private static Spanned removeImageSpanObjects(Spanned spanned){ SpannableStringBuilder builder=(SpannableStringBuilder)spanned; Object[] spannedObjects=builder.getSpans(0,builder.length(),Object.class); for (int i=0; i < spannedObjects.length; i++) { if (spannedObjects[i] instanceof ImageSpan) { ImageSp...
Replaces all image objects in a Spannable with nothing Essentially removes them
public EntryStream<K,V> distinctValues(){ return distinct(null); }
Returns a stream consisting of the elements of this stream which have distinct values (according to object equality). <p> For ordered streams, the selection of distinct values is stable (for elements with duplicating values, the element appearing first in the encounter order is preserved.) For unordered streams, no sta...
public boolean onScrollChanged(int scrollY){ boolean isPullingDownNow=scrollY < lastScrollY; latestPullingDown.offer(isPullingDownNow); if (latestPullingDown.size() > PULLING_DOWN_TIME_MAX) { latestPullingDown.poll(); } lastScrollY=scrollY; return getPullingDownTime() >= PULLING_DOWN_TIME_THRESHOLD; }
Call this when scroll changed
public static Element createPayloadPostPart(Element signedPostPart,Element signedElement,Element payloadElement){ if (signedElement == signedPostPart) { return payloadElement; } List<Element> parentElements=new ArrayList<Element>(); List<Integer> parentIndex=new ArrayList<Integer>(); Node theParent=signed...
Returns a clone of the signedPostPart Element but instead of the decendant-or-self signedElement, the payloadElement is placed.
protected AugmentedNode<K> construct(K key,K value,AugmentedNode<K> parent){ return new AugmentedNode<K>(key,value,parent); }
Construct a node in the tree. Subclass extensions of BalancedTree must override this method to insert the appropriate node of the appropriate subclass.
private void clipImage(final Area final_clip,final Area unscaled_clip,final int segCount){ if (debug) { System.out.println("[clip image] segCount=" + segCount); } final double shape_x=unscaled_clip.getBounds2D().getX(); final double shape_y=unscaled_clip.getBounds2D().getY(); final int image_w=current_ima...
clip the image
public static byte[] copyOfRange(byte[] original,int start,int end){ if (start <= end) { if (original.length >= start && 0 <= start) { int length=end - start; int copyLength=Math.min(length,original.length - start); byte[] copy=new byte[length]; System.arraycopy(original,start,copy,0,copyL...
Copies elements in original array to a new array, from index start(inclusive) to end(exclusive). The first element (if any) in the new array is original[from], and other elements in the new array are in the original order. The padding value whose index is bigger than or equal to original.length - start is (byte)0.
@DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:43.388 -0500",hash_original_method="D85CBFA2F1A37C13B743BA6B1C12F2CC",hash_generated_method="1CD5DECB5B3EECBD930281411C62A36B") public void scan(Reader r0,ScanHandler h) throws IOExcepti...
Scan HTML source, reporting lexical events.
public void register(String noteId,String className,String event,String cmd) throws IllegalArgumentException { synchronized (registry) { if (noteId == null) { noteId=GLOBAL_KEY; } addRepl(noteId,className); if (!event.equals(HookType.POST_EXEC) && !event.equals(HookType.PRE_EXEC) && !event.equals(...
Register a hook for a specific event.
private void updateProgress(String progressLabel,int progress){ if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) { myHost.updateProgress(progressLabel,progress); } previousProgress=progress; previousProgressLabel=progressLabel; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
@Override public ImmutableSet<V> replaceValues(K key,Iterable<? extends V> values){ throw new UnsupportedOperationException(); }
Guaranteed to throw an exception and leave the multimap unmodified.
public SelectionDialog(String key,int mode,Object[] arguments){ super(ApplicationFrame.getApplicationFrame(),I18N_PREFIX_SELECTION + key,ModalityType.APPLICATION_MODAL,arguments); this.mode=mode; }
Constructs new dialog. Only sets object variables.