code
stringlengths
10
174k
nl
stringlengths
3
129k
ScheduledFutureTask(Callable<V> callable,long ns){ super(callable); this.time=ns; this.period=0; this.sequenceNumber=sequencer.getAndIncrement(); }
Creates a one-shot action with given nanoTime-based trigger time.
final boolean shouldMapTextChar(int value){ if (value < ASCII_MAX) return shouldMapTextChar_ASCII[value]; return get(value); }
Tell if the character argument that is from a text node has a mapping to a String, for example to map '<' to "&lt;".
public static StorageEvent parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { StorageEvent object=new StorageEvent(); int event; java.lang.String nillableValue=null; java.lang.String prefix=""; java.lang.String namespaceuri=""; try { while (!reader.isStartElement() && !reader.is...
static method to create the object Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable If this object is not an element, it is a complex type and the reader is at the event just after the outer start element Postcondition: If t...
public ExifTag(String name,String value){ super(Namespaces.EXIF_NAMESPACE,name,null,value); this.name=name; setRequired(false); }
Construct an exif tag of &lt;ns:name&gt;value&lt;/ns:name&gt;.
public static String encodeWebSafe(byte[] source,boolean doPadding){ return encode(source,0,source.length,WEBSAFE_ALPHABET,doPadding); }
Encodes a byte array into web safe Base64 notation.
public static Optional<ReservedList> load(Key<ReservedList> key){ return get(key.getName()); }
Loads a ReservedList from its Objectify key.
public static int parseColon(String str){ final int[] multipliers={1,60,3600,86400,31536000}; String[] bits=str.split(":"); int result=0; for (int i=0; i < bits.length; i++) { String bit=bits[bits.length - (i + 1)].trim(); if (bit.length() > 0) { result+=multipliers[i] * Integer.parseInt(bit); ...
parse time in h:m:s format to SECONDS
public TopDocs search(Document d,String indexPath) throws IOException { if (d.getField("ro-order") != null) return scoreDocs(d.getValues("ro-order")[0],DirectoryReader.open(FSDirectory.open(new File(indexPath)))); else { ImageSearcher searcher=new GenericImageSearcher(numReferenceObjectsUsed,featureClass,featu...
Provides basic search functions ...
private void updateProgress(int progress){ if (myHost != null && progress != previousProgress) { myHost.updateProgress(progress); } previousProgress=progress; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
public void balance(){ int i=0, n=length; String[] k=new String[n]; char[] v=new char[n]; Iterator iter=new Iterator(); while (iter.hasMoreElements()) { v[i]=iter.getValue(); k[i++]=iter.nextElement(); } init(); insertBalanced(k,v,0,n); }
Balance the tree for best search performance
public RequestHandle put(Context context,String url,RequestParams params,ResponseHandlerInterface responseHandler){ return put(context,url,paramsToEntity(params,responseHandler),null,responseHandler); }
Perform a HTTP PUT request and track the Android Context which initiated the request.
@Override public Object eInvoke(int operationID,EList<?> arguments) throws InvocationTargetException { switch (operationID) { case ValidationPackage.VALIDATION_MARKER___ERESOURCE: return eResource(); } return super.eInvoke(operationID,arguments); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void run(long jobsToComplete) throws AuditLogEntryException, IOException, StateUpdateException, SQLException { clearCounters(); long lastPersistedAuditLogId=0; if (startAfterAuditLogId.isPresent()) { lastPersistedAuditLogId=startAfterAuditLogId.get(); } else { LOG.debug("Fetching last persisted ...
Start reading the audit log and replicate entries.
public Boolean isMemoryReservationLockSupported(){ return memoryReservationLockSupported; }
Gets the value of the memoryReservationLockSupported property.
@DSSafe(DSCat.SAFE_OTHERS) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-03-24 16:05:57.040 -0400",hash_original_method="2FE3DF2A181D04B622B627D661DD5F8F",hash_generated_method="F19E4AF2315240F3614DF3012C7D3968") public GraphEnvironment(){ super(null); }
Create a new GraphEnvironment with default components.
@Override protected void register(ContainerFactory containerFactory){ containerFactory.registerContainer("jonas4x",ContainerType.REMOTE,Jonas4xRemoteContainer.class); containerFactory.registerContainer("jonas4x",ContainerType.INSTALLED,Jonas4xInstalledLocalContainer.class); containerFactory.registerContainer("jon...
Register container.
public DTMIterator createDTMIterator(int node){ DTMIterator iter=new org.apache.xpath.axes.OneStepIteratorForward(Axis.SELF); iter.setRoot(node,this); return iter; }
Create a new <code>DTMIterator</code> that holds exactly one node.
@Override public void eUnset(int featureID){ switch (featureID) { case OrientedPackage.COMPONENT__INPUT_COMPONET_REFS: getInputComponetRefs().clear(); return; case OrientedPackage.COMPONENT__OUTPUT_COMPONET_REFS: getOutputComponetRefs().clear(); return; case OrientedPackage.COMPONENT__INPUT_PORT_REFS: getInputPor...
<!-- begin-user-doc --> <!-- end-user-doc -->
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); int size=s.readInt(); if (size < 0) throw new java.io.StreamCorruptedException("Illegal mappings count: " + size); init(capacity(size)); for (int i=0; i < size; i++) { @Suppre...
Reconstitutes the <tt>IdentityHashMap</tt> instance from a stream (i.e., deserializes it).
private String createWorkflowStepForInvalidateCache(Workflow workflow,StorageSystem vplexSystem,URI vplexVolumeURI,String waitFor,Workflow.Method rollbackMethod){ Volume vplexVolume=getDataObject(Volume.class,vplexVolumeURI,_dbClient); URI vplexURI=vplexSystem.getId(); Workflow.Method invalidateCacheMethod=create...
Create a step in the passed workflow to invalidate the read cache for the passed volume on the passed VPLEX system.
protected long readLong() throws IOException, ReplicatorException, InterruptedException { assertReadMode(); return dataInput.readLong(); }
Reads a single long.
public void actionPerformed(ActionEvent e){ int currentTab=0; for (Iterator<String> i=this.tabs.keySet().iterator(); i.hasNext(); ) { String tabName=i.next(); TabInfo tabInfo=this.tabs.get(tabName); if (tabInfo.getHeader().getButton() == e.getSource()) { this.visibleTab=currentTab; render();...
Invoked when one of our tabs is selected
public static void drawPath(@NonNull Canvas canvas,@NonNull Paint paint,@NonNull List<Point> points){ if (points.size() < 2) { return; } PATH.reset(); Point firstPoint=points.get(0); PATH.moveTo(firstPoint.x,firstPoint.y); Stream.of(points).skip(1).forEach(null); PATH.close(); canvas.drawPath(PATH,p...
Draws a path in the canvas using the <code>points</code> list, drawing a line between consecutive points
public Shape chartToScreenShape(Shape s){ GeneralPath p=new GeneralPath(); Transform inverse=Transform.makeTranslation(getAbsoluteX(),getAbsoluteY()); if (currentTransform != null) { inverse.concatenate(currentTransform); } p.append(s.getPathIterator(inverse),false); return p; }
Converts a screen coordinate spaced shape to the same shape in the chart coordinate space
public static boolean removeFromCache(String imageUri,DiskCache diskCache){ File image=diskCache.get(imageUri); return image != null && image.exists() && image.delete(); }
Removed cached image file from disk cache (if image was cached in disk cache before)
public Boolean isWakeOnLanEnabled(){ return wakeOnLanEnabled; }
Gets the value of the wakeOnLanEnabled property.
public EntityQuery filterByDate(){ this.filterByDate=true; this.filterByDateMoment=null; this.filterByFieldNames=null; return this; }
Specifies whether the query should return only values that are currently active using from/thruDate fields.
protected void stopHarvestTiming(int candidateCount){ this.lastHarvestingTime=this.getHarvestDuration(); this.lastStartHarvestingTime=-1; this.totalCandidateCount+=candidateCount; }
Stops the harvesting timer. Called when the harvest ends.
public double[][] dataProjections(V p){ double[] centered=minusEquals(p.toArray(),centroid); double[][] sum=new double[p.getDimensionality()][strongEigenvectors[0].length]; for (int i=0; i < strongEigenvectors[0].length; i++) { double[] v_i=getCol(strongEigenvectors,i); timesEquals(v_i,transposeTimes(cent...
Returns the data vectors after projection.
private static void ReleaseBooleanArrayElements(JNIEnvironment env,int arrayJREF,Address copyBufferAddress,int releaseMode){ if (traceJNI) VM.sysWrite("JNI called: ReleaseBooleanArrayElements \n"); RuntimeEntrypoints.checkJNICountDownToGC(); try { boolean[] sourceArray=(boolean[])env.getJNIRef(arrayJREF); ...
ReleaseBooleanArrayElements: free the native copy of the array, update changes to Java array as indicated
protected boolean isInfoEnabled(){ return trace.isInfoEnabled(); }
Check if info trace level is enabled.
public int equivHashCode(){ return (getUnit().hashCode() * 17) + (getValue().equivHashCode() * 101); }
Non-deterministic hashcode consistent with equivTo() implementation. <p> <b>Note:</b> If you are concerned about non-determinism, remember that current implementations of equivHashCode() in other parts of Soot are non-deterministic as well (see Constant.java for example).
public void init(int WindowNo,FormFrame frame){ log.info(""); m_WindowNo=WindowNo; m_frame=frame; try { jbInit(); dynInit(); frame.getContentPane().add(centerPanel,BorderLayout.CENTER); frame.getContentPane().add(southPanel,BorderLayout.SOUTH); } catch ( Exception e) { log.log(Level.SEVE...
Initialize Panel
private void simpleSyntaxValidation(String value){ Map<String,Integer> characterCounts=new HashMap<>(); characterCounts.put(START_DELIMITER,0); characterCounts.put(START_PAREN,0); for ( char theChar : value.toCharArray()) { if (START_DELIMITER.indexOf(theChar) != -1) { Integer count=characterCounts.g...
Routine determines if the value looks invalid, like having too many parentheses or not enough.
public SequenceForMySQL(Session s,String sSeqTable){ sent1=new StaticSentence(s,"UPDATE " + sSeqTable + " SET ID = LAST_INSERT_ID(ID + 1)"); sent2=new StaticSentence(s,"SELECT LAST_INSERT_ID()",null,SerializerReadInteger.INSTANCE); }
Creates a new instance of SequenceForMySQL
public AbstractLongList elements(long[] elements){ this.elements=elements; this.size=elements.length; return this; }
Sets the receiver's elements to be the specified array (not a copy of it). The size and capacity of the list is the length of the array. <b>WARNING:</b> For efficiency reasons and to keep memory usage low, <b>the array is not copied</b>. So if subsequently you modify the specified array directly via the [] operator, be...
public static int nextPoisson(double xm){ double em; double t, y; if (xm < 12.0) { if (xm != oldm) { oldm=xm; g=Math.exp(-xm); } em=-1.0; t=1.0; do { ++em; t*=MathUtils.nextDouble(); } while (t > g); } else { if (xm != oldm) { oldm=xm; sq=Math.sq...
Returns an integer value that is a random deviate drawn from a Poisson distribution of mean xm.
private void snoopDHCPClientName(Ethernet eth,Device srcDevice){ if (!(eth.getPayload() instanceof IPv4)) return; IPv4 ipv4=(IPv4)eth.getPayload(); if (!(ipv4.getPayload() instanceof UDP)) return; UDP udp=(UDP)ipv4.getPayload(); if (!(udp.getPayload() instanceof DHCP)) return; DHCP dhcp=(DHCP)udp.getP...
Snoop and record client-provided host name from DHCP requests
@Override public synchronized void reset() throws IOException { in.reset(); }
Resets this stream to the last marked location. This implementation resets the target stream.
public Property monthOfYear(){ return new Property(this,getChronology().monthOfYear()); }
Get the month of year property which provides access to advanced functionality.
public ReilInterpreter(final Endianness endianness,final ICpuPolicy cpuPolicy,final IInterpreterPolicy interpreterPolicy){ Preconditions.checkNotNull(endianness,"Error: Argument endianness can't be null"); this.cpuPolicy=Preconditions.checkNotNull(cpuPolicy,"Error: Argument cpuPolicy can't be null"); this.interpr...
Creates a new REIL interpreter with the given options.
public static void initialize(final RPServerManager rpMan){ StendhalRPAction.rpman=rpMan; }
initializes the StendhalRPAction
public void add(Double value){ if (value == null) { addNull(); } else { _add(numberNode(value.doubleValue())); } }
Alternative method that we need to avoid bumping into NPE issues with auto-unboxing.
public SendableDocumentMessage.SendableDocumentMessageBuilder replyTo(Message replyTo){ this.replyTo=replyTo != null ? replyTo.getMessageId() : 0; return this; }
*Optional Sets the Message object that you want to reply to
protected ServiceCoded removeVolumesFromCGInternal(URI vplexURI,URI cgURI,List<URI> vplexVolumeURIs){ try { if (vplexVolumeURIs.isEmpty()) { log.info("Empty volume list; no volumes to remove from CG %s",cgURI.toString()); return null; } StorageSystem vplexSystem=getDataObject(StorageSystem.cla...
The method called by the workflow to remove VPLEX volumes from a VPLEX consistency group.
protected void onStop(){ super.onStop(); try { if (client != null) { client.stop(); Log.i("Jetty","Stopped httpclient"); } } catch ( Exception e) { Log.e("Jetty","Error stopping httpclient ",e); } finally { client=null; fileInProgress=null; } }
Download activity is being stopped. Stop the httpclient (note that onPause should always be called first, so the client should be null).
public int length(){ return this.map.size(); }
Get the number of keys stored in the JSONObject.
public void addPropertyChangeListener(String propertyName,PropertyChangeListener in_pcl){ beanContextChildSupport.addPropertyChangeListener(propertyName,in_pcl); }
Method for BeanContextChild interface.
public void dispose(){ mRunButton.setSelected(false); super.dispose(); }
When the window closes, stop any sequences running
private void handleError(@NotNull Throwable e){ String errorMessage=(e.getMessage() != null && !e.getMessage().isEmpty()) ? e.getMessage() : constant.initFailed(); console.printError(errorMessage); notificationManager.showError(errorMessage); }
Handler some action whether some exception happened.
public final int yylength(){ return zzMarkedPos - zzStartRead; }
Returns the length of the matched text region.
public boolean isSensorMessage(){ return getElement(0) == 0x61 && getElement(1) >= 0x30 && getElement(2) >= 0x41 && getElement(2) <= 0x6F && getNumDataElements() == 3; }
Examine message to see if it is an asynchronous sensor (AIU) state report
public String toString(){ StringBuffer sb=new StringBuffer("MProjectLine["); sb.append(get_ID()).append("-").append(getLine()).append(",C_Project_ID=").append(getC_Project_ID()).append(",C_ProjectPhase_ID=").append(getC_ProjectPhase_ID()).append(",C_ProjectTask_ID=").append(getC_ProjectTask_ID()).append(",C_Project...
String Representation
private void addEndToken(int tokenType){ addToken(zzMarkedPos,zzMarkedPos,tokenType); }
Adds the token specified to the current linked list of tokens as an "end token;" that is, at <code>zzMarkedPos</code>.
public StrengthFitnessEvaluator(int k){ super(); this.k=k; comparator=new ParetoDominanceComparator(); }
Constructs a new fitness evaluator for computing the strength measure with crowding-based niching.
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_right.bool(xctxt); }
Evaluate this operation directly to a boolean.
public void storeLocal(final int local){ storeInsn(getLocalType(local),local); }
Generates the instruction to store the top stack value in the given local variable.
public boolean letsRedstoneGoOut(byte aSide,int aCoverID,int aCoverVariable,ICoverable aTileEntity){ return false; }
If it lets RS-Signals out of the Block
@Override public int available() throws IOException { if (c.checkEOF() || (r.isAppDataValid() == false)) { return 0; } return r.available(); }
Return the minimum number of bytes that can be read without blocking. Currently not synchronized.
@Override public void checkServerTrusted(X509Certificate[] chain,String authType) throws CertificateException { }
Check server trusted
@Override public void shutdown(){ super.shutdown(); disconnect(); }
Stop sensing.
protected boolean isIncluded(EStructuralFeature feature){ return dataClass.isAssignableFrom(feature.getEType().getInstanceClass()); }
Indicates whether all elements from the specified source feature are included in this list.
public void notifyInSeconds(final int sec,final TurnListener turnListener){ notifyInTurns(SingletonRepository.getRPWorld().getTurnsInSeconds(sec),turnListener); }
Notifies the <i>turnListener</i> in <i>sec</i> seconds.
public boolean hasCursor(){ return isServerFlagSet(MySQLConstants.SERVER_STATUS_CURSOR_EXISTS); }
Tells whether or not a cursor exists.
protected GenericCDATASection(){ }
Creates a new CDATASection object.
public static _Fields findByThriftId(int fieldId){ switch (fieldId) { case 1: return VALUE; case 2: return VERSION; default : return null; } }
Find the _Fields constant that matches fieldId, or null if its not found.
protected AbstractCatchBlockImpl(){ super(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
protected void onDeviceConnected(){ mField.setEnabled(true); mSendButton.setEnabled(true); }
Method called when the target device has connected.
private Item newString(final String value){ key2.set(STR,value,null,null); Item result=get(key2); if (result == null) { pool.put12(STR,newUTF8(value)); result=new Item(index++,key2); put(result); } return result; }
Adds a string to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item.
public final void update(byte[] data,int off,int len) throws SignatureException { if (state == SIGN || state == VERIFY) { if (data == null) { throw new IllegalArgumentException("data is null"); } if (off < 0 || len < 0) { throw new IllegalArgumentException("off or len is less than 0"); } ...
Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.
@Override public boolean isActive(){ return true; }
Is the scope active.
public char next() throws JSONException { int c; if (this.usePrevious) { this.usePrevious=false; c=this.previous; } else { try { c=this.reader.read(); } catch ( IOException exception) { throw new JSONException(exception); } if (c <= 0) { this.eof=true; c=0; ...
Get the next character in the source string.
public static boolean intersect(long x,long y){ return (x & y) != 0L; }
Test whether two Bitsets intersect.
public boolean find(){ return matcher.find(); }
Attempts to find the next subsequence of the input sequence that matches the pattern. <p>This method starts at the beginning of this matcher's region, or, if a previous invocation of the method was successful and the matcher has not since been reset, at the first character not matched by the previous match.</p> <p>If t...
public void debug(Throwable throwable,String msg){ innerLog(Level.DEBUG,throwable,msg,UNKNOWN_ARG,UNKNOWN_ARG,UNKNOWN_ARG,null); }
Log a debug message with a throwable.
public void reset(){ list.iterReverse(); currentIndex=list.size() - 1; }
Restarts iteration from the list's tail (last element).
public FixedWidthTextTableReader(String location) throws DataIOException { this(FixedWidthTextTableSchema.load(location)); }
Creates a new FixedWidthTextTableReader using the schema at the given location.
@Override public boolean supportsNamedParameters(){ debugCodeCall("supportsNamedParameters"); return false; }
Does the database support named parameters.
private Builder(org.apache.nutch.storage.ProtocolStatus.Builder other){ super(other); }
Creates a Builder by copying an existing Builder
public PasswordManagerCtrl(){ this.setupCommandLine(); }
Creates a new <code>PasswordManager</code> object
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:58:13.024 -0500",hash_original_method="69EAD59EF006B3A496038767E7251C79",hash_generated_method="E8BF02F1B64289F3B2238534086D0E8C") @Override protected void shutdownInput() throws IOException { shutdownInput=true; try { Libcore....
Shutdown the input portion of the socket.
public JapaneseBaseFormFilterFactory(Map<String,String> args){ super(args); if (!args.isEmpty()) { throw new IllegalArgumentException("Unknown parameters: " + args); } }
Creates a new JapaneseBaseFormFilterFactory
private PhantomReferenceElement(E ref,ReferenceQueue<? super E> refQ){ super(ref,refQ); hashCode=ref != null ? ref.hashCode() : 0; }
Creates weak reference element.
public ColorList adjustSaturation(float step){ for ( TColor c : colors) { c.saturate(step); } return this; }
Adjusts the saturation component of all list colors by the given amount.
@Override public void logError(CacheErrorCategory category,Class<?> clazz,String message,@Nullable Throwable throwable){ }
Log an error of the specified category.
public void validateAttributes(){ if ((this.totalNumBuckets <= 0)) { throw new IllegalStateException(LocalizedStrings.PartitionAttributesImpl_TOTALNUMBICKETS_0_IS_AN_ILLEGAL_VALUE_PLEASE_CHOOSE_A_VALUE_GREATER_THAN_0.toLocalizedString(Integer.valueOf(this.totalNumBuckets))); } if ((this.redundancy < 0) || (th...
Validates that the attributes are consistent with each other. The following rules are checked and enforced: <ul> <li>Redundancy should be between 1 and 4</li> <li>Scope should be either DIST_ACK or DIST_NO_ACK</li> </ul> NOTE: validation that depends on more than one attribute can not be done in this method. That valid...
public MySqlSelectIntoStatement parseSelectInto(){ MySqlSelectIntoParser parse=new MySqlSelectIntoParser(this.exprParser); return parse.parseSelectInto(); }
parse select into
private void configureValidators(ValidatorLogger logger,AbstractXtremIOValidator... validators){ for ( AbstractXtremIOValidator validator : validators) { validator.setFactory(this); validator.setLogger(logger); } }
Common configuration for XtremIO validators.
public void defineToFile(String key,File value){ define(key,value.getAbsolutePath()); }
Defines a property to a file for the ant task.
private boolean findAndAddClosestValidLeafNodes(Node start,boolean checkStart,boolean backward,AnchorElement baseAnchor){ Node node=checkStart ? start : (backward ? start.getPreviousSibling() : start.getNextSibling()); if (node == null) { node=start.getParentNode(); if (sInvalidParentWrapper == null) { ...
Finds and adds the leaf node(s) closest to the given start node. This recurses and keeps finding and, if necessary, adding the numeric text of valid nodes, collecting the PageParamInfo.PageInfo's for the current adjacency group. For backward search, i.e. nodes before start node, search terminates (i.e. recursion stops)...
@Override public int helo(String hostname) throws IOException { return sendCommand("LHLO",hostname); }
Issue the LHLO command
public RFF_RBF(int featurSize,double sigma,int dim,Random rand,boolean inMemory){ this(sigma,dim,inMemory); if (featurSize <= 0) throw new IllegalArgumentException("The number of numeric features must be positive, not " + featurSize); if (sigma <= 0 || Double.isInfinite(sigma) || Double.isNaN(sigma)) throw ne...
Creates a new RFF RBF object
public int size(){ return data.length; }
Returns the number of bytes in this ByteString.
public InputBuilder<T> emitAll(Collection<T> records){ input.addAll(records); return this; }
Adds a collection of elements to the input
public JHyperlink(String text){ this(); setText(text); }
Creates a new instance of JHyperlink
public void endElement(String name) throws org.xml.sax.SAXException { endElement(null,null,name); }
Receive notification of the end of an element.
public void trace() throws IOException { print("trace",null); }
Description of the Method
public void nextPage(){ skipResults+=pageSize; pageNumber+=1; }
metodo para obtener la siguiente pagina de la busqueda realizada previamente
public void ready(String message){ setMessage(message); setProgress(100); updateStatus(Status.ready.name()); }
This method sets the status of the operation to "ready" and updates progress to be 100%
public boolean saveLogToLocal(String path){ String content=PcStringUtils.renderJson(new ParallelTaskBean(this)); File file=new File(path); boolean success=false; try { FileUtils.writeStringToFile(file,content); success=true; } catch ( IOException e) { logger.error("error writing parallel task to...
Save log to local.