code
stringlengths
10
174k
nl
stringlengths
3
129k
protected void clearOutEvents(){ }
This method resets the outgoing events.
public boolean isAlternative(){ return iAlternative; }
True, if the request is alternative (alternative request can be assigned instead of a non-alternative course requests, if it is left unassigned)
public boolean needsOffset(){ if (isEnabled() && isDrawLabelsEnabled() && getLabelPosition() == YAxisLabelPosition.OUTSIDE_CHART) return true; else return false; }
Returns true if this axis needs horizontal offset, false if no offset is needed.
public boolean hasAttribute(String attName){ if (attName == null) return false; for ( String key : attributes.keySet()) { if (key.equalsIgnoreCase(attName)) return true; } return false; }
Checks existence of specified attribute.
public String toString(){ return this.getClass().getName() + "(" + alpha+ ","+ lambda+ ")"; }
Returns a String representation of the receiver.
public void testOnServerHealthy_reloadsUsersIfNotAvailable(){ when(mTroubleshooter.isServerHealthy()).thenReturn(false); mController.init(); when(mTroubleshooter.isServerHealthy()).thenReturn(true); mFakeEventBus.post(new TroubleshootingActionsChangedEvent(ImmutableSet.of(TroubleshootingAction.CHECK_PACKAGE_SERVER_CONFIGURATION),null)); verify(mMockUserManager,times(2)).loadKnownUsers(); }
Tests that users are reloaded if the server becomes healthy and users are unavailable.
void visitSubroutine(final Label JSR,final long id,final int nbSubroutines){ Label stack=this; while (stack != null) { Label l=stack; stack=l.next; l.next=null; if (JSR != null) { if ((l.status & VISITED2) != 0) { continue; } l.status|=VISITED2; if ((l.status & RET) != 0) { if (!l.inSameSubroutine(JSR)) { Edge e=new Edge(); e.info=l.inputStackTop; e.successor=JSR.successors.successor; e.next=l.successors; l.successors=e; } } } else { if (l.inSubroutine(id)) { continue; } l.addToSubroutine(id,nbSubroutines); } Edge e=l.successors; while (e != null) { if ((l.status & Label.JSR) == 0 || e != l.successors.next) { if (e.successor.next == null) { e.successor.next=stack; stack=e.successor; } } e=e.next; } } }
Finds the basic blocks that belong to a given subroutine, and marks these blocks as belonging to this subroutine. This method follows the control flow graph to find all the blocks that are reachable from the current block WITHOUT following any JSR target.
public void propertyChange(PropertyChangeEvent e){ if (e == null) return; Object value=e.getNewValue(); if (value == null) return; log.config(e.getPropertyName() + "=" + value+ " - "+ value.getClass().toString()); if (!(value instanceof MTreeNode)) return; int nodeID=((MTreeNode)value).getNode_ID(); int size=m_mTab.getRowCount(); int row=-1; for (int i=0; i < size; i++) { if (m_mTab.getKeyID(i) == nodeID) { row=i; break; } } if (row == -1) { if (nodeID > 0) log.log(Level.WARNING,"Tab does not have ID with Node_ID=" + nodeID); return; } m_mTab.navigate(row); }
PropertyChange Listener - Tree Panel - node selection
public int nextInt(){ return nextInt(n,p); }
Returns a random number from the distribution.
public Customers(){ this("CUSTOMERS",null); }
Create a <code>PUBLIC.CUSTOMERS</code> table reference
public final Object lookup(SymbolNode opNode,Context c,TLCState s,boolean cutoff){ boolean isVarDecl=(opNode.getKind() == VariableDeclKind); Object result=c.lookup(opNode,cutoff && isVarDecl); if (result != null) return result; result=opNode.getToolObject(TLCGlobals.ToolId); if (result != null) return result; if (opNode.getKind() == UserDefinedOpKind) { ExprNode body=((OpDefNode)opNode).getBody(); result=body.getToolObject(TLCGlobals.ToolId); while ((result == null) && (body.getKind() == SubstInKind)) { body=((SubstInNode)body).getBody(); result=body.getToolObject(TLCGlobals.ToolId); } if (result != null) return result; } result=s.lookup(opNode.getName()); if (result != null) return result; return opNode; }
This method gets the value of a symbol from the enviroment. We look up in the context c, its tool object, and the state s. It and the lookup method that follows it were modified by LL on 10 April 2011 to fix the following bug. When a constant definition Foo == ... is overridden to substitute Bar for Foo, the TLC tool object for the body of Foo's OpDef node is set to the OpDefNode for Bar. When evaluating a use of Foo, the lookup method is apparently supposed to return the OpDefNode for Bar. (I don't understand how the callers make use of the returned value.) That's what it does for uses of Foo in the module in which Foo is defined. However, if Foo is imported by instantiation with renaming as X!Foo, then it appears that looking up X!Foo should also return the OpDefNode for Bar. If the instantiated module had no parameters, then that's what happened because the body of the OpDefNode for X!Foo is the same (contains a pointer to the same object) as the body of Foo's OpDefNode. However, that wasn't the case if the instantiated module had parameters, because then X!Foo's OpDefNode consists of a sequence of nested SubstInNode objects, the last of which points to the body of Foo's OpDefNode. So, LL modified the lookup methods so they follow the sequence of SubstInNode bodies down to the body of Foo's OpDefNode when looking up the result. (If a SubstInNode has a non-null TLC tool object for a SubstInNode, then it returns that object. I don't think this should ever be the case, and if it is, I have no idea what the lookup method should do.)
public void nextCharacter(EditorState editorState){ int currentOffset=editorState.getCurrentOffset(); MathSequence currentField=editorState.getCurrentField(); if (currentOffset < currentField.size() && currentField.getArgument(currentOffset) != null && currentField.getArgument(currentOffset) instanceof MathContainer && ((MathContainer)currentField.getArgument(currentOffset)).hasChildren()) { MathComponent component=currentField.getArgument(currentOffset); firstField(editorState,(MathContainer)component); } else if (currentOffset < currentField.size()) { editorState.incCurrentOffset(); } else { nextField(editorState); } }
Next character -> key.
protected void sequence_IntersectionTypeExpressionOLD_TypeRef(ISerializationContext context,IntersectionTypeExpression semanticObject){ genericSequencer.createSequence(context,semanticObject); }
Contexts: TypeRef returns IntersectionTypeExpression TypeArgument returns IntersectionTypeExpression Constraint: (typeRefs+=TypeRefWithoutModifiers typeRefs+=TypeRefWithoutModifiers* undefModifier=UndefModifierToken? nullModifier=NullModifierToken?)
protected static DataCiteMetadata.Titles convertEmlTitles(Eml eml) throws InvalidMetadataException { if (!Strings.isNullOrEmpty(eml.getTitle())) { DataCiteMetadata.Titles titles=FACTORY.createDataCiteMetadataTitles(); DataCiteMetadata.Titles.Title primary=FACTORY.createDataCiteMetadataTitlesTitle(); primary.setValue(eml.getTitle()); primary.setLang(eml.getMetadataLanguage()); titles.getTitle().add(primary); return titles; } else { throw new InvalidMetadataException("DataCite schema (v3) requires at least one title"); } }
Convert list of EML titles into DataCite titles. Only the title is mandatory, the type is optional. EML version 1.1 only contains a single title, with language derived from metadata language. DataCite metadata schema (v3) requires at least one title.
public Collection<? extends Certificate> engineGenerateCertificates(InputStream inStream) throws CertificateException { if (inStream == null) { throw new CertificateException("inStream == null"); } ArrayList<Certificate> result=new ArrayList<>(); try { if (!inStream.markSupported()) { inStream=new RestoringInputStream(inStream); } byte[] encoding=null; int second_asn1_tag=-1; inStream.mark(1); int ch; while ((ch=inStream.read()) != -1) { if (ch == '-') { encoding=decodePEM(inStream,FREE_BOUND_SUFFIX); } else if (ch == 0x30) { encoding=null; inStream.reset(); inStream.mark(CERT_CACHE_SEED_LENGTH); } else { if (result.size() == 0) { throw new CertificateException("Unsupported encoding"); } else { inStream.reset(); return result; } } BerInputStream in=(encoding == null) ? new BerInputStream(inStream) : new BerInputStream(encoding); second_asn1_tag=in.next(); if (encoding == null) { inStream.reset(); } if (second_asn1_tag != ASN1Constants.TAG_C_SEQUENCE) { if (result.size() == 0) { break; } else { return result; } } else { if (encoding == null) { result.add(getCertificate(inStream)); } else { result.add(getCertificate(encoding)); } } inStream.mark(1); } if (result.size() != 0) { return result; } else if (ch == -1) { throw new CertificateException("There is no data in the stream"); } if (second_asn1_tag == ASN1Constants.TAG_OID) { ContentInfo info=(ContentInfo)((encoding != null) ? ContentInfo.ASN1.decode(encoding) : ContentInfo.ASN1.decode(inStream)); SignedData data=info.getSignedData(); if (data == null) { throw new CertificateException("Invalid PKCS7 data provided"); } List<android.framework.org.apache.harmony.security_custom.x509.Certificate> certs=data.getCertificates(); if (certs != null) { for ( android.framework.org.apache.harmony.security_custom.x509.Certificate cert : certs) { result.add(new X509CertImpl(cert)); } } return result; } throw new CertificateException("Unsupported encoding"); } catch ( IOException e) { throw new CertificateException(e); } }
Generates the collection of the certificates on the base of provided via input stream encodings.
public Parking(){ super(); }
Needed by CGLib
public void finishActivity(){ Activity activity=activityStack.lastElement(); finishActivity(activity); }
finish current activity from Stack
private void drawComposite(){ final Rectangle rect=this.getClientArea(); final Image newImage=new Image(getDisplay(),Math.max(1,rect.width),Math.max(1,rect.height)); final GC gc=new GC(newImage); final boolean inside=this.insideComposite || this.insideImage || this.insideInstruction|| this.insideText; if (!inside && !this.selection) { gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE)); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WHITE)); gc.drawRectangle(rect.x,rect.y,rect.width,rect.height); } else { final Color gradientColor=inside ? new Color(getDisplay(),220,231,243) : new Color(getDisplay(),241,241,241); final Color borderColor=inside ? new Color(getDisplay(),35,107,178) : new Color(getDisplay(),192,192,192); gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WHITE)); gc.setBackground(gradientColor); gc.fillGradientRectangle(rect.x,rect.y,rect.width,rect.height,true); gc.setForeground(borderColor); gc.drawRoundRectangle(rect.x,rect.y,rect.width - 1,rect.height - 1,2,2); gradientColor.dispose(); borderColor.dispose(); } gc.dispose(); this.setBackgroundImage(newImage); if (this.oldImage != null) { this.oldImage.dispose(); } this.oldImage=newImage; }
Draw the composite
public void remove(){ try { removeThrow(); } catch ( SQLException e) { closeQuietly(); throw new IllegalStateException("Could not delete " + dataClass + " object "+ last,e); } }
Removes the last object returned by next() by calling delete on the dao associated with the object.
public boolean isAsciiSuperset(){ return asciiSuperset; }
Returns the asciiSuperset.
public static List<String> stringIds(Collection<? extends DataObjectRestRep> values){ List<String> ids=new ArrayList<String>(); if (values != null) { for ( DataObjectRestRep value : values) { ids.add(stringId(value)); } } return ids; }
Gets the IDs of the resources, as a list of strings.
public long toNanoseconds(){ return TimeUnit.NANOSECONDS.convert(length,timeUnit); }
Returns the Duration converted to nanoseconds.
public void testCase1(){ byte aBytes[]={1,2,3,4,5,6,7,1,2,3}; byte bBytes[]={10,20,30,40,50,60,70,10,20,30}; int aSign=1; int bSign=1; byte rBytes[]={11,22,33,44,55,66,77,11,22,33}; BigInteger aNumber=new BigInteger(aSign,aBytes); BigInteger bNumber=new BigInteger(bSign,bBytes); BigInteger result=aNumber.add(bNumber); byte resBytes[]=new byte[rBytes.length]; resBytes=result.toByteArray(); for (int i=0; i < resBytes.length; i++) { assertTrue(resBytes[i] == rBytes[i]); } assertEquals("incorrect sign",1,result.signum()); }
Add two positive numbers of the same length
public final double sampleMax(){ return _activeCountMax.getAndSet(_activeCount.get()); }
Sample the active count
private void finishItemListItem(StringBuilder result){ result.append("</div><div class=\"justchildren\"></div></div>"); }
Called to finish adding an item to an item list.
public static void addCompleteToIncludePathFromDoc(final FileObject doc){ FileObject ciRoot=getCiRoot(doc); if (ciRoot == null) { return; } Project project=FileOwnerQuery.getOwner(ciRoot); if (project == null) { return; } addCompleteToIncludePath(ciRoot,project); }
Use the current PHp document as a pointer to add auto completion file into the project path
private void readSample(ParsableByteArray data){ int bytesToRead=Math.min(data.bytesLeft(),sampleSize - bytesRead); currentOutput.sampleData(data,bytesToRead); bytesRead+=bytesToRead; if (bytesRead == sampleSize) { currentOutput.sampleMetadata(timeUs,C.SAMPLE_FLAG_SYNC,sampleSize,0,null); timeUs+=currentSampleDuration; setFindingSampleState(); } }
Reads the rest of the sample
protected void onClusterRendered(Cluster<T> cluster,Marker marker){ }
Called after the marker for a Cluster has been added to the map.
protected void initDispatchServlet(ServletContext servletContext){ AnnotationConfigWebApplicationContext dispatchServletContext=new AnnotationConfigWebApplicationContext(); ServletRegistration.Dynamic servlet=servletContext.addServlet("springMvcServlet",new DispatcherServlet(dispatchServletContext)); servlet.addMapping("/"); servlet.setLoadOnStartup(1); }
Initializes the dispatch servlet which is used for Spring MVC REST and UI controllers.
@NoInline static DynamicLink resolveDynamicInvocation(){ VM.disableGC(); Address callingFrame=Magic.getCallerFramePointer(Magic.getFramePointer()); Address returnAddress=Magic.getReturnAddressUnchecked(callingFrame); callingFrame=Magic.getCallerFramePointer(callingFrame); int callingCompiledMethodId=Magic.getCompiledMethodID(callingFrame); CompiledMethod callingCompiledMethod=CompiledMethods.getCompiledMethod(callingCompiledMethodId); Offset callingInstructionOffset=callingCompiledMethod.getInstructionOffset(returnAddress); VM.enableGC(); DynamicLink dynamicLink=new DynamicLink(); callingCompiledMethod.getDynamicLink(dynamicLink,callingInstructionOffset); return dynamicLink; }
Discovers a method reference to be invoked via dynamic bridge. The call stack is examined to find the invocation site.
public static void splitRgb(int rgb,int[] result){ result[ALPHA]=(rgb >> SHIFT_ALPHA) & 0xff; result[RED]=(rgb >> SHIFT_RED) & 0xff; result[GREEN]=(rgb >> SHIFT_GREEN) & 0xff; result[BLUE]=(rgb >> SHIFT_BLUE) & 0xff; }
Split ARGB color to its 8 bit color components.
@Override public void start(Map<String,String> props){ log.info("Start a MqttSourceTask"); mConfig=new MqttSourceConnectorConfig(props); mMqttClientId=mConfig.getString(MqttSourceConstant.MQTT_CLIENT_ID) != null ? mConfig.getString(MqttSourceConstant.MQTT_CLIENT_ID) : MqttClient.generateClientId(); mKafkaTopic=mConfig.getString(MqttSourceConstant.KAFKA_TOPIC); MqttConnectOptions connectOptions=new MqttConnectOptions(); String sslCa=mConfig.getString(MqttSourceConstant.MQTT_SSL_CA_CERT); String sslCert=mConfig.getString(MqttSourceConstant.MQTT_SSL_CERT); String sslPrivateKey=mConfig.getString(MqttSourceConstant.MQTT_SSL_PRIV_KEY); if (sslCa != null && sslCert != null && sslPrivateKey != null) { try { connectOptions.setSocketFactory(SslUtils.getSslSocketFactory(sslCa,sslCert,sslPrivateKey,"")); } catch ( Exception e) { log.info("[{}] error creating socketFactory",mMqttClientId); e.printStackTrace(); return; } } if (mConfig.getBoolean(MqttSourceConstant.MQTT_CLEAN_SESSION)) { connectOptions.setCleanSession(mConfig.getBoolean(MqttSourceConstant.MQTT_CLEAN_SESSION)); } connectOptions.setConnectionTimeout(mConfig.getInt(MqttSourceConstant.MQTT_CONNECTION_TIMEOUT)); connectOptions.setKeepAliveInterval(mConfig.getInt(MqttSourceConstant.MQTT_KEEP_ALIVE_INTERVAL)); connectOptions.setServerURIs(mConfig.getString(MqttSourceConstant.MQTT_SERVER_URIS).split(",")); if (mConfig.getString(MqttSourceConstant.MQTT_USERNAME) != null) { connectOptions.setUserName(mConfig.getString(MqttSourceConstant.MQTT_USERNAME)); } if (mConfig.getString(MqttSourceConstant.MQTT_PASSWORD) != null) { connectOptions.setPassword(mConfig.getString(MqttSourceConstant.MQTT_PASSWORD).toCharArray()); } try { mClient=new MqttClient("tcp://127.0.0.1:1883",mMqttClientId,new MemoryPersistence()); mClient.setCallback(this); mClient.connect(connectOptions); log.info("[{}] Connected to Broker",mMqttClientId); } catch ( MqttException e) { log.error("[{}] Connection to Broker failed!",mMqttClientId,e); } try { String topic=mConfig.getString(MqttSourceConstant.MQTT_TOPIC); Integer qos=mConfig.getInt(MqttSourceConstant.MQTT_QUALITY_OF_SERVICE); mClient.subscribe(topic,qos); log.info("[{}] Subscribe to '{}' with QoS '{}'",mMqttClientId,topic,qos.toString()); } catch ( MqttException e) { log.error("[{}] Subscribe failed! ",mMqttClientId,e); } }
Start the task.
public static void updateFloat(VisualItem item,String field,float val){ item.setFloat(getStartField(field),item.getFloat(field)); item.setFloat(field,val); item.setFloat(getEndField(field),val); }
Update the values in an interpolated column (a set of three columns representing a current value along with starting and ending values). The current value will become the new starting value, while the given value will become the new current and ending values.
public boolean isNotIn(){ return notIn; }
Returns true for not-in, or false for in-lookup.
private boolean typesMatch(Class<V> valueType,Class getterType){ if (getterType != valueType) { if (getterType.isPrimitive()) { return (getterType == float.class && valueType == Float.class) || (getterType == int.class && valueType == Integer.class) || (getterType == boolean.class && valueType == Boolean.class)|| (getterType == long.class && valueType == Long.class)|| (getterType == double.class && valueType == Double.class)|| (getterType == short.class && valueType == Short.class)|| (getterType == byte.class && valueType == Byte.class)|| (getterType == char.class && valueType == Character.class); } return false; } return true; }
Utility method to check whether the type of the underlying field/method on the target object matches the type of the Property. The extra checks for primitive types are because generics will force the Property type to be a class, whereas the type of the underlying method/field will probably be a primitive type instead. Accept float as matching Float, etc.
public NondominatedPopulation(DominanceComparator comparator){ this(comparator,Settings.getDuplicateMode()); }
Constructs an empty non-dominated population using the specified dominance relation.
public T caseEntityPropertySource(EntityPropertySource object){ return null; }
Returns the result of interpreting the object as an instance of '<em>Entity Property Source</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
public static <T>JAXBCoder<T> of(Class<T> jaxbClass){ return new JAXBCoder<>(jaxbClass); }
Create a coder for a given type of JAXB annotated objects.
@SuppressWarnings("unused") public boolean isFrozen(){ return (player != null && player.isFrozen()); }
Returns true if video player is in frozen state
private static Text newPrimitive(int length){ Text text=new Text(true); text._count=length; return text; }
Returns a new primitive text instance.
public IndexSearcher createSearcher(){ MemoryIndexReader reader=new MemoryIndexReader(); IndexSearcher searcher=new IndexSearcher(reader); searcher.setSimilarity(normSimilarity); searcher.setQueryCache(null); return searcher; }
Creates and returns a searcher that can be used to execute arbitrary Lucene queries and to collect the resulting query results as hits.
@Override public void write(String str) throws IOException { out.write(str); }
Writes directly to the current <code>out</code>.
public boolean isUseAttr(){ return isUseSearch() && isUseAttrName(); }
Checks if is use attr.
private int colToLoc(int col,Vector<MappingPair> vec){ int loc=col; for (int i=0; (i < vec.size()) && (vec.elementAt(i).col <= col); i++) { loc=loc + vec.elementAt(i).inc; } return loc; }
Returns the string position to which the line-mapping defined by MappingPair vec maps the column col.
public void init(Environment env){ m_nameS=m_name; m_typeS=m_type; m_valueS=m_value; try { m_nameS=env.substitute(m_nameS); m_typeS=env.substitute(m_typeS); m_valueS=env.substitute(m_valueS); } catch ( Exception ex) { } if (m_typeS.toLowerCase().startsWith("date") && m_typeS.indexOf(":") > 0) { String format=m_typeS.substring(m_typeS.indexOf(":") + 1,m_typeS.length()); m_dateFormat=new SimpleDateFormat(format); if (!m_valueS.toLowerCase().equals("now")) { try { m_parsedDate=m_dateFormat.parse(m_valueS); } catch ( ParseException e) { throw new IllegalArgumentException("Date value \"" + m_valueS + " \" can't be parsed with formatting string \""+ format+ "\""); } } } }
Initialize this attribute spec by resolving any environment variables and setting up the date format (if necessary)
public static ViewAction swipeRightSlow(){ return actionWithAssertions(new GeneralSwipeAction(Swipe.SLOW,translate(GeneralLocation.CENTER_LEFT,EDGE_FUZZ_FACTOR,0),GeneralLocation.CENTER_RIGHT,Press.FINGER)); }
Returns an action that performs a swipe left-to-right across the vertical center of the view. The swipe doesn't start at the very edge of the view, but is a bit offset.<br> <br> View constraints: <ul> <li>must be displayed on screen <ul>
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.
public boolean approveIt(){ log.info("approveIt - " + toString()); setIsApproved(true); return true; }
Approve Document
public StreamCorruptedException(){ super(); }
Create a StreamCorruptedException and list no reason why thrown.
public static byte toByteValue(char c){ return (byte)c; }
cast a char value to a byte value (do nothing)
public int toggle(){ return toggle(ANIMATION_DURATION_MS); }
Tell this view to switch states from cross to plus, or back, using the default animation duration.
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:20.289 -0500",hash_original_method="EB6FF8B38000E2AA8E5468782EF53260",hash_generated_method="E0067301BC4D95F1F82B6EFF8CAC0C89") public void drawBitmap(Bitmap bitmap,Matrix matrix,Paint paint){ addTaint(bitmap.getTaintInt() + matrix.getTaintInt() + paint.getTaintInt()); }
Draw the bitmap using the specified matrix.
public void removeConflictModifiedListener(final ConflictCacheListener listener){ Check.notNull(listener,"listener"); synchronized (listenerLock) { conflictListeners.removeListener(listener,MODIFIED); } }
Remove an existing listener for conflict modified events
public synchronized void addWatch(String filePath,Function<byte[],Void> onUpdate) throws IOException { MorePreconditions.checkNotBlank(filePath); Preconditions.checkNotNull(onUpdate); File file=new File(filePath); ByteSource byteSource=Files.asByteSource(file); onUpdate.apply(byteSource.read()); ConfigFileInfo configFileInfo=watchedFileMap.get(filePath); if (configFileInfo == null) { configFileInfo=new ConfigFileInfo(file.lastModified(),byteSource.hash(HASH_FUNCTION)); watchedFileMap.put(filePath,configFileInfo); } configFileInfo.changeWatchers.add(onUpdate); }
Adds a watch on the specified file. The file must exist, otherwise a FileNotFoundException is returned. If the file is deleted after a watch is established, the watcher will log errors but continue to monitor it, and resume watching if it is recreated.
public void resetPolicy(){ mPreferences.putString(PREF_LAST_RESPONSE,Integer.toString(Policy.RETRY)); setRetryUntil(DEFAULT_RETRY_UNTIL); setMaxRetries(DEFAULT_MAX_RETRIES); setRetryCount(Long.parseLong(DEFAULT_RETRY_COUNT)); setValidityTimestamp(DEFAULT_VALIDITY_TIMESTAMP); mPreferences.commit(); }
We call this to guarantee that we fetch a fresh policy from the server. This is to be used if the URL is invalid.
public Alert updateAlert(BigInteger alertId,Alert alert) throws IOException { String requestUrl=RESOURCE + "/" + alertId.toString(); ArgusResponse response=getClient().executeHttpRequest(ArgusHttpClient.RequestType.PUT,requestUrl,alert); assertValidResponse(response,requestUrl); return fromJson(response.getResult(),Alert.class); }
Updates an existing alert.
Sample acquire(){ Sample acquired=head; if (acquired == null) { acquired=new Sample(); } else { head=acquired.next; } return acquired; }
Acquires a sample from the pool.
public void emit4(int od){ if (!alive) return; if (cp + 4 > code.length) { emit1(od >> 24); emit1(od >> 16); emit1(od >> 8); emit1(od); } else { code[cp++]=(byte)(od >> 24); code[cp++]=(byte)(od >> 16); code[cp++]=(byte)(od >> 8); code[cp++]=(byte)od; } }
Emit four bytes of code.
public boolean isDrawLabels(String graticuleType){ if (graticuleType == null) { String message=Logging.getMessage("nullValue.StringIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } return getRenderingParams(graticuleType).isDrawLabels(); }
Returns whether specified graticule labels will be rendered.
public static String formatPeriodISO(final long startMillis,final long endMillis){ return formatPeriod(startMillis,endMillis,ISO_EXTENDED_FORMAT_PATTERN,false,TimeZone.getDefault()); }
<p>Formats the time gap as a string.</p> <p>The format used is the ISO 8601 period format.</p>
public static boolean deleteDir(final File self){ if (!self.exists()) return true; if (!self.isDirectory()) return false; File[] files=self.listFiles(); if (files == null) return false; boolean result=true; for ( File file : files) { if (file.isDirectory()) { if (!deleteDir(file)) result=false; } else { if (!file.delete()) result=false; } } if (!self.delete()) result=false; return result; }
Deletes a directory with all contained files and subdirectories. <p>The method returns <ul> <li>true, when deletion was successful</li> <li>true, when it is called for a non existing directory</li> <li>false, when it is called for a file which isn't a directory</li> <li>false, when directory couldn't be deleted</li> </ul>
private double[] determineMinMaxDistance(Relation<ParameterizationFunction> relation,int dimensionality){ double[] min=new double[dimensionality - 1]; double[] max=new double[dimensionality - 1]; Arrays.fill(max,Math.PI); HyperBoundingBox box=new HyperBoundingBox(min,max); double d_min=Double.POSITIVE_INFINITY; double d_max=Double.NEGATIVE_INFINITY; for (DBIDIter iditer=relation.iterDBIDs(); iditer.valid(); iditer.advance()) { ParameterizationFunction f=relation.get(iditer); HyperBoundingBox minMax=f.determineAlphaMinMax(box); double f_min=f.function(SpatialUtil.getMin(minMax)); double f_max=f.function(SpatialUtil.getMax(minMax)); d_min=Math.min(d_min,f_min); d_max=Math.max(d_max,f_max); } return new double[]{d_min,d_max}; }
Determines the minimum and maximum function value of all parameterization functions stored in the specified database.
public ModbusException(){ super(); }
Constructs a new <tt>ModbusException</tt> instance.
public static NbtOutputStream writeDeflated(NbtTag tag,File file,boolean append) throws IOException { createFile(file); NbtOutputStream out=new NbtOutputStream(new DeflaterOutputStream(new FileOutputStream(file,append))); out.write(tag); return out; }
Create new deflated nbt output stream for given file, and write nbt tag to it.
public void testSpecDoc() throws Exception { ObjectMapper m=new ObjectMapper(); JsonNode tree=m.readTree(SAMPLE_DOC_JSON_SPEC); JsonParser jp=tree.traverse(); verifyJsonSpecSampleDoc(jp,true); }
Unit test that verifies that we can (re)parse sample document from JSON specification.
public TreeNode(String name,TreeNode parent){ super(); this.name=name; this.parent=parent; if (this.parent != null) this.parent.addChild(this); }
Construct a new node with the specified parent.
protected void handleSpillSlot(Interval interval){ assert interval.location() != null && (interval.canMaterialize() || isStackSlotValue(interval.location())) : "interval not assigned to a stack slot " + interval; }
This is called for every interval that is assigned to a stack slot.
private static boolean parse(XMLTokener x,JSONObject context,String name) throws JSONException { char c; int i; JSONObject jsonobject=null; String string; String tagName; Object token; token=x.nextToken(); if (token == BANG) { c=x.next(); if (c == '-') { if (x.next() == '-') { x.skipPast("-->"); return false; } x.back(); } else if (c == '[') { token=x.nextToken(); if ("CDATA".equals(token)) { if (x.next() == '[') { string=x.nextCDATA(); if (string.length() > 0) { context.accumulate("content",string); } return false; } } throw x.syntaxError("Expected 'CDATA['"); } i=1; do { token=x.nextMeta(); if (token == null) { throw x.syntaxError("Missing '>' after '<!'."); } else if (token == LT) { i+=1; } else if (token == GT) { i-=1; } } while (i > 0); return false; } else if (token == QUEST) { x.skipPast("?>"); return false; } else if (token == SLASH) { token=x.nextToken(); if (name == null) { throw x.syntaxError("Mismatched close tag " + token); } if (!token.equals(name)) { throw x.syntaxError("Mismatched " + name + " and "+ token); } if (x.nextToken() != GT) { throw x.syntaxError("Misshaped close tag"); } return true; } else if (token instanceof Character) { throw x.syntaxError("Misshaped tag"); } else { tagName=(String)token; token=null; jsonobject=new JSONObject(); for (; ; ) { if (token == null) { token=x.nextToken(); } if (token instanceof String) { string=(String)token; token=x.nextToken(); if (token == EQ) { token=x.nextToken(); if (!(token instanceof String)) { throw x.syntaxError("Missing value"); } jsonobject.accumulate(string,XML.stringToValue((String)token)); token=null; } else { jsonobject.accumulate(string,""); } } else if (token == SLASH) { if (x.nextToken() != GT) { throw x.syntaxError("Misshaped tag"); } if (jsonobject.length() > 0) { context.accumulate(tagName,jsonobject); } else { context.accumulate(tagName,""); } return false; } else if (token == GT) { for (; ; ) { token=x.nextContent(); if (token == null) { if (tagName != null) { throw x.syntaxError("Unclosed tag " + tagName); } return false; } else if (token instanceof String) { string=(String)token; if (string.length() > 0) { jsonobject.accumulate("content",XML.stringToValue(string)); } } else if (token == LT) { if (parse(x,jsonobject,tagName)) { if (jsonobject.length() == 0) { context.accumulate(tagName,""); } else if (jsonobject.length() == 1 && jsonobject.opt("content") != null) { context.accumulate(tagName,jsonobject.opt("content")); } else { context.accumulate(tagName,jsonobject); } return false; } } } } else { throw x.syntaxError("Misshaped tag"); } } } }
Scan the content following the named tag, attaching it to the context.
public FloatMemberValue(float f,ConstPool cp){ super('F',cp); setValue(f); }
Constructs a float constant value.
public LabelNode gotoLabel(final LabelNode l){ Instantiation owner=findOwner(instructions.indexOf(l)); return owner.rangeTable.get(l); }
Looks up the label <code>l</code> in the <code>gotoTable</code>, thus translating it from a Label in the original code, to a Label in the inlined code that is appropriate for use by an instruction that branched to the original label.
void start(){ startTime=System.nanoTime(); }
Start recording time.
public Executor distributeOnAllCores(){ return distributeOn(Runtime.getRuntime().availableProcessors()); }
Enables this executor to distribute solution evaluations across all processors on the local host.
public static String left(String s,int width,char fillChar){ if (s.length() >= width) { return s; } StringBuffer sb=new StringBuffer(width); sb.append(s); for (int i=width - s.length(); --i >= 0; ) { sb.append(fillChar); } return sb.toString(); }
Left justify a string.
public void addChartSettingsListener(ChartSettingsListener listener){ if (settingsListenerList == null) { settingsListenerList=new ArrayList<ChartSettingsListener>(); } settingsListenerList.add(listener); }
Add a ChartSettings listener.
private void visitIndirectInvocation(Tree.InvocationExpression that){ Tree.Term primary=unwrapExpressionUntilTerm(that.getPrimary()); if (primary == null) { return; } Type pt=primary.getTypeModel(); if (!isTypeUnknown(pt)) { if (that.getNamedArgumentList() != null) { that.addError("named arguments not supported for indirect invocations"); return; } Tree.PositionalArgumentList pal=that.getPositionalArgumentList(); if (pal == null) { return; } if (pt.isNothing()) { that.setTypeModel(unit.getNothingType()); } else if (checkCallable(pt,primary,"invoked expression must be callable")) { Interface cd=unit.getCallableDeclaration(); List<Type> typeArgs=pt.getSupertype(cd).getTypeArgumentList(); if (!typeArgs.isEmpty()) { that.setTypeModel(typeArgs.get(0)); } if (typeArgs.size() >= 2) { Type paramTypesAsTuple=typeArgs.get(1); if (paramTypesAsTuple != null) { TypeDeclaration pttd=paramTypesAsTuple.getDeclaration(); if (pttd instanceof ClassOrInterface && (pttd.isEmpty() || pttd.isTuple() || pttd.isSequence()|| pttd.isSequential())) { checkIndirectInvocationArguments(that,paramTypesAsTuple,unit.getTupleElementTypes(paramTypesAsTuple),unit.isTupleLengthUnbounded(paramTypesAsTuple),unit.isTupleVariantAtLeastOne(paramTypesAsTuple),unit.getTupleMinimumLength(paramTypesAsTuple)); } else { Type tt=getTupleType(pal.getPositionalArguments(),unit,false); checkAssignable(tt,paramTypesAsTuple,pal,"argument list type must be assignable to parameter list type"); } } } } } }
Typecheck an indirect invocation.
public void append(ExtendedPathIterator epi,boolean connect){ float[] vals=new float[7]; while (!epi.isDone()) { Arrays.fill(vals,0); int type=epi.currentSegment(vals); epi.next(); if (connect && (numVals != 0)) { if (type == PathIterator.SEG_MOVETO) { float x=vals[0]; float y=vals[1]; if ((x != cx) || (y != cy)) { type=PathIterator.SEG_LINETO; } else { if (epi.isDone()) break; type=epi.currentSegment(vals); epi.next(); } } connect=false; } switch (type) { case PathIterator.SEG_CLOSE: closePath(); break; case PathIterator.SEG_MOVETO: moveTo(vals[0],vals[1]); break; case PathIterator.SEG_LINETO: lineTo(vals[0],vals[1]); break; case PathIterator.SEG_QUADTO: quadTo(vals[0],vals[1],vals[2],vals[3]); break; case PathIterator.SEG_CUBICTO: curveTo(vals[0],vals[1],vals[2],vals[3],vals[4],vals[5]); break; case ExtendedPathIterator.SEG_ARCTO: arcTo(vals[0],vals[1],vals[2],(vals[3] != 0),(vals[4] != 0),vals[5],vals[6]); break; } } }
Delegates to the enclosed <code>GeneralPath</code>.
public static long[] parseDateTime(long val){ if ((val != 0) && (val <= 100)) { throw new InvalidDateFormatException("date",Long.toString(val)); } if (val < DATETIME_MONTH_SCALE) { val*=DATETIME_DATE_SCALE; } long[] dt=decodeDateTime(val); if (val != 0) { dt[YEAR_INDEX]=adjustTwoDigitYear(dt[YEAR_INDEX]); } if (!isValidDateTime_Zeros(dt)) { throw new InvalidDateFormatException("date",Long.toString(val)); } if (!isValidHrMinSec(dt,true,true)) { throw new InvalidDateFormatException("datetime",Long.toString(val)); } return dt; }
Parse an *external* datetime long (e.g. YYYYMMDDHHMMSS => 20130130) into a array.
public void buildPanel(){ GridBagLayout gridBagLayout=new GridBagLayout(); gridBagLayout.columnWidths=new int[]{10,89,60,10}; gridBagLayout.rowHeights=new int[]{20,0,15,20,0,0,15,0,0,0}; gridBagLayout.columnWeights=new double[]{0.0,1.0,0.0,0.0}; gridBagLayout.rowWeights=new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0}; setLayout(gridBagLayout); childOneEnergySpinner=new JSpinner(); childOneEnergySpinner.setPreferredSize(new Dimension(50,20)); ButtonGroup lifeModeButtonGroup=new ButtonGroup(); JLabel lblMaxLifespan=new JLabel("Max self-destruct age"); GridBagConstraints gbc_lblMaxLifespan=new GridBagConstraints(); gbc_lblMaxLifespan.anchor=GridBagConstraints.WEST; gbc_lblMaxLifespan.insets=new Insets(0,0,5,5); gbc_lblMaxLifespan.gridx=1; gbc_lblMaxLifespan.gridy=1; add(lblMaxLifespan,gbc_lblMaxLifespan); maxLifespanSpinner=new JSpinner(); maxLifespanSpinner.setPreferredSize(new Dimension(50,20)); GridBagConstraints gbc_maxLifespanSpinner=new GridBagConstraints(); gbc_maxLifespanSpinner.fill=GridBagConstraints.HORIZONTAL; gbc_maxLifespanSpinner.anchor=GridBagConstraints.NORTH; gbc_maxLifespanSpinner.insets=new Insets(0,0,5,5); gbc_maxLifespanSpinner.gridx=2; gbc_maxLifespanSpinner.gridy=1; add(maxLifespanSpinner,gbc_maxLifespanSpinner); JLabel childOneEnergyLabel=new JLabel("Min childbearing age"); GridBagConstraints gbc_childOneEnergyLabel=new GridBagConstraints(); gbc_childOneEnergyLabel.anchor=GridBagConstraints.WEST; gbc_childOneEnergyLabel.insets=new Insets(0,0,5,5); gbc_childOneEnergyLabel.gridx=1; gbc_childOneEnergyLabel.gridy=3; add(childOneEnergyLabel,gbc_childOneEnergyLabel); GridBagConstraints gbc_childOneEnergySpinner=new GridBagConstraints(); gbc_childOneEnergySpinner.fill=GridBagConstraints.HORIZONTAL; gbc_childOneEnergySpinner.anchor=GridBagConstraints.NORTH; gbc_childOneEnergySpinner.insets=new Insets(0,0,5,5); gbc_childOneEnergySpinner.gridx=2; gbc_childOneEnergySpinner.gridy=3; add(childOneEnergySpinner,gbc_childOneEnergySpinner); childTwoEnergySpinner=new JSpinner(); childTwoEnergySpinner.setPreferredSize(new Dimension(50,20)); JLabel childTwoEnergyLabel=new JLabel("Min 1st - 2nd child age"); GridBagConstraints gbc_childTwoEnergyLabel=new GridBagConstraints(); gbc_childTwoEnergyLabel.anchor=GridBagConstraints.WEST; gbc_childTwoEnergyLabel.insets=new Insets(0,0,5,5); gbc_childTwoEnergyLabel.gridx=1; gbc_childTwoEnergyLabel.gridy=4; add(childTwoEnergyLabel,gbc_childTwoEnergyLabel); GridBagConstraints gbc_childTwoEnergySpinner=new GridBagConstraints(); gbc_childTwoEnergySpinner.fill=GridBagConstraints.HORIZONTAL; gbc_childTwoEnergySpinner.anchor=GridBagConstraints.NORTH; gbc_childTwoEnergySpinner.insets=new Insets(0,0,5,5); gbc_childTwoEnergySpinner.gridx=2; gbc_childTwoEnergySpinner.gridy=4; add(childTwoEnergySpinner,gbc_childTwoEnergySpinner); childThreeEnergySpinner=new JSpinner(); childThreeEnergySpinner.setPreferredSize(new Dimension(50,20)); JLabel childThreeEnergyLabel=new JLabel("Min age btw ++ children"); GridBagConstraints gbc_childThreeEnergyLabel=new GridBagConstraints(); gbc_childThreeEnergyLabel.anchor=GridBagConstraints.WEST; gbc_childThreeEnergyLabel.insets=new Insets(0,0,5,5); gbc_childThreeEnergyLabel.gridx=1; gbc_childThreeEnergyLabel.gridy=5; add(childThreeEnergyLabel,gbc_childThreeEnergyLabel); GridBagConstraints gbc_childThreeEnergySpinner=new GridBagConstraints(); gbc_childThreeEnergySpinner.fill=GridBagConstraints.HORIZONTAL; gbc_childThreeEnergySpinner.insets=new Insets(0,0,5,5); gbc_childThreeEnergySpinner.anchor=GridBagConstraints.NORTH; gbc_childThreeEnergySpinner.gridx=2; gbc_childThreeEnergySpinner.gridy=5; add(childThreeEnergySpinner,gbc_childThreeEnergySpinner); lblSproutMode=new JLabel("Sprout Mode (Show Seeds)"); GridBagConstraints gbc_lblSproutMode=new GridBagConstraints(); gbc_lblSproutMode.anchor=GridBagConstraints.WEST; gbc_lblSproutMode.insets=new Insets(0,0,5,5); gbc_lblSproutMode.gridx=1; gbc_lblSproutMode.gridy=7; add(lblSproutMode,gbc_lblSproutMode); panel=new JPanel(); GridBagConstraints gbc_panel=new GridBagConstraints(); gbc_panel.gridwidth=2; gbc_panel.insets=new Insets(0,0,5,5); gbc_panel.fill=GridBagConstraints.BOTH; gbc_panel.gridx=1; gbc_panel.gridy=8; add(panel,gbc_panel); GridBagLayout gbl_panel=new GridBagLayout(); gbl_panel.columnWidths=new int[]{30,40,40,0}; gbl_panel.rowHeights=new int[]{0,0}; gbl_panel.columnWeights=new double[]{1.0,0.0,0.0,Double.MIN_VALUE}; gbl_panel.rowWeights=new double[]{0.0,Double.MIN_VALUE}; panel.setLayout(gbl_panel); ButtonGroup sproutModeButtonGroup=new ButtonGroup(); rdbtnFunctional=new JRadioButton("Functional"); sproutModeButtonGroup.add(rdbtnFunctional); rdbtnFunctional.setToolTipText("<html>Seeds are immediately replaced<br>by sprouts before being shown.<br>More efficient for reproduction.</html>"); rdbtnFunctional.setSelected(true); rdbtnFunctional.setAlignmentX(1.0f); GridBagConstraints gbc_radioButton=new GridBagConstraints(); gbc_radioButton.anchor=GridBagConstraints.EAST; gbc_radioButton.insets=new Insets(0,0,0,5); gbc_radioButton.gridx=1; gbc_radioButton.gridy=0; panel.add(rdbtnFunctional,gbc_radioButton); rdbtnVisual=new JRadioButton("Visual"); sproutModeButtonGroup.add(rdbtnVisual); rdbtnVisual.setToolTipText("<html>Seeds are displayed but an<br>extra step is added to show them.</html>"); GridBagConstraints gbc_rdbtnVisual=new GridBagConstraints(); gbc_rdbtnVisual.anchor=GridBagConstraints.EAST; gbc_rdbtnVisual.gridx=2; gbc_rdbtnVisual.gridy=0; panel.add(rdbtnVisual,gbc_rdbtnVisual); }
Create the panel.
String buildUnionSubQuery(String typeDiscriminatorColumn,String[] unionColumns,Set<String> columnsPresentInTable,int computedColumnsOffset,String typeDiscriminatorValue,String selection,String[] selectionArgs,String groupBy,String having){ return null; }
Return the SELECT UNION statement for the given parameters.
public AuthorityKeyIdentifier(byte[] keyIdentifier){ this(keyIdentifier,null,null); }
create an AuthorityKeyIdentifier with a precomputed key identifier
private boolean checkConditions(final List<AcceptabilityCondition> conditions){ for ( AcceptabilityCondition condition : conditions) { AcceptabilityCondition.Fullfillment fullfillment=condition.getFullfillment(passages); if (fullfillment.isFullfilled()) { fullfilledConditions.put(condition,new TripInfo(fullfillment)); } } passages=null; return fullfilledConditions.size() > 0; }
Checks conditions, stores results and clean the list of passages.
protected String url(int zoomLevel,int xTile,int yTile){ StringBuilder sb=new StringBuilder(_url); sb.append("/"); sb.append(zoomLevel); sb.append("/"); sb.append(xTile); sb.append("/"); sb.append(yTile); sb.append(".png"); return sb.toString(); }
build a url request for a tile
public MatrixDrawable(Drawable drawable,Matrix matrix){ super(Preconditions.checkNotNull(drawable)); mMatrix=matrix; }
Creates a new MatrixDrawable with given underlying drawable and matrix.
@OnMessage public void echoPongMessage(PongMessage pm){ }
Process a received pong. This is a NO-OP.
public double localScore(int i,int... parents){ for ( int p : parents) if (forbidden.contains(p)) return Double.NaN; double residualVariance=covariances.get(i,i); int n=getSampleSize(); int p=parents.length; Matrix covxx=getSelection1(covariances,parents); try { Matrix covxxInv=covxx.inverse(); Matrix covxy=getSelection2(covariances,parents,i); Matrix b=covxxInv.times(covxy); double dot=0.0; for (int j=0; j < covxy.getRowDimension(); j++) { for (int k=0; k < covxy.getColumnDimension(); k++) { dot+=covxy.get(j,k) * b.get(j,k); } } residualVariance-=dot; if (residualVariance <= 0) { if (isVerbose()) { out.println("Nonpositive residual varianceY: resVar / varianceY = " + (residualVariance / covariances.get(i,i))); } return Double.NaN; } double c=getPenaltyDiscount(); return score(residualVariance,n,logn,p,c); } catch ( Exception e) { boolean removedOne=true; while (removedOne) { List<Integer> _parents=new ArrayList<>(); for (int y=0; y < parents.length; y++) _parents.add(parents[y]); _parents.removeAll(forbidden); parents=new int[_parents.size()]; for (int y=0; y < _parents.size(); y++) parents[y]=_parents.get(y); removedOne=printMinimalLinearlyDependentSet(parents,covariances); } return Double.NaN; } }
Calculates the sample likelihood and BIC score for i given its parents in a simple SEM model
public boolean isValidName(){ String _name=this.getName(); boolean _equals=Objects.equal("prototype",_name); if (_equals) { return false; } return true; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public TextNode textNode(String text){ return TextNode.valueOf(text); }
Factory method for constructing a node that represents JSON String value
void log(Resources resources,int... rules){ final ArrayDeque<Node> roots=findRoots(rules); for ( Node node : roots) { printNode(resources,node); } }
Prints the dependency graph for the specified rules.
public CCAccelDeccelAmplitude(CCIntervalAction action,float d){ super(d); rate=1.0f; other=action; }
initializes the action with an inner action that has the amplitude property, and a duration time
public BoolQueryBuilder disableCoord(boolean disableCoord){ this.disableCoord=disableCoord; return this; }
Disables <tt>Similarity#coord(int,int)</tt> in scoring. Defaults to <tt>false</tt>.
public static boolean isValidIfd(int ifdId){ return ifdId == IfdId.TYPE_IFD_0 || ifdId == IfdId.TYPE_IFD_1 || ifdId == IfdId.TYPE_IFD_EXIF || ifdId == IfdId.TYPE_IFD_INTEROPERABILITY || ifdId == IfdId.TYPE_IFD_GPS; }
Returns true if the given IFD is a valid IFD.
private SignatureLibraryRelease loadTMHMMRelease(){ SignatureLibraryRelease release=null; final Query releaseQuery=entityManager.createQuery("select r from SignatureLibraryRelease r where r.version = :version and r.library = :signatureLibrary"); releaseQuery.setParameter("version",signatureLibraryRelease.getVersion()); releaseQuery.setParameter("signatureLibrary",signatureLibraryRelease.getLibrary()); @SuppressWarnings("unchecked") List<SignatureLibraryRelease> releaseList=releaseQuery.getResultList(); if (releaseList.size() == 1 && releaseList.get(0) != null) { release=releaseList.get(0); } else if (releaseList.size() > 1) { throw new IllegalStateException("There is more than one SignatureLibraryRelease record for version " + signatureLibraryRelease.getVersion() + " of TMHMM in the databases."); } else { entityManager.persist(new SignatureLibraryRelease(signatureLibraryRelease.getLibrary(),signatureLibraryRelease.getVersion())); } return release; }
This private method is responsible for retrieving OR persisting (as appropriate) a SignatureLibraryRelease method for the version of TMHMM being handled by this DAO.
private void addHyperlinkToken(int start,int end,int tokenType){ int so=start + offsetShift; addToken(zzBuffer,start,end,tokenType,so,true); }
Adds the token specified to the current linked list of tokens.
public static void main(final String[] args){ DOMTestCase.doMain(hasAttributes01.class,args); }
Runs this test from the command line.
public static void enableLodControl(Camera camera,Node rootNode){ Terrain terrain=(Terrain)findTerrain(rootNode); if (terrain == null) return; TerrainLodControl control=((Spatial)terrain).getControl(TerrainLodControl.class); if (control != null) { control.setCamera(camera); } }
Re-attach the camera to the LOD control. Called when the scene is opened and will only update the control if there is already a terrain present in the scene.
public EditableOMLine(GraphicAttributes ga){ createGraphic(ga); }
Create an EditableOMLine with the lineType and renderType parameters in the GraphicAttributes object.
private String eFormatString(final double x,final char eChar){ final char[] ca4; final char[] ca5; if (Double.isInfinite(x)) { if (x == Double.POSITIVE_INFINITY) { if (leadingSign) { ca4="+Inf".toCharArray(); } else if (leadingSpace) { ca4=" Inf".toCharArray(); } else { ca4="Inf".toCharArray(); } } else { ca4="-Inf".toCharArray(); } } else if (Double.isNaN(x)) { if (leadingSign) { ca4="+NaN".toCharArray(); } else if (leadingSpace) { ca4=" NaN".toCharArray(); } else { ca4="NaN".toCharArray(); } } else { ca4=eFormatDigits(x,eChar); } ca5=applyFloatPadding(ca4,false); return new String(ca5); }
An intermediate routine on the way to creating an e format String. The method decides whether the input double value is an infinity, not-a-number, or a finite double and formats each type of input appropriately.
private double clipCurrentIndex(double currentIndex){ if (moveRate > 0) { return Math.min(currentIndex,endIndex); } else { return Math.max(currentIndex,startIndex); } }
Ensure the current position in clipped to the line
private void updateStateView(CSP csp,Assignment assignment){ Platform.runLater(null); simPaneCtrl.waitAfterStep(); }
Caution: While the background thread should be slowed down, updates of the GUI have to be done in the GUI thread!
public static void updateNextRun(int etlJobId,String cronExprStr,Date startTime) throws Exception { Time.CronExpression cronExpression=new Time.CronExpression(cronExprStr); Date nextTime=cronExpression.getNextValidTimeAfter(startTime); updateNextRun(etlJobId,nextTime); }
Update the next run time for the etl job using Quartz cron expression