code
stringlengths
10
174k
nl
stringlengths
3
129k
public static <T extends Date>String dateTimeFrom(T dateTime){ checkNotNull(dateTime); return dateTimeFrom(new DateTime(dateTime)); }
-->2014-9-2 03:00:00
public StringBuilder format(final StringBuilder sb,final float w){ final int initPosition=sb.length(); if (Float.isNaN(w)) { sb.append("NaN"); } else if (Float.isInfinite(w)) { sb.append(w < 0.0 ? "-Infinity" : "Infinity"); } else { sb.append(mLocalFormat.format(w)); } final int currLength=s...
Format float into StringBuilder
private void writeQName(javax.xml.namespace.QName qname,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI=qname.getNamespaceURI(); if (namespaceURI != null) { java.lang.String prefix=xmlWriter.getPrefix(namespaceURI); if (prefix == null) {...
method to handle Qnames
private void openCategorySelection(){ CategorySelectionDialogFragment categorySelectionDialogFragment=CategorySelectionDialogFragment.newInstance(categories); categorySelectionDialogFragment.show(getChildFragmentManager(),"CategorySelectionDialogFragment"); }
Creates and shows the category selection dialog fragment.
private TaskList pauseMirrors(URI id,String sync,URI copyID){ Volume sourceVolume=queryVolumeResource(id); ArgValidator.checkEntity(sourceVolume,id,true); StringSet mirrors=sourceVolume.getMirrors(); if (mirrors == null || mirrors.isEmpty()) { throw APIException.badRequests.invalidParameterVolumeHasNoContin...
Pause the specified mirror(s) for the source volume
public static int indexOf(boolean[] array,boolean[] sub){ return indexOf(array,sub,0,array.length); }
Finds the first occurrence in an array.
public static void addCmdDirToPathEnv(Path cmdExePath,ProcessBuilder pb){ Location cmdLoc=Location.createValidOrNull(cmdExePath); if (cmdLoc == null) { return; } cmdLoc=cmdLoc.getParent(); if (cmdLoc == null) { return; } addLocationToPathEnv(cmdLoc,pb); }
Add the parent directory of given cmdExePath to the PATH. This helps workaround certain tool issues on some OSes like OS X. See for example: https://github.com/GoClipse/goclipse/issues/91#issuecomment-82555504 or: https://github.com/RustDT/RustDT/issues/31
public boolean replaceIn(final StringBuffer source){ if (source == null) { return false; } return replaceIn(source,0,source.length()); }
Replaces all the occurrences of variables within the given source buffer with their matching values from the resolver. The buffer is updated with the result.
ClientResponse put(URI uri,String body){ return setResourceHeaders(_client.resource(uri)).type(MediaType.TEXT_XML).put(ClientResponse.class,body); }
PUT to the resource at the passed URI.
public static String inflate(String name){ return inflate(name,gPrefix); }
Inflate a short name into a full GData URI using gPrefix (ending in "#"). Names that already look like URIs are left alone. For example, "foo" becomes "http://schemas.google.com/g/2005#foo".
public CProjectViewGenerator(final SQLProvider provider,final INaviProject project){ m_provider=Preconditions.checkNotNull(provider,"IE00272: provider argument can not be null"); m_project=Preconditions.checkNotNull(project,"IE00452: project argument can not be null"); }
Creates a new generator object.
public Vset checkAssignOp(Environment env,Context ctx,Vset vset,Hashtable exp,Expression outside){ vset=right.checkAssignOp(env,ctx,vset,exp,outside); type=right.type; return vset; }
Check the expression if it appears as an lvalue. We just pass it on to our unparenthesized subexpression. (Part of fix for 4090372)
private void initializeInDir(int x,int y,int dir){ initializeHex(Coords.xInDir(x,y,dir),Coords.yInDir(x,y,dir)); }
Initializes a hex in a specific direction from an origin hex
private PhysicalNAS findPhysicalNasByNativeId(final StorageSystem system,DbClient dbClient,String nativeId){ URIQueryResultList results=new URIQueryResultList(); PhysicalNAS physicalNas=null; String nasNativeGuid=NativeGUIDGenerator.generateNativeGuid(system,nativeId,NativeGUIDGenerator.PHYSICAL_NAS); dbClient....
find DM or NAS from db using native id
@Override public void scan(InH3Amp in,PathH3Amp path,Object[] values){ int ch=read(); switch (ch) { case 0xd0: readDefinition(in); scan(in,path,values); return; case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xd...
Scan for a query.
private ServerUpdateInfo readServerUpdateInfoFromFile(Context context){ String uniqueServerId=getServerUniqueId(); Object serializedServerInfoObject=SerializableManager.readSerializedObject(context,SERIALIZE_UPDATE_FILE_PREFIX + uniqueServerId + SERIALIZE_CONFIG_FILE_EXTENSION); if (serializedServerInfoObject != ...
Reads this server update info from a file
@Override public long skip(long byteCount){ Preconditions.checkArgument(byteCount >= 0); int skipped=Math.min((int)byteCount,available()); mOffset+=skipped; return skipped; }
Skips byteCount (or however many bytes are available) bytes in the stream
public static String unescapeMySQLString(String s) throws IllegalArgumentException { char chars[]=s.toCharArray(); if (chars.length < 2 || chars[0] != chars[chars.length - 1] || (chars[0] != '\'' && chars[0] != '"')) { throw new IllegalArgumentException("not a valid MySQL string: " + s); } int j=1; int f=...
Unescape any MySQL escape sequences. See MySQL language reference Chapter 6 at <a href="http://www.mysql.com/doc/">http://www.mysql.com/doc/</a>. This function will <strong>not</strong> work for other SQL-like dialects.
@Override public void execute(StepInstance stepInstance,String temporaryFileDirectory){ delayForNfs(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Running Parser HMMER2 Output Step for proteins " + stepInstance.getBottomProtein() + " to "+ stepInstance.getTopProtein()); } InputStream is=null; try { f...
This method is called to execute the action that the StepInstance must perform.
public static ImmutableList<Statement> siteLink(String entityId,String link,String language,boolean outOfOrder){ if (outOfOrder) { return ImmutableList.of(statement(link,SchemaDotOrg.IN_LANGUAGE,new LiteralImpl(language)),statement(link,SchemaDotOrg.ABOUT,entityId),statement(link,RDF.TYPE,SchemaDotOrg.ARTICLE)); ...
Build the statements describing a sitelink.
private IDocument acquireDocument(final IProgressMonitor monitor) throws CoreException { if (fCount > 0) return fBuffer.getDocument(); final ITextFileBufferManager manager=FileBuffers.getTextFileBufferManager(); final IPath path=fFile.getFullPath(); manager.connect(path,LocationKind.IFILE,monitor); fCount++...
Acquires a document from the file buffer manager.
public BOSHPacketReader(BOSHConnection connection){ this.connection=connection; }
Create a packet reader which listen on a BOSHConnection for received HTTP responses, parse the packets and notifies the connection.
private double[] calculateValues(Function function,double[][] points){ double values[]=new double[points.length]; for (int i=0; i < points.length; i++) { values[i]=function.valueAt(points[i]); } return values; }
Calculate the values of function at points
public boolean equalsStatusCode(StatusCode statusCode){ return isStatusCode(statusCode.getValue()); }
Check if the status codes equal to severity and subcode, ignoring the lowest bits of the code.
protected int dismissPermissionRationale(){ if (rationaleView != null && rationaleView.getVisibility() == View.VISIBLE) { rationaleView.setVisibility(View.GONE); return (int)rationaleView.getTag(); } return 0; }
Dismiss and returns the action associated to the rationale
private static String toFieldName(String node){ return node.toUpperCase().replaceAll("-","_"); }
Translate a node to a java field name
public void ensureStartedAndUpdateRegisteredTypes(){ mStarted=true; ensureGcmIsInitialized(); mEnableSessionInvalidationsTimer.resume(); HashSet<Integer> typesToRegister=new HashSet<Integer>(); typesToRegister.addAll(ProfileSyncService.get().getPreferredDataTypes()); if (!mSessionInvalidationsEnabled) { ...
Updates the sync invalidation types that the client is registered for based on the preferred sync types. Starts the client if needed.
public void testMovePointRightException(){ String a="12312124789874829887348723648726347429808779810457634781384756794987"; int aScale=Integer.MAX_VALUE; int shift=-18; BigDecimal aNumber=new BigDecimal(new BigInteger(a),aScale); try { aNumber.movePointRight(shift); fail("ArithmeticException has not b...
Move the decimal point to the right when the scale overflows
private void validate(){ if (values != null) return; values=new Values(); final AppContext ctx=AppContext.getAppContext(); Map<String,TreeMap<String,Object>> compiledDefaults=(Map<String,TreeMap<String,Object>>)ctx.get("SeaGlassStyle.defaults"); if (compiledDefaults == null) { compiledDefaults=new HashM...
Pulls data out of UIDefaults, if it has not done so already, and sets up the internal state.
public static double[][] randomUniform(int m,int n,double min,double max){ double[][] A=new double[m][n]; for (int i=0; i < A.length; i++) for (int j=0; j < A[i].length; j++) A[i][j]=Random.uniform(min,max); return A; }
Create an m x n matrix of uniformly distributed random numbers between two bounds.
@Override public int hashCode(){ final int prime=31; int result=1; result=prime * result + count; result=prime * result + offsetValue; result=prime * result + tag; result=prime * result + ((type == null) ? 0 : type.hashCode()); return result; }
Returns the calculated hash code for this object.
protected String doIt() throws java.lang.Exception { StringBuffer sql=null; int no=0; String clientCheck=getWhereClause(); if (m_deleteOldImported) { sql=new StringBuffer("DELETE I_BPartner " + "WHERE I_IsImported='Y'").append(clientCheck); no=DB.executeUpdateEx(sql.toString(),get_TrxName()); log.fi...
Perform process.
public CertificateParsingException(){ super(); }
Constructs a CertificateParsingException with no detail message. A detail message is a String that describes this particular exception.
protected Resources fetchResourceFile(){ try { if (resourceFile != null) { return resourceFile; } String p=getResourceFilePath(); if (p.indexOf('.') > -1) { return Resources.open(p); } Resources res=Resources.openLayered(p); if (isKeepResourcesInRam()) { resourceFile=res;...
This method may be overriden by subclasses to provide a way to dynamically load a resource file. Normally the navigation feature of the UIBuilder requires the resource file present in RAM. However, that might be expensive to maintain. By implementing this method and replacing the storeResourceFile() with an empty imple...
public boolean add(Solution solution){ return data.add(solution); }
Adds the specified solution to this population.
protected void parse(String url){ dbType=null; host=null; port=null; dbName=null; if (url.startsWith(MYSQL_PREFIX)) { dbType="mysql"; host="localhost"; port="3306"; Matcher matcher=mysqlPattern.matcher(url); if (matcher.matches()) { if (matcher.group(1) != null && matcher.group(1).le...
Parses the URL using available patterns.
public void testSetBitPositiveInside4(){ byte aBytes[]={1,-128,56,100,-2,-76,89,45,91,3,-15,35,26}; int aSign=1; int number=50; byte rBytes[]={1,-128,56,100,-2,-76,93,45,91,3,-15,35,26}; BigInteger aNumber=new BigInteger(aSign,aBytes); BigInteger result=aNumber.setBit(number); byte resBytes[]=new byte[rBy...
setBit(int n) inside a positive number
public DDFFieldDefinition findFieldDefn(String pszFieldName){ for (Iterator it=paoFieldDefns.iterator(); it.hasNext(); ) { DDFFieldDefinition ddffd=(DDFFieldDefinition)it.next(); String pszThisName=ddffd.getName(); if (Debug.debugging("iso8211detail")) { Debug.output("DDFModule.findFieldDefn(" + psz...
Fetch the definition of the named field. This function will scan the DDFFieldDefn's on this module, to find one with the indicated field name.
public void show(StackablePath path){ dispatcher.dispatch(add(History.NAV_TYPE_MODAL,path)); }
Show one path as modal
public static Pair<HistoricalIndexLookupStrategy,PollResultIndexingStrategy> determineIndexing(QueryGraph queryGraph,EventType polledViewType,EventType streamViewType,int polledViewStreamNum,int streamViewStreamNum){ QueryGraphValue queryGraphValue=queryGraph.getGraphValue(streamViewStreamNum,polledViewStreamNum); ...
Constructs indexing and lookup strategy for a given relationship that a historical stream may have with another stream (historical or not) that looks up into results of a poll of a historical stream. <p> The term "polled" refers to the assumed-historical stream.
public String download(String siteUrl) throws IOException { URL url=new URL(siteUrl); HttpsURLConnection con=(HttpsURLConnection)url.openConnection(); return dl(con); }
Download (via HTTP) the text file located at the supplied URL, and return its contents. Primarily intended for downloading web pages.
public void testJustDate() throws Exception { Path file=getWorkDir().resolve("one-line"); PerfRunData runData=createPerfRunData(file,false,JustDateDocMaker.class.getName()); WriteLineDocTask wldt=new WriteLineDocTask(runData); wldt.doLogic(); wldt.close(); try (BufferedReader br=Files.newBufferedReader(file...
Fail by default when there's only date
public static byte[] flattenBitmap(Bitmap bitmap){ int size=bitmap.getWidth() * bitmap.getHeight() * 4; ByteArrayOutputStream out=new ByteArrayOutputStream(size); try { bitmap.compress(Bitmap.CompressFormat.PNG,100,out); out.flush(); out.close(); return out.toByteArray(); } catch ( IOException...
Compresses the bitmap to a byte array for serialization.
public boolean execute(String sql) throws SQLException { return executeInternal(sql,false); }
Execute a SQL statement that may return multiple results. We don't have to worry about this since we do not support multiple ResultSets. You can use getResultSet or getUpdateCount to retrieve the result.
@Deprecated public void compactValueNumbers(Dataflow<ValueNumberFrame,ValueNumberAnalysis> dataflow){ if (true) { throw new UnsupportedOperationException(); } }
Compact the value numbers assigned. This should be done only after the dataflow algorithm has executed. This works by modifying the actual ValueNumber objects assigned. After this method is called, the getNumValuesAllocated() method of this object will return a value less than or equal to the value it would have return...
@Override public void addStatement(final Resource s,final URI p,final Value o,final Resource... contexts) throws SailException { if (log.isDebugEnabled()) log.debug("s=" + s + ", p="+ p+ ", o="+ o+ ", contexts="+ Arrays.toString(contexts)); OpenRDFUtil.verifyContextNotNull(contexts); if (contexts.length == 0) {...
Sesame has a concept of a "null" graph. Any statement inserted whose context position is NOT bound will be inserted into the "null" graph. Statements inserted into the "null" graph are visible from the SPARQL default graph, when no data set is specified (in this case all statements in all contexts are visible).
synchronized void receive(char oneChar) throws IOException { if (buffer == null) { throw new IOException("Pipe is closed"); } if (lastReader != null && !lastReader.isAlive()) { throw new IOException("Pipe broken"); } lastWriter=Thread.currentThread(); try { while (buffer != null && out == in) { ...
Receives a char and stores it into the PipedReader. This called by PipedWriter.write() when writes occur. <P> If the buffer is full and the thread sending #receive is interrupted, the InterruptedIOException will be thrown.
public ASN1InputStream(InputStream input,int limit,boolean lazyEvaluate){ super(input); this.limit=limit; this.lazyEvaluate=lazyEvaluate; this.tmpBuffers=new byte[11][]; }
Create an ASN1InputStream where no DER object will be longer than limit, and constructed objects such as sequences will be parsed lazily.
public static AvedevProjectionExpression avedevDistinct(Expression expression){ return new AvedevProjectionExpression(expression,false); }
Mean deviation function considering distinct values only.
private static Box createLabel(String text){ Box box=Box.createHorizontalBox(); box.add(new JLabel(text)); box.add(Box.createHorizontalGlue()); return box; }
Creates a left-aligned label.
private void enrichMapWithProducts(final Map<String,Object> map){ final Map<String,ProductSku> products=new HashMap<String,ProductSku>(); for ( final CustomerOrderDet orderDet : ((CustomerOrder)map.get(ROOT)).getOrderDetail()) { final ProductSku sku=productSkuService.getProductSkuBySkuCode(orderDet.getProductS...
Enrich given map with product date.
public static double max(double[] array){ if (array == null) { throw new IllegalArgumentException("The Array must not be null"); } else if (array.length == 0) { throw new IllegalArgumentException("Array cannot be empty."); } double max=array[0]; for (int j=1; j < array.length; j++) { if (Double...
<p>Returns the maximum value in an array.</p>
@Override public void run(){ amIActive=true; String inputFilesString=null; String fileName=null; String inputDataFile=null; String whiteboxHeaderFile=null; String whiteboxDataFile=null; WhiteboxRaster output=null; int i=0; int row, col, rows, cols; String[] imageFiles; int numImages=0; double no...
Used to execute this plugin tool.
@Override public void createUntamperedRequest(){ CollisionDJBX33X DJBX33X=new CollisionDJBX33X(); String untampered=UtilHashDoS.generateUntampered(DJBX33X,optionNumberAttributes.getValue(),optionUseNamespaces.isOn()); String soapMessage=this.getOptionTextAreaSoapMessage().getValue(); String soapMessageFinal=thi...
custom untampered request needed for prevention of false positives based on effect of XML Attribute Count Attack
public String demodulize(String className){ int period=className.lastIndexOf('.'); if (period >= 0) { return className.substring(period + 1); } else { return className; } }
<p> Remove any package name from a fully qualified class name, returning only the simple classname.</p> <table border="1" width="100%"> <tr> <th>Input</th> <th>Output</th> </tr> <tr> <td>"java.util.Map"</td> <td>"Map"</td> </tr> <tr> <td>"String"</td> <td>"String"</td> </tr> </table>
void sendRoleRequest(OFControllerRole role){ try { roleChanger.sendRoleRequest(role,0); } catch ( IOException e) { log.error("Disconnecting switch {} due to IO Error: {}",getSwitchInfoString(),e.getMessage()); mainConnection.disconnect(); } }
Forwards to RoleChanger. See there.
private void add(){ list.addLast(Integer.parseInt(textField.getText())); displayText(); }
Add an integer to the end of the list
public void addAnewarray(String classname){ addOpcode(ANEWARRAY); addIndex(constPool.addClassInfo(classname)); }
Appends ANEWARRAY.
private void updateMultiEdges(){ if (m_multiEdgeUpdatingEnabled) { if (m_graph.getSettings().getEdgeSettings().getDisplayMultipleEdgesAsOne()) { MultiEdgeHider.hideMultipleEdgesInternal(m_graph); } else { MultiEdgeHider.unhideMultipleEdgesInternal(m_graph); } } }
Depending on the state of the multi edge settings option, this function either hides or shows multiple edges between the same nodes.
private boolean allVolumesInSameBackendCG(List<Volume> volumes){ boolean result=true; String replicationGroup=null; int count=0; URI storageUri=null; for ( Volume volume : volumes) { URI cgURI=volume.getConsistencyGroup(); if (NullColumnValueGetter.isNullURI(cgURI)) { result=false; break;...
Check if the volumes are in a CG and in the same backend CG
public static AsciiImgCache create(final Font font,final char[] characters){ Dimension maxCharacterImageSize=calculateCharacterRectangle(font,characters); Map<Character,GrayscaleMatrix> imageCache=createCharacterImages(font,maxCharacterImageSize,characters); return new AsciiImgCache(maxCharacterImageSize,imageCac...
Initialize a new character cache with supplied font.
public Spring addListener(SpringListener newListener){ if (newListener == null) { throw new IllegalArgumentException("newListener is required"); } mListeners.add(newListener); return this; }
add a listener
public void vibrateWithPattern(long[] pattern,int repeat){ AudioManager manager=(AudioManager)this.cordova.getActivity().getSystemService(Context.AUDIO_SERVICE); if (manager.getRingerMode() != AudioManager.RINGER_MODE_SILENT) { Vibrator vibrator=(Vibrator)this.cordova.getActivity().getSystemService(Context.VIBR...
Vibrates the device with a given pattern.
public Object runSafely(Catbert.FastStack stack) throws Exception { return new Long(stack.getUIMgrSafe().getVideoFrame().getVideoHShiftFreq()); }
Gets the video orbiting duration in milliseconds. This is used to shift the video left-to-right very slowly over time. It is used on widescreen displays to prevent screen burn when watching 4:3 content.
private void duplicateRow(int yDest,int ySrc){ for (int i=0; i < width; i++) { setPixel(i,yDest,getPixel(i,ySrc,line,newData)); } }
get a byte of pixels
@Override public void onGetUserIdResponse(final GetUserIdResponse getUserIdResponse){ Log.v(TAG,"onGetUserIdResponse recieved: Response -" + getUserIdResponse); Log.v(TAG,"RequestId:" + getUserIdResponse.getRequestId()); Log.v(TAG,"IdRequestStatus:" + getUserIdResponse.getUserIdRequestStatus()); new GetUserIdAs...
Invoked once the call from initiateGetUserIdRequest is completed. On a successful response, a response object is passed which contains the request id, request status, and the userid generated for your application.
private void onMembershipGossip(Message message){ MembershipRecord record=message.data(); LOGGER.debug("Received membership gossip: {}",record); updateMembership(record,false); }
Merges received membership gossip (not spreading gossip further).
public XmlHandler addClass(Class<?> clazz,String... attributes){ Attribute[] listAttributes=new Attribute[attributes.length]; for (int i=attributes.length; i-- > 0; ) listAttributes[i]=new Attribute(attributes[i]); return addClass(clazz,listAttributes); }
This method adds a specific Class to Xml Configuration File.<br> At least one field name must be configured.
public ColumnMap<String> acquireLockAndReadRow() throws Exception { withDataColumns(true); acquire(); return getDataColumns(); }
Take the lock and return the row data columns. Use this, instead of acquire, when you want to implement a read-modify-write scenario and want to reduce the number of calls to Cassandra.
public static Map<String,Object> performFindItem(DispatchContext dctx,Map<String,Object> context){ context.put("viewSize",1); context.put("viewIndex",0); Map<String,Object> result=org.ofbiz.common.FindServices.performFind(dctx,context); List<GenericValue> list=null; GenericValue item=null; try { EntityL...
Returns the first generic item of the service 'performFind' Same parameters as performFind service but returns a single GenericValue
public void test_ticket_1105_quads_update5() throws Exception { new UpdateTestHelper("ticket_1105_quads_update5","ticket_1105_update5.rq","ticket_1105.trig"); }
Query: <code> DELETE { <http://example/s> <http://example/p> <http://example/o> } WHERE { GRAPH ?g { <http://example/s1> <http://example/p1> <http://example/o1> } } </code> is parsed successfully in quads mode.
public String parseHandle(String linkUri){ Matcher m=parseRegex.matcher(linkUri); return m.find() ? m.group(handleGroup) : null; }
Parses the IM handle out of a link.
public _DeleteOptions(){ super(); }
Constructs a _DeleteOptions with no flags initially set.
public void enableChildAttach(boolean enable,int isolateId){ getIsolateState(isolateId).m_attachChildren=enable; }
If this feature is enabled then we do not attempt to attach child variables to parents.
public void closeButtonActionPerformed(java.awt.event.ActionEvent ae){ dispose(); }
Close button action
public T caseArrayBindingPattern(ArrayBindingPattern object){ return null; }
Returns the result of interpreting the object as an instance of '<em>Array Binding Pattern</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
private boolean zzRefill() throws java.io.IOException { return true; }
Refills the input buffer.
public boolean isSelected(){ return isChecked(); }
alias for isChecked, to ease porting of swing form
@Override protected Key<PollMessage> doBackward(String externalKey){ List<String> idComponents=Splitter.on('-').splitToList(externalKey); if (idComponents.size() != 5) { throw new PollMessageExternalKeyParseException(); } try { Class<?> resourceClazz=EXTERNAL_KEY_CLASS_ID_MAP.inverse().get(Long.parseLon...
Returns an Objectify Key to a PollMessage corresponding with the external key string.
@Override protected void sendFunctionGroup5(){ int new_fn=((getF21() ? CbusConstants.CBUS_F21 : 0) | (getF22() ? CbusConstants.CBUS_F22 : 0) | (getF23() ? CbusConstants.CBUS_F23 : 0)| (getF24() ? CbusConstants.CBUS_F24 : 0)| (getF25() ? CbusConstants.CBUS_F25 : 0)| (getF26() ? CbusConstants.CBUS_F26 : 0)| (getF27() ?...
Send the CBUS message to set the state of functions F21, F22, F23, F24, F25, F26, F27, F28
private void showFeedback(String message){ if (myHost != null) { myHost.showFeedback(message); } else { System.out.println(message); } }
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
public void columnSelectionChanged(ListSelectionEvent e){ }
From a column's selection changing. Does nothing.
public void sendEndEvaluationInstance(Stream inputStream){ InstanceContentEvent instanceContentEvent=new InstanceContentEvent(-1,firstInstance,false,true); inputStream.put(instanceContentEvent); }
Send end evaluation instance.
@Override public int eDerivedStructuralFeatureID(int baseFeatureID,Class<?> baseClass){ if (baseClass == TypedElement.class) { switch (baseFeatureID) { case N4JSPackage.TYPED_ELEMENT__DECLARED_TYPE_REF: return N4JSPackage.N4_FIELD_DECLARATION__DECLARED_TYPE_REF; case N4JSPackage.TYPED_ELEMENT__BOGUS_TYPE_REF: ...
<!-- begin-user-doc --> <!-- end-user-doc -->
public static ImageSource uri(Uri uri){ if (uri == null) { throw new NullPointerException("Uri must not be null"); } return new ImageSource(uri); }
Create an instance from a URI.
public static Schema createSchema(final String schemaLocation) throws XMLException { Schema schema=null; final SchemaFactory schemaFactory=SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI); try { final File file=new File(schemaLocation); if (file.exists()) { schema=schemaFactor...
Creates the schema object.
public org.smpte_ra.schemas.st2067_2_2013.CompositionTimecodeType buildCompositionTimeCode(BigInteger compositionEditRate){ org.smpte_ra.schemas.st2067_2_2013.CompositionTimecodeType compositionTimecodeType=new CompositionTimecodeType(); compositionTimecodeType.setTimecodeDropFrame(false); compositionTimecodeType...
A method to construct a CompositionTimecodeType conforming to the 2013 schema
public KeyPair generateKeyPair(){ KeyPairGenerator keyGen=null; SecureRandom random=null; try { random=SecureRandom.getInstance(SecurityUtil.getSecuredRandomAlgorithm()); keyGen=KeyPairGenerator.getInstance(KeyCertificateAlgorithmValuesHolder.DEFAULT_KEY_ALGORITHM); keyGen.initialize(valuesHolder.getK...
Generates a key pair
public List<V> values(){ List<V> list=new ArrayList<V>(); for ( List<V> value : map.values()) { list.addAll(value); } return Collections.unmodifiableList(list); }
Gets all the values in the multimap.
public QuantiserIndex(SpatialClusters<?> quantiser){ this.quantiser=quantiser; }
Construct a QuantiserIndex from an existing quantiser
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){ switch (featureID) { case GamlPackage.PARAMETER__BUILT_IN_FACET_KEY: return getBuiltInFacetKey(); } return super.eGet(featureID,resolve,coreType); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public MiniDrawer withDrawer(@NonNull Drawer drawer){ this.mDrawer=drawer; return this; }
Provide the Drawer which will be used as dataSource for the drawerItems
public DefaultRetryPolicy(int initialTimeoutMs,int maxNumRetries,float backoffMultiplier){ mCurrentTimeoutMs=initialTimeoutMs; mMaxNumRetries=maxNumRetries; mBackoffMultiplier=backoffMultiplier; }
Constructs a new retry policy.
public TransitionItemProvider(AdapterFactory adapterFactory){ super(adapterFactory); }
This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc -->
public void mark(int limit){ }
<i>This operation is not supported</i>.
private void addDbMetaDataEntry(List<Map<String,String>> list,String name,String value){ Map<String,String> entry=new LinkedHashMap<>(); entry.put("propertyName",getMessageSourceAccessor().getMessage(name)); entry.put("propertyValue",value); list.add(entry); }
Adds the db meta data entry.
public static boolean isStandardLanguage(Locale locale){ if (Locale.ENGLISH.equals(locale) || Locale.GERMAN.equals(locale) || Locale.JAPANESE.equals(locale)) { return true; } return false; }
check if the locale is standard language
protected boolean isCursorPositionCycle(){ return true; }
Returns true if the cursor should cycle to the beginning of the text when the user navigates beyond the edge of the text and visa versa.
public void testBogusArguments() throws Exception { IllegalArgumentException expected=expectThrows(IllegalArgumentException.class,null); assertTrue(expected.getMessage().contains("Unknown parameters")); }
Test that bogus arguments result in exception
@Benchmark public long test1_UsingWhileAndMapEntry() throws IOException { long i=0; Iterator<Map.Entry<Integer,Integer>> it=map.entrySet().iterator(); while (it.hasNext()) { Map.Entry<Integer,Integer> pair=it.next(); i+=pair.getKey() + pair.getValue(); } return i; }
1. Using iterator and Map.Entry