code
stringlengths
10
174k
nl
stringlengths
3
129k
public MethodCallExpr addArgument(Expression arg){ getArgs().add(arg); arg.setParentNode(this); return this; }
Adds the given argument to the method call.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:42.369 -0500",hash_original_method="67C1C5FB3D4E718484F296CD0580B923",hash_generated_method="E4FB769FEDC02FEA8A2364FC8AD6FAE5") public SIPHeader parse() throws ParseException { if (debug) dbg_enter("MinExpiresParser.parse"); MinExpires minExpires=new MinExpires(); try { headerName(TokenTypes.MIN_EXPIRES); minExpires.setHeaderName(SIPHeaderNames.MIN_EXPIRES); String number=this.lexer.number(); try { minExpires.setExpires(Integer.parseInt(number)); } catch ( InvalidArgumentException ex) { throw createParseException(ex.getMessage()); } this.lexer.SPorHT(); this.lexer.match('\n'); return minExpires; } finally { if (debug) dbg_leave("MinExpiresParser.parse"); } }
parse the String message
public boolean isOrthogonalTo(IntVector v){ return dotProduct(v) == 0; }
Checks if this vector is orthogonal to the vector v.
public static char toCharacter(final String value){ return value.charAt(0); }
Converts the given XML string to a character value.
final boolean acquireQueued(final Node node,long arg){ boolean failed=true; try { boolean interrupted=false; for (; ; ) { final Node p=node.predecessor(); if (p == head && tryAcquire(arg)) { setHead(node); p.next=null; failed=false; return interrupted; } if (shouldParkAfterFailedAcquire(p,node) && parkAndCheckInterrupt()) interrupted=true; } } finally { if (failed) cancelAcquire(node); } }
Acquires in exclusive uninterruptible mode for thread already in queue. Used by condition wait methods as well as acquire.
public Rule(String suffix,int min,String replacement){ this.suffix=suffix.toCharArray(); this.replacement=replacement.toCharArray(); this.min=min; }
Create a rule.
private void validateCoreDataFile(ArchiveFile coreFile,boolean archiveHasExtensions) throws GeneratorException, InterruptedException, IOException { addMessage(Level.INFO,"Validating the core file: " + coreFile.getTitle() + ". Depending on the number of records, this can take a while."); Term id=TERM_FACTORY.findTerm(AppConfig.coreIdTerm(resource.getCoreRowType())); Term basisOfRecord=TERM_FACTORY.findTerm(Constants.DWC_BASIS_OF_RECORD); int basisOfRecordIndex=-1; if (isOccurrenceFile(coreFile)) { if (!coreFile.hasTerm(basisOfRecord)) { addMessage(Level.ERROR,"Archive validation failed, because required term basisOfRecord was not mapped in the occurrence core"); throw new GeneratorException("Can't validate DwC-A for resource " + resource.getShortname() + ". Required term basisOfRecord was not mapped in the occurrence core"); } addMessage(Level.INFO,"? Validating the core basisOfRecord is always present is always present and its " + "value matches the Darwin Core Type Vocabulary."); basisOfRecordIndex=coreFile.getField(basisOfRecord).getIndex(); } if (coreFile.hasTerm(id) || archiveHasExtensions) { String msg="? Validating the core ID field " + id.simpleName() + " is always present and unique."; if (archiveHasExtensions) { msg=msg + " Note: the core ID field is required to link core records and extension records together. "; } addMessage(Level.INFO,msg); } File sortedCore=sortCoreDataFile(coreFile,ID_COLUMN_INDEX); CSVReader reader=CSVReaderFactory.build(sortedCore,CHARACTER_ENCODING,coreFile.getFieldsTerminatedBy(),coreFile.getFieldsEnclosedBy(),coreFile.getIgnoreHeaderLines()); AtomicInteger recordsWithNoId=new AtomicInteger(0); AtomicInteger recordsWithDuplicateId=new AtomicInteger(0); AtomicInteger recordsWithNoBasisOfRecord=new AtomicInteger(0); AtomicInteger recordsWithNonMatchingBasisOfRecord=new AtomicInteger(0); AtomicInteger recordsWithAmbiguousBasisOfRecord=new AtomicInteger(0); ClosableReportingIterator<String[]> iter=null; int line=0; String lastId=null; try { iter=reader.iterator(); while (iter.hasNext()) { line++; if (line % 1000 == 0) { checkForInterruption(line); reportIfNeeded(); } String[] record=iter.next(); if (record == null || record.length == 0) { continue; } if (iter.hasRowError() && iter.getException() != null) { throw new GeneratorException("A fatal error was encountered while trying to validate sorted core data file: " + iter.getErrorMessage(),iter.getException()); } else { if (coreFile.hasTerm(id) || archiveHasExtensions) { lastId=validateIdentifier(record[ID_COLUMN_INDEX],lastId,recordsWithNoId,recordsWithDuplicateId); } if (isOccurrenceFile(coreFile)) { validateBasisOfRecord(record[basisOfRecordIndex],line,recordsWithNoBasisOfRecord,recordsWithNonMatchingBasisOfRecord,recordsWithAmbiguousBasisOfRecord); } } } } catch ( InterruptedException e) { setState(e); throw e; } catch ( Exception e) { log.error("Exception caught while validating archive",e); setState(e); throw new GeneratorException("Error while validating archive occurred on line " + line,e); } finally { if (iter != null) { if (!iter.hasRowError() && iter.getErrorMessage() != null) { writePublicationLogMessage("Error reading data: " + iter.getErrorMessage()); } iter.close(); } FileUtils.deleteQuietly(sortedCore); } if (coreFile.hasTerm(id) || archiveHasExtensions) { summarizeIdentifierValidation(recordsWithNoId,recordsWithDuplicateId,id.simpleName()); } if (isOccurrenceFile(coreFile)) { summarizeBasisOfRecordValidation(recordsWithNoBasisOfRecord,recordsWithNonMatchingBasisOfRecord,recordsWithAmbiguousBasisOfRecord); } }
Validate the Archive's core data file has an ID for each row, and that each ID is unique. Perform this check only if the core record ID term (e.g. occurrenceID, taxonID, etc) has actually been mapped. </br> If the core has rowType occurrence, validate the core data file has a basisOfRecord for each row, and that each basisOfRecord matches the DwC Type Vocabulary. </br> If the core has rowType event, validate there are associated occurrences.
private void population(){ Network activityLinkNetwork=NetworkTools.filterNetworkByLinkMode(network,Collections.singleton("car")); new NetworkCleaner().run(activityLinkNetwork); log.info("adapting plans..."); Counter personCounter=new Counter(" person # "); for ( Person person : population.getPersons().values()) { personCounter.incCounter(); List<? extends Plan> plans=person.getPlans(); for ( Plan plan : plans) { List<PlanElement> elements=plan.getPlanElements(); for ( PlanElement e : elements) { if (e instanceof Activity) { Activity activity=(Activity)e; switch (activity.getType()) { case "home": break; case "work": break; default : activity.setType(OTHER); } activity.setFacilityId(null); activity.setLinkId(NetworkTools.getNearestLink(activityLinkNetwork,activity.getCoord()).getId()); } } } } }
modifiy population
public boolean visit(MultiTextEdit edit){ return visitNode(edit); }
Visits a <code>MultiTextEdit</code> instance.
public Iterator<IRemoteTxState0> listTx(){ final ConnectOptions opts=new ConnectOptions(mgr.getBaseServiceURL() + "/tx"); opts.method="GET"; JettyResponseListener response=null; try { RemoteRepository.checkResponseCode(response=mgr.doConnect(opts)); return multiTxResponse(response).iterator(); } catch ( Exception e) { throw new RuntimeException(e); } finally { if (response != null) response.abort(); } }
<code>LIST-TX</code>: Return the set of active transactions.
public Builder nodeSettings(StaticNodeSettings staticNodeSettings){ this.staticNodeSettings=staticNodeSettings; return this; }
Sets static node settings.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:03.289 -0500",hash_original_method="41E781585F5EF3A93F8FE051E438DFA6",hash_generated_method="71A4764486C7D6EA74D91BA9F31D39F0") public static void refresh(){ if (needRefresh) { refreshNumber++; updateServiceInfo(); } }
Refresh services info
private void revertFieldsJavaNames(Collection<PojoField> selFields){ for ( PojoField field : selFields) field.resetJavaName(); }
Revert fields java name for current POJO to initial value.
public CompactConcurrentHashSet2(){ }
Creates a new, empty map with the default initial table size (16).
public boolean checkType(JCTree declaringElement,Name declaringElementName,JCExpression typeExpression){ if (!JSweetConfig.isJDKReplacementMode()) { if (typeExpression instanceof JCArrayTypeTree) { return checkType(declaringElement,declaringElementName,((JCArrayTypeTree)typeExpression).elemtype); } String type=typeExpression.type.tsym.toString(); if (!translator.getContext().options.isJDKAllowed() && !translator.getContext().strictMode && type.startsWith("java.")) { if (!(AUTHORIZED_DECLARED_TYPES.contains(type) || NUMBER_TYPES.contains(type) || type.startsWith("java.util.function"))) { translator.report(declaringElement,declaringElementName,JSweetProblem.JDK_TYPE,type); return false; } } } return true; }
Checks that the given type is JSweet compatible.
@Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application){ return application.sources(Application.class); }
An opinionated WebApplicationInitializer to run a SpringApplication from a traditional WAR deployment. Binds Servlet, Filter and ServletContextInitializer beans from the application context to the servlet container.
public static void checkState(boolean expression){ if (!expression) { throw new IllegalStateException(); } }
Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
private void showOptions(){ if (client.getGame().getPhase() == IGame.Phase.PHASE_LOUNGE) { getGameOptionsDialog().setEditable(true); } else { getGameOptionsDialog().setEditable(false); } getGameOptionsDialog().update(client.getGame().getOptions()); getGameOptionsDialog().setVisible(true); }
Called when the user selects the "View->Game Options" menu item.
public static void checkAndAppendIntegerlement(AVList params,String paramKey,Element context,String path){ if (params == null) { String message=Logging.getMessage("nullValue.ParametersIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } if (paramKey == null) { String message=Logging.getMessage("nullValue.ParameterKeyIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } if (context == null) { String message=Logging.getMessage("nullValue.ElementIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } Integer i=AVListImpl.getIntegerValue(params,paramKey); if (i != null) { appendInteger(context,path,i); } }
Checks a parameter list for a specified key and if present attempts to append new elements represeting the parameter to a specified context.
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:52.342 -0400",hash_original_method="610F60ED6DB50185F33A85945665EF11",hash_generated_method="57A04B03533AEBB95DA85C73B06358AD") @Override public String toString(){ return charSequence.toString(); }
Return a String representation of the underlying character sequence.
@Override public long position(java.sql.Clob searchstr,long start) throws SQLException { return position(searchstr.getSubString(0,(int)searchstr.length()),(int)start); }
Retrieves the character position at which the specified <code>Clob</code> object <code>searchstr</code> begins within the <code>CLOB</code> value that this <code>Clob</code> object represents. The search for <code>searchstr</code> begins at position <code>start</code>.
protected void checkCapacity(){ if (size >= threshold) { final int newCapacity=data.length * 2; if (newCapacity <= MAXIMUM_CAPACITY) { ensureCapacity(newCapacity); } } }
Checks the capacity of the map and enlarges it if necessary. <p> This implementation uses the threshold to check if the map needs enlarging
public JBBPOut Bits(final JBBPBitNumber numberOfBits,final int value) throws IOException { assertNotEnded(); JBBPUtils.assertNotNull(numberOfBits,"Number of bits must not be null"); if (this.processCommands) { _writeBits(numberOfBits,value); } return this; }
Write bits from a value into the output stream
public void testCacheImpacts() throws Exception { assertU(adoc("id","9","str","c","float","-3.2","int","42")); assertU(adoc("id","7","str","c","float","-3.2","int","-1976")); assertU(adoc("id","2","str","c","float","-3.2","int","666")); assertU(adoc("id","0","str","b","float","64.5","int","-42")); assertU(adoc("id","5","str","b","float","64.5","int","2001")); assertU(adoc("id","8","str","b","float","64.5","int","4055")); assertU(adoc("id","6","str","a","float","64.5","int","7")); assertU(adoc("id","1","str","a","float","64.5","int","7")); assertU(adoc("id","4","str","a","float","11.1","int","6")); assertU(adoc("id","3","str","a","float","11.1","int","3")); assertU(commit()); final Collection<String> allFieldNames=getAllSortFieldNames(); final SolrInfoMBean filterCacheStats=h.getCore().getInfoRegistry().get("filterCache"); assertNotNull(filterCacheStats); final SolrInfoMBean queryCacheStats=h.getCore().getInfoRegistry().get("queryResultCache"); assertNotNull(queryCacheStats); final long preQcIn=(Long)queryCacheStats.getStatistics().get("inserts"); final long preFcIn=(Long)filterCacheStats.getStatistics().get("inserts"); final long preFcHits=(Long)filterCacheStats.getStatistics().get("hits"); SentinelIntSet ids=assertFullWalkNoDups(10,params("q","*:*","rows","" + TestUtil.nextInt(random(),1,11),"fq","-id:[1 TO 2]","fq","-id:[6 TO 7]","fl","id","sort",buildRandomSort(allFieldNames))); assertEquals(6,ids.size()); final long postQcIn=(Long)queryCacheStats.getStatistics().get("inserts"); final long postFcIn=(Long)filterCacheStats.getStatistics().get("inserts"); final long postFcHits=(Long)filterCacheStats.getStatistics().get("hits"); assertEquals("query cache inserts changed",preQcIn,postQcIn); assertEquals("filter cache did not grow correctly",3,postFcIn - preFcIn); assertTrue("filter cache did not have any new cache hits",0 < postFcHits - preFcHits); }
test that our assumptions about how caches are affected hold true
@Override public void translate(final ITranslationEnvironment environment,final IInstruction instruction,final List<ReilInstruction> instructions) throws InternalTranslationException { TranslationHelpers.checkTranslationArguments(environment,instruction,instructions,"SMULW"); translateAll(environment,instruction,"SMULW",instructions); }
SMULW<y>{<cond>} <Rd>, <Rm>, <Rs> Operation: if ConditionPassed(cond) then if (y == 0) then operand2 = SignExtend(Rs[15:0]) else // y == 1 operand2 = SignExtend(Rs[31:16]) Rd = (Rm * operand2)[47:16] // Signed multiplication
public int jumpToIndex(FormIndex index){ return mFormEntryController.jumpToIndex(index); }
Jumps to a given FormIndex.
public static boolean startsWith(String s,String start){ return s == null || start == null ? false : s.startsWith(start); }
Check is a string starts with another string, ignoring the case.
protected void sequence_ThisTypeRefNominal_TypeRefWithoutModifiers(ISerializationContext context,ThisTypeRefNominal semanticObject){ genericSequencer.createSequence(context,semanticObject); }
Contexts: TypeRefWithoutModifiers returns ThisTypeRefNominal Constraint: dynamic?='+'?
public static String numberToString(Number number) throws JSONException { if (number == null) { throw new JSONException("Null pointer"); } testValidity(number); String string=number.toString(); if (string.indexOf('.') > 0 && string.indexOf('e') < 0 && string.indexOf('E') < 0) { while (string.endsWith("0")) { string=string.substring(0,string.length() - 1); } if (string.endsWith(".")) { string=string.substring(0,string.length() - 1); } } return string; }
Produce a string from a Number.
private void refreshLiveNodes(Watcher watcher) throws KeeperException, InterruptedException { synchronized (refreshLiveNodesLock) { Set<String> newLiveNodes; try { List<String> nodeList=zkClient.getChildren(LIVE_NODES_ZKNODE,watcher,true); newLiveNodes=new HashSet<>(nodeList); } catch ( KeeperException.NoNodeException e) { newLiveNodes=emptySet(); } lastFetchedLiveNodes.set(newLiveNodes); } Set<String> oldLiveNodes, newLiveNodes; synchronized (getUpdateLock()) { newLiveNodes=lastFetchedLiveNodes.getAndSet(null); if (newLiveNodes == null) { return; } oldLiveNodes=this.liveNodes; this.liveNodes=newLiveNodes; if (clusterState != null) { clusterState.setLiveNodes(newLiveNodes); } } if (oldLiveNodes.size() != newLiveNodes.size()) { LOG.info("Updated live nodes from ZooKeeper... ({}) -> ({})",oldLiveNodes.size(),newLiveNodes.size()); } if (LOG.isDebugEnabled()) { LOG.debug("Updated live nodes from ZooKeeper... {} -> {}",new TreeSet<>(oldLiveNodes),new TreeSet<>(newLiveNodes)); } }
Refresh live_nodes.
private void refreshView(){ if (!wasInvalidatedBefore) { wasInvalidatedBefore=true; invalidate(); } }
Tries to post a invalidate() event if another one was previously posted.
private void applyKitKatTranslucency(){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { int topPadding=Common.getStatusBarHeight(mContext); if (mDrawerParentLayout != null) { mDrawerParentLayout.setPadding(0,(0 - topPadding),0,0); mDrawerParentLayout.setClipToPadding(false); int navigationBarHeight=Common.getNavigationBarHeight(mContext); mListView.setClipToPadding(false); mListView.setPadding(mListView.getPaddingLeft(),mListView.getPaddingTop(),mListView.getPaddingRight(),mListView.getPaddingBottom() + navigationBarHeight); } } }
Apply KitKat specific translucency.
public PubsubFuture<Void> modifyAckDeadline(final String canonicalSubscriptionName,final int ackDeadlineSeconds,final List<String> ackIds){ final String path=canonicalSubscriptionName + ":modifyAckDeadline"; final ModifyAckDeadlineRequest req=ModifyAckDeadlineRequest.builder().ackDeadlineSeconds(ackDeadlineSeconds).ackIds(ackIds).build(); return post("modify ack deadline",path,req,Void.class); }
Modify the ack deadline for a list of received messages.
public void testGetPrototype() throws Exception { TestService mockService=control.createMock(TestService.class); assertSame(mockService.getRequestPrototype(fooDescriptor),FooRequest.getDefaultInstance()); assertSame(mockService.getResponsePrototype(fooDescriptor),FooResponse.getDefaultInstance()); assertSame(mockService.getRequestPrototype(barDescriptor),BarRequest.getDefaultInstance()); assertSame(mockService.getResponsePrototype(barDescriptor),BarResponse.getDefaultInstance()); }
Tests Service.get{Request,Response}Prototype().
@Override public boolean isSingleton(){ return true; }
Always returns <code>true</code>.
public static boolean isPrimitiveWrapper(Class<?> clazz){ Assert.notNull(clazz,"Class must not be null"); return primitiveWrapperTypeMap.containsKey(clazz); }
Check if the given class represents a primitive wrapper, i.e. Boolean, Byte, Character, Short, Integer, Long, Float, or Double.
public int size(){ return this.parts.size(); }
Returns the number of stored diff parts.
public static int octant(Coordinate p0,Coordinate p1){ double dx=p1.x - p0.x; double dy=p1.y - p0.y; if (dx == 0.0 && dy == 0.0) throw new IllegalArgumentException("Cannot compute the octant for two identical points " + p0); return octant(dx,dy); }
Returns the octant of a directed line segment from p0 to p1.
@Override public Integer put(Long key,Integer value){ return wrapValue(_map.put(unwrapKey(key),unwrapValue(value))); }
Inserts a key/value pair into the map.
@Override public void updateTextCycle(Cycle cycle){ textCycle=cycle; textCycleStream.onNext(textCycle); }
Update current text cycle to reflect changes
public static String decodeJavaMIMEType(String nat){ return (isJavaMIMEType(nat)) ? nat.substring(JavaMIME.length(),nat.length()).trim() : null; }
Decodes a <code>String</code> native for use as a Java MIME type.
@Override protected void onAttach(){ super.onAttach(); setInteractivity(false); mPulseAnimation=AnimationUtils.loadAnimation(SampleKeyguardProviderService.this,R.anim.pulsing_anim); mImageView.startAnimation(mPulseAnimation); }
Called when the view has been attached to a window
public AttributesDescriptor(String displayName,TextAttributesKey key){ myKey=key; myDisplayName=displayName; }
Creates an attribute descriptor with the specified name and text attributes key.
public byte[] encrypt(String clearString) throws IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, InvalidKeySpecException, BadPaddingException, IllegalBlockSizeException { if ((clearString == null) || (clearString.isEmpty())) { return null; } Cipher cipher=getCipher(Cipher.ENCRYPT_MODE); return cipher.doFinal(clearString.getBytes("UTF8")); }
Encryption Method
protected void prepare(){ p_Record_ID=getRecord_ID(); if (p_AD_Client_ID == 0) p_AD_Client_ID=Env.getAD_Client_ID(getCtx()); AD_Table_ID=getTable_ID(); StringBuffer sb=new StringBuffer("AD_Table_ID=").append(AD_Table_ID); sb.append("; Record_ID=").append(getRecord_ID()); ProcessInfoParameter[] para=getParameter(); for (int i=0; i < para.length; i++) { String name=para[i].getParameterName(); if (para[i].getParameter() == null) ; else if (name.equals("AD_Table_ID")) p_AD_Table_ID=para[i].getParameterAsInt(); else log.log(Level.SEVERE,"Unknown Parameter: " + name); } log.info(sb.toString()); }
Get Parameters
private StringBuilder removeHiddenMarkers(final int c){ if (content[c].indexOf(MARKER) == -1) { return content[c]; } final StringTokenizer tokens=new StringTokenizer(content[c].toString(),MARKER,true); String temp; StringBuilder processedData=new StringBuilder(); while (tokens.hasMoreTokens()) { temp=tokens.nextToken(); if (temp.equals(MARKER)) { tokens.nextToken(); tokens.nextToken(); tokens.nextToken(); tokens.nextToken(); processedData=processedData.append(tokens.nextToken()); } else { processedData=processedData.append(temp); } } return processedData; }
strip the hidden numbers of position we encoded into the data (could be coded to be faster by not using Tokenizer)
public static CoffeeEntry createIcedCoffeeEntry(SkuDetails icedCoffeeDetails){ return new CoffeeEntry(icedCoffeeDetails,ICED_COFFEE_CAFFEINE_RATE,ICED_COFFEE_ENERGY_RATE,ICED_COFFEE_CANDYNESS_RATE); }
create iced coffee entry
public static void main(String[] argv) throws IOException { if (argv.length == 1) { OperatorDocGenerator opDocGen=null; if (argv[0].equals("LATEX")) opDocGen=new LatexOperatorDocGenerator(); else opDocGen=new ProgramHTMLOperatorDocGenerator(); ParameterService.init(); File file=new File(ParameterService.getRapidMinerHome(),"tutorial" + File.separator + "OperatorsGenerated.tex"); LogService.getGlobal().log("Generating class documentation to '" + file + "'.",LogService.STATUS); DocumentationGenerator docGen=new DocumentationGenerator(opDocGen); docGen.getRootDoc(); docGen.generateAll(new PrintWriter(new FileWriter(file))); } else if (argv.length == 2) { OperatorDocGenerator opDocGen=null; if (argv[0].equals("LATEX")) opDocGen=new LatexOperatorDocGenerator(); else opDocGen=new ProgramHTMLOperatorDocGenerator(); ParameterService.init(); File file=new File(argv[1]); LogService.getGlobal().log("Generating class documentation to '" + file + "'.",LogService.STATUS); DocumentationGenerator docGen=new DocumentationGenerator(opDocGen); docGen.getRootDoc(); docGen.generateAll(new PrintWriter(new FileWriter(file))); } else if (argv.length >= 5) { OperatorDocGenerator opDocGen=null; if (argv[0].equals("LATEX")) opDocGen=new LatexOperatorDocGenerator(); else opDocGen=new ProgramHTMLOperatorDocGenerator(); try { OperatorService.registerOperators(argv[1],new FileInputStream(argv[1]),null); } catch ( IOException e) { LogService.getGlobal().log("Cannot read 'operators.xml'.",LogService.ERROR); } File file=new File(argv[4]); LogService.getGlobal().log("Generating class documentation to '" + file + "'.",LogService.STATUS); PrintWriter out=new PrintWriter(new FileWriter(file)); DocumentationGenerator docGen=new DocumentationGenerator(opDocGen); boolean generateSubgroups=false; if (argv.length == 6) { if (argv[5].equals("true")) generateSubgroups=true; } docGen.getRootDoc(new File(argv[2]),argv[3]); docGen.generateAll(new PrintWriter(new FileWriter(file)),generateSubgroups); out.close(); } else { LogService.getGlobal().log("usage: java com.rapidminer.doc.DocumentationGenerator or" + Tools.getLineSeparator() + " java com.rapidminer.doc.DocumentationGenerator operatordesc srcdir subpackages outputfile [generate subgroups (true/false)]",LogService.WARNING); } }
If no arguments are given, the LaTeX documentation of the RapidMiner core is generated. Otherwise this documentation generator can be used to generated the documentation of arbitrary RapidMiner operators, e.g. for plugins. In this case the arguments are: <br/> &lt;operators.xml&gt; &lt;sourcedir&gt; &lt;packages&gt; &lt;with_subgroups&gt;
public NotificationChain basicSetDeclaredTypeRef(TypeRef newDeclaredTypeRef,NotificationChain msgs){ TypeRef oldDeclaredTypeRef=declaredTypeRef; declaredTypeRef=newDeclaredTypeRef; if (eNotificationRequired()) { ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,N4JSPackage.PROPERTY_NAME_VALUE_PAIR__DECLARED_TYPE_REF,oldDeclaredTypeRef,newDeclaredTypeRef); if (msgs == null) msgs=notification; else msgs.add(notification); } return msgs; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public DailyTimeIntervalTriggerImpl(String name,Date startTime,Date endTime,TimeOfDay startTimeOfDay,TimeOfDay endTimeOfDay,IntervalUnit intervalUnit,int repeatInterval){ this(name,null,startTime,endTime,startTimeOfDay,endTimeOfDay,intervalUnit,repeatInterval); }
<p> Create a <code>DailyTimeIntervalTrigger</code> that will occur at the given time, and repeat at the the given interval until the given end time. </p>
public Vector3f reflect(Vector3fc normal){ float dot=this.dot(normal); x=x - (dot + dot) * normal.x(); y=y - (dot + dot) * normal.y(); z=z - (dot + dot) * normal.z(); return this; }
Reflect this vector about the given <code>normal</code> vector.
public Name(String name) throws IOException { rdn=new DNParser(name).parse(); }
Creates new <code>Name</code> instance
@Override public boolean request(int interruptNumber){ int imcSection=getRequestImcSection(interruptNumber); int il=getRequestLevel(interruptNumber); if (isImcDmSet(imcSection)) { dreqflg=Format.clearBit(dreqflg,il); ((TxDmaController)platform.getDmaController()).getChannel(il).startTransferIfConditionsOk(); return true; } else { if (il > 0) { return request(new TxInterruptRequest(Type.HARDWARE_INTERRUPT,interruptNumber,il)); } else { return false; } } }
Request a hardware interrupt with the given number
private int match(final int[] list,final int value){ for (int i=0; i < list.length; i++) { if (value == list[i]) return i; } return -1; }
Returns the index of the first element equals to a specific value-
private List<ItemDTO> mockBaseItemWith2Key1Comment1Blank(){ ItemDTO i1=new ItemDTO("","","#qqqq",1); ItemDTO i2=new ItemDTO("a","b","",2); ItemDTO i3=new ItemDTO("","","",3); ItemDTO i4=new ItemDTO("b","c","",4); i4.setLineNum(4); return Arrays.asList(i1,i2,i3,i4); }
#qqqq a=b b=c
public String checkAcceptanceChangeable(final DigestURL url,final CrawlProfile profile,final int depth){ final String urlProtocol=url.getProtocol(); final String urlstring=url.toNormalform(true); if (!Switchboard.getSwitchboard().loader.isSupportedProtocol(urlProtocol)) { CrawlStacker.log.severe("Unsupported protocol in URL '" + urlstring + "'."); return "unsupported protocol"; } final String urlRejectReason=urlInAcceptedDomain(url); if (urlRejectReason != null) { if (CrawlStacker.log.isFine()) CrawlStacker.log.fine("denied_(" + urlRejectReason + ")"); return "denied_(" + urlRejectReason + ")"; } if (Switchboard.urlBlacklist.isListed(BlacklistType.CRAWLER,url)) { CrawlStacker.log.fine("URL '" + urlstring + "' is in blacklist."); return "url in blacklist"; } if ((depth > 0) && !profile.urlMustMatchPattern().matcher(urlstring).matches()) { if (CrawlStacker.log.isFine()) CrawlStacker.log.fine("URL '" + urlstring + "' does not match must-match crawling filter '"+ profile.urlMustMatchPattern().toString()+ "'."); return ERROR_NO_MATCH_MUST_MATCH_FILTER + profile.urlMustMatchPattern().toString(); } if ((depth > 0) && profile.urlMustNotMatchPattern().matcher(urlstring).matches()) { if (CrawlStacker.log.isFine()) CrawlStacker.log.fine("URL '" + urlstring + "' matches must-not-match crawling filter '"+ profile.urlMustNotMatchPattern().toString()+ "'."); return ERROR_MATCH_WITH_MUST_NOT_MATCH_FILTER + profile.urlMustNotMatchPattern().toString(); } if (url.isIndividual() && !profile.crawlingQ()) { if (CrawlStacker.log.isFine()) CrawlStacker.log.fine("URL '" + urlstring + "' is CGI URL."); return "individual url (sessionid etc) not wanted"; } if (url.isPOST() && !profile.crawlingQ()) { if (CrawlStacker.log.isFine()) CrawlStacker.log.fine("URL '" + urlstring + "' is post URL."); return "post url not allowed"; } if ((depth > 0) && profile.ipMustMatchPattern() != CrawlProfile.MATCH_ALL_PATTERN && url.getHost() != null && !profile.ipMustMatchPattern().matcher(url.getInetAddress().getHostAddress()).matches()) { if (CrawlStacker.log.isFine()) CrawlStacker.log.fine("IP " + url.getInetAddress().getHostAddress() + " of URL '"+ urlstring+ "' does not match must-match crawling filter '"+ profile.ipMustMatchPattern().toString()+ "'."); return "ip " + url.getInetAddress().getHostAddress() + " of url does not match must-match filter"; } if ((depth > 0) && profile.ipMustNotMatchPattern() != CrawlProfile.MATCH_NEVER_PATTERN && url.getHost() != null && profile.ipMustNotMatchPattern().matcher(url.getInetAddress().getHostAddress()).matches()) { if (CrawlStacker.log.isFine()) CrawlStacker.log.fine("IP " + url.getInetAddress().getHostAddress() + " of URL '"+ urlstring+ "' matches must-not-match crawling filter '"+ profile.ipMustNotMatchPattern().toString()+ "'."); return "ip " + url.getInetAddress().getHostAddress() + " of url matches must-not-match filter"; } final String[] countryMatchList=profile.countryMustMatchList(); if (depth > 0 && countryMatchList != null && countryMatchList.length > 0) { final Locale locale=url.getLocale(); if (locale != null) { final String c0=locale.getCountry(); boolean granted=false; matchloop: for ( final String c : countryMatchList) { if (c0.equals(c)) { granted=true; break matchloop; } } if (!granted) { if (CrawlStacker.log.isFine()) CrawlStacker.log.fine("IP " + url.getInetAddress().getHostAddress() + " of URL '"+ urlstring+ "' does not match must-match crawling filter '"+ profile.ipMustMatchPattern().toString()+ "'."); return "country " + c0 + " of url does not match must-match filter for countries"; } } } return null; }
Test if an url shall be accepted using attributes that are defined by a crawl start but can be changed during a crawl.
public WriterToUTF8Buffered(OutputStream out){ m_os=out; m_outputBytes=new byte[BYTES_MAX + 3]; m_inputChars=new char[CHARS_MAX + 2]; count=0; }
Create an buffered UTF-8 writer.
protected boolean matches(JavaModelStatus status,int mask){ int severityMask=mask & 0x7; int categoryMask=mask & ~0x7; int bits=status.getBits(); return ((severityMask == 0) || (bits & severityMask) != 0) && ((categoryMask == 0) || (bits & categoryMask) != 0); }
Helper for matches(int).
public IndexMap(Map<Integer,E> map){ this.array=new Object[map.size()]; putAll(map); }
Creates a new IntArrayMap that contains the keys-values pairs of the given map.
public void remove(Track track){ if (_tracks.contains(track)) { int oldSize=_tracks.size(); _tracks.remove(track); this.propertyChangeSupport.firePropertyChange(LISTCHANGE_CHANGED_PROPERTY,Integer.valueOf(oldSize),Integer.valueOf(_tracks.size())); } }
Removes a track from this pool
public static void main(String[] args) throws Exception { try { int exitCode=ToolRunner.run(new RedisExportJob(),args); System.exit(exitCode); } catch ( Exception e) { System.err.println(e.getMessage()); } }
The entry point when called from the command line.
public static void showAlert(Context context,CharSequence title,CharSequence msg,CharSequence ok,DialogInterface.OnClickListener lOk){ AlertDialog dialog=buildAlert(context,title,msg,ok,null,lOk,null); if (dialog != null) { dialog.show(); } }
show an system default alert dialog with given title, msg, ok, cancal, listeners
public void close(){ if (mBluetoothGatt == null) { return; } mBluetoothGatt.close(); mBluetoothGatt=null; }
After using a given BLE device, the app must call this method to ensure resources are released properly.
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:59:59.514 -0500",hash_original_method="DBB4EF5840B4656B4D7CD7498EF1A157",hash_generated_method="B5D6BEEE5C50711516C06A63C9884CAB") private static boolean matchIpAddress(X509Certificate certificate,String thisDomain){ if (LOG_ENABLED) { Log.v(TAG,"DomainNameValidator.matchIpAddress(): this domain: " + thisDomain); } try { Collection subjectAltNames=certificate.getSubjectAlternativeNames(); if (subjectAltNames != null) { Iterator i=subjectAltNames.iterator(); while (i.hasNext()) { List altNameEntry=(List)(i.next()); if (altNameEntry != null && 2 <= altNameEntry.size()) { Integer altNameType=(Integer)(altNameEntry.get(0)); if (altNameType != null) { if (altNameType.intValue() == ALT_IPA_NAME) { String altName=(String)(altNameEntry.get(1)); if (altName != null) { if (LOG_ENABLED) { Log.v(TAG,"alternative IP: " + altName); } if (thisDomain.equalsIgnoreCase(altName)) { return true; } } } } } } } } catch ( CertificateParsingException e) { } return false; }
Checks the site certificate against the IP domain name of the site being visited
public static void main(String[] args){ LeadingSpaces tester=new LeadingSpaces(); run(tester,ARGS,TEST,NEGATED_TEST); tester.printSummary(); }
The entry point of the test.
protected DMLYarnClient(String dmlScriptStr,DMLConfig conf,String[] args){ _dmlScript=dmlScriptStr; _dmlConfig=conf; _args=args; }
Protected since only supposed to be accessed via proxy in same package. This is to ensure robustness in case of missing yarn libraries.
public boolean isIndependent(Node xVar,Node yVar,List<Node> zList){ if (zList == null) { throw new NullPointerException(); } for ( Node node : zList) { if (node == null) { throw new NullPointerException(); } } List<Node> regressors=new ArrayList<>(); regressors.add(dataSet.getVariable(yVar.getName())); for ( Node zVar : zList) { regressors.add(dataSet.getVariable(zVar.getName())); } Regression regression=new RegressionDataset(dataSet); RegressionResult result=null; try { result=regression.regress(xVar,regressors); } catch ( Exception e) { return false; } double p=result.getP()[1]; boolean independent=p > alpha; if (verbose) { if (independent) { TetradLogger.getInstance().log("independencies",SearchLogUtils.independenceFactMsg(xVar,yVar,zList,p)); } else { TetradLogger.getInstance().log("dependencies",SearchLogUtils.dependenceFactMsg(xVar,yVar,zList,p)); } } return independent; }
Determines whether variable x is independent of variable y given a list of conditioning variables z.
@Override public String addStepsVcenterClusterCleanup(Workflow workflow,String waitFor,URI clusterId) throws InternalException { Cluster cluster=_dbClient.queryObject(Cluster.class,clusterId); if (NullColumnValueGetter.isNullURI(cluster.getVcenterDataCenter())) { log.info("cluster is not synced to vcenter"); return waitFor; } boolean hasDiscoveredHosts=false; boolean hasProvisionedHosts=false; List<URI> clusterHosts=ComputeSystemHelper.getChildrenUris(_dbClient,clusterId,Host.class,"cluster"); List<Host> hosts=_dbClient.queryObject(Host.class,clusterHosts); for ( Host host : hosts) { if (NullColumnValueGetter.isNullURI(host.getComputeElement())) { hasDiscoveredHosts=true; } else { hasProvisionedHosts=true; } } log.info("cluster has provisioned hosts: {}, and discovered hosts: {}",hasProvisionedHosts,hasDiscoveredHosts); if (hasProvisionedHosts) { waitFor=workflow.createStep(CHECK_CLUSTER_VMS,"If synced with vCenter, check if there are VMs in the cluster",waitFor,clusterId,clusterId.toString(),this.getClass(),new Workflow.Method("checkClusterVms",cluster.getId(),cluster.getVcenterDataCenter()),null,null); } if (hasProvisionedHosts && !hasDiscoveredHosts) { waitFor=workflow.createStep(REMOVE_VCENTER_CLUSTER,"If synced with vCenter, remove the cluster",waitFor,clusterId,clusterId.toString(),this.getClass(),new Workflow.Method("removeVcenterCluster",cluster.getId(),cluster.getVcenterDataCenter()),null,null); } return waitFor; }
A cluster could have only discovered hosts, only provisioned hosts, or mixed. If cluster has only provisioned hosts, then the hosts will be deleted from vCenter. If cluster has only discovered hosts, then the hosts will not be deleted from vCenter. If cluster is mixed, then the hosts will not be deleted from the vCenter; however, the provisioned hosts will still be decommissioned, and their state in vCenter will be "disconnected". If a cluster is provisioned or mixed, then check VMs step will be executed since hosts with running VMs may endup decommissioned.
private static int subAndCheck(final int x,final int y){ final long s=(long)x - (long)y; if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) { throw new ArithmeticException("overflow: add"); } return (int)s; }
Subtract two integers, checking for overflow.
public boolean isRangeZeroBaselineVisible(){ return this.rangeZeroBaselineVisible; }
Returns a flag that controls whether or not a zero baseline is displayed for the range axis.
@Override public boolean shouldDelayChildPressedState(){ return false; }
ViewPager inherits ViewGroup's default behavior of delayed clicks on its children, but in order to make the calc buttons more responsive we disable that here.
private void dialogChanged(){ errorMsg=validateInputs(); updateStatus(errorMsg); }
Ensures that both text fields are set.
public static void main(String[] argv){ try { Evaluation.runExperiment((MultiLabelClassifier)new WvARAM(),argv); } catch ( Exception e) { e.printStackTrace(); System.err.println(e.getMessage()); } }
Main method for testing this class.
public void seekN(int n){ pos+=n; }
Skip n chars ahead.
@Override public void updateBlob(String columnLabel,InputStream x,long length) throws SQLException { try { if (isDebugEnabled()) { debugCode("updateBlob(" + quote(columnLabel) + ", x, "+ length+ "L);"); } checkClosed(); Value v=conn.createBlob(x,-1); update(columnLabel,v); } catch ( Exception e) { throw logAndConvert(e); } }
Updates a column in the current or insert row.
public static void previous(final IdocApplet ui){ FileVO ele=(FileVO)ui.getFileVO(); if (ele.getImageSelectIndex() - 1 < 0) { ele.setImageSelectIndex(ele.getListImage().size() - 1); } else { ele.setImageSelectIndex(ele.getImageSelectIndex() - 1); } }
Muestra la imagen anterior en el applet
public static void registerMetadata(MetadataRegistry registry){ if (registry.isRegistered(KEY)) { return; } ElementCreator builder=registry.build(KEY); builder.addAttribute(NAME).setRequired(true); builder.addAttribute(TYPE); builder.addAttribute(UNIT); }
Registers the metadata for this element.
private static int testSwitchingTwoWays(){ int failures=0; for ( MetaSynVar msv : MetaSynVar.values()) { int enumResult=enumSwitch(msv); int stringResult=stringSwitch(msv.name()); if (enumResult != stringResult) { failures++; System.err.printf("One value %s, computed 0x%x with the enum switch " + "and 0x%x with the string one.%n",msv,enumResult,stringResult); } } return failures; }
Verify that a switch on an enum and a switch with the same structure on the string name of an enum compute equivalent values.
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:19.993 -0500",hash_original_method="D1AF4635F236F26EDAA4AC997AD8C09A",hash_generated_method="2288A665FEBE4EF35DE6B0C0BF9BCD7C") public static String valueOf(long value){ String str=new String(); str.addTaint(value); return str; }
Converts the specified long to its string representation.
private ExternalSaslClient(String authorizationId,String protocol,String serverName,Map props,CallbackHandler cbh){ m_authorizationId=authorizationId; m_protocol=protocol; m_serverName=serverName; m_props=props; m_cbh=cbh; m_state=STATE_INITIAL; }
Creates an ExternalSaslClient object using the parameters supplied. Assumes that the QOP, STRENGTH, and SERVER_AUTH properties are contained in props
public double scaleValue(double value){ if (logarithm) { value=Math.log(value); } double min=getMinValue(); double max=getMaxValue(); return ((value - min) / (max - min)); }
Scales the value to a range 0,1 based on the current settings
public static double product(int size,double sumOfLogarithms){ return Math.pow(Math.exp(sumOfLogarithms / size),size); }
Returns the product, which is <tt>Prod( data[i] )</tt>. In other words: <tt>data[0]*data[1]*...*data[data.size()-1]</tt>. This method uses the equivalent definition: <tt>prod = pow( exp( Sum( Log(x[i]) ) / size(), size())</tt>.
public void enableRotation(final boolean enable){ mRotationEnabled=enable; if (!mRotationEnabled) { mListRotation=0; } invalidate(); }
Enables and disables individual rotation of the items.
public void start(){ if (sLogger.isActivated()) { sLogger.info("Start the IMS module"); } mCnxManager.start(); mExtensionManager.start(); mServiceDispatcher.start(); mCallManager.start(); if (sLogger.isActivated()) { sLogger.info("IMS module is started"); } }
Start the IMS module
public static Text valueOf(char c,int length){ if (length < 0) throw new IndexOutOfBoundsException(); if (length <= BLOCK_SIZE) { Text text=Text.newPrimitive(length); for (int i=0; i < length; ) { text._data[i++]=c; } return text; } else { final int middle=(length >> 1); return Text.newComposite(Text.valueOf(c,middle),Text.valueOf(c,length - middle)); } }
Returns the text that contains a specific length sequence of the character specified.
public ByteList MethodInfo(ByteList bytes,int param_count,int return_type,IntList param_types,IntList param_values,ByteList param_kinds,IntList param_names,int debug_name_index,int flags,int method_info_index){ if (show_bytecode) { defns_out.write("\n MethodInfo "); defns_out.write(" param_count=" + param_count); defns_out.write(" return_type=" + return_type + " param_types={ "); for (int i=0, size=param_types == null ? 0 : param_types.size(); i < size; i++) { defns_out.write(param_types.get(i) + " "); } defns_out.write("} debug_name_index=" + debug_name_index + " needs_arguments="+ ((flags & METHOD_Arguments) != 0 ? "true" : "false")+ " need_rest="+ ((flags & METHOD_Needrest) != 0 ? "true" : "false")+ " needs_activation="+ ((flags & METHOD_Activation) != 0 ? "true" : "false")+ " has_optional="+ ((flags & METHOD_HasOptional) != 0 ? "true" : "false")+ " ignore_rest="+ ((flags & METHOD_IgnoreRest) != 0 ? "true" : "false")+ " native="+ ((flags & METHOD_Native) != 0 ? "true" : "false")+ " has_param_names ="+ ((flags & METHOD_HasParamNames) != 0 ? "true" : "false")); if ((flags & METHOD_HasOptional) != 0) { defns_out.write(" optional_count=" + param_values.size()); defns_out.write(" optional_indexes={ "); for (int i=0, size=param_values == null ? 0 : param_values.size(); i < size; i++) { defns_out.write(" " + param_values.get(i)); } defns_out.write(" }"); defns_out.write(" optional_kinds={ "); for (int i=0, size=param_values == null ? 0 : param_values.size(); i < size; i++) { defns_out.write(" " + param_kinds.get(i)); } defns_out.write(" }"); } if ((flags & METHOD_HasParamNames) != 0) { defns_out.write(" param_names={ "); for (int i=0, size=param_names == null ? 0 : param_names.size(); i < size; i++) { defns_out.write(" " + param_names.get(i)); } defns_out.write(" }"); } defns_out.write(" -> " + method_info_index); } if (debug) { System.out.print("\n bytes.size() = " + bytes.size()); } Int(bytes,param_count); Int(bytes,return_type); for (int i=0; i < param_count; i++) { Int(bytes,param_types.get(i)); } Int(bytes,debug_name_index); Byte(bytes,flags); if ((flags & METHOD_HasOptional) != 0) { Int(bytes,param_values.size()); for (int i=0, n=param_values.size(); i < n; i++) { Int(bytes,param_values.get(i)); bytes.add(param_kinds.get(i)); } } if ((flags & METHOD_HasParamNames) != 0) { for (int i=0; i < param_count; i++) { Int(bytes,param_names.get(i)); } } return bytes; }
Make a MethodInfo
public RSAAgentConfig(RSAAMInstanceInfo instInfo){ Validate.notNull(instInfo,"RSAAMInstanceInfo"); this.get_instMap().put(instInfo.get_siteID(),instInfo); }
Minimum ctor with required attributes only
public boolean intersects(Vector3D other){ return other.getX() >= this.min.getX() && other.getX() < this.max.getX() ? (other.getY() >= this.min.getY() && other.getY() < this.max.getY() ? other.getZ() >= this.min.getZ() && other.getZ() < this.max.getZ() : false) : false; }
Checks if a vector is within this cuboid.
public boolean hasValue(){ return getValue() != null; }
Returns whether it has the number of times calendar was cleaned.
protected synchronized void expandBufferSizes(){ acceptLargeFragments=true; }
Expand the buffer size of both SSL/TLS network packet and application data.
public Object runSafely(Catbert.FastStack stack) throws Exception { Agent q=(Agent)stack.pop(); Agent a=(Agent)stack.pop(); if (Permissions.hasPermission(Permissions.PERMISSION_RECORDINGSCHEDULE,stack.getUIMgr())) Carny.getInstance().createPriority(a,q); return null; }
Establishes a priority of one Favorite over another. This will take undo any previous prioritization that it directly conflicts with. Favorites with a higher priority will be recorded over ones with a lower priority if there's a case where both cannot be recorded at once.
private void close(T stream){ try { stream.close(); } catch ( IOException e) { logger.warn("Unable to close intercepted stream: {}",e.getMessage()); logger.debug("I/O error prevented closure of intercepted stream.",e); } synchronized (stream) { stream.notify(); } }
Closes the given stream, logging any errors that occur during closure. The monitor of the stream is notified via a single call to notify() once the attempt to close has been made.
protected int selectOperator(){ lastUpdate++; if ((lastUpdate >= UPDATE_WINDOW) || (probabilities == null)) { lastUpdate=0; probabilities=getOperatorProbabilities(); } double rand=PRNG.nextDouble(); double sum=0.0; for (int i=0; i < operators.size(); i++) { sum+=probabilities[i]; if (sum > rand) { return i; } } throw new IllegalStateException(); }
Returns the index of one of the available operators randomly selected using the probabilities.
private void verifyPluginToAdd(final IPlugin<IPluginInterface> plugin){ Preconditions.checkNotNull(plugin,"IE00835: Plugin can't be null"); if ((plugin.getName() == null) || plugin.getName().equals("")) { throw new IllegalArgumentException("IE00836: Invalid plugin name"); } if (plugin.getGuid() == 0) { throw new IllegalArgumentException("IE00837: Invalid plugin GUID"); } for ( final IPlugin<IPluginInterface> oldPlugin : plugins) { if (oldPlugin == plugin) { throw new IllegalArgumentException("IE00838: Can not add plugin more than once"); } if (oldPlugin.getGuid() == plugin.getGuid()) { throw new IllegalArgumentException("IE00839: Plugin with GUID " + plugin.getGuid() + " already exists"); } } }
Verifies the validity of the plugin object to add to the registry. If the plugin is not as expected, throw an exception.
public void shutdown() throws Exception { (new Thread(this,"NestedActivate")).start(); if (obj != null) obj.shutdown(); }
Spawns a thread to deactivate the object.
@Override public ExampleSet createExampleSet(){ return createExampleSet(Collections.<Attribute,String>emptyMap()); }
Returns a new example set with all attributes switched on. All attributes given at creation time will be regular.
public Enumeration<AclEntry> entries(){ return acl.entries(); }
Returns an enumeration of the entries in this ACL. Each element in the enumeration is of type <CODE>java.security.acl.AclEntry</CODE>.
public void fsync(Result<Boolean> result) throws IOException { SegmentStream nodeStream=_nodeStream; if (nodeStream != null) { nodeStream.fsync(result); } else { result.ok(true); } }
sync the output stream with the filesystem when possible.
public static BufferedImage loadCompatibleImage(URL resource) throws IOException { BufferedImage image=ImageIO.read(resource); return toCompatibleImage(image); }
<p>Returns a new compatible image from a URL. The image is loaded from the specified location and then turned, if necessary into a compatible image.</p>
public synchronized void removeTextListener(TextListener cl){ m_textListeners.remove(cl); }
Remove a text listener