Refine search
/** * Add an {@link AsyncIOInterceptor} that will be invoked at the specified index position. * * @param filter {@link AsyncIOInterceptor * @param index * @return this */ public AtmosphereInterceptorWriter interceptor(AsyncIOInterceptor filter, int index) { if (!filters.contains(filter)) { if (logger.isTraceEnabled()) { logger.trace("Adding AsyncIOInterceptor {} at index {}", filter.getClass().getName(), index); } filters.add(index, filter); reversedFilters.add(reversedFilters.size() - index, filter); } return this; }
protected SecureSet(AuthPermission perm, Collection<? extends SST> s) { this(perm); // Subject's constructor receives a Set, we can trusts if a set is from bootclasspath, // and not to check whether it contains duplicates or not boolean trust = s.getClass().getClassLoader() == null; for (SST o : s) { verifyElement(o); if (trust || !elements.contains(o)) { elements.add(o); } } }
public org.pentaho.di.engine.model.Hop createHop( Operation from, Operation to, String type ) { Preconditions.checkArgument( operations.contains( from ), "!operations.contains(from)" ); Preconditions.checkArgument( operations.contains( to ), "!operations.contains(to)" ); Preconditions.checkArgument( from != to, "from == to" ); org.pentaho.di.engine.model.Hop hop = new org.pentaho.di.engine.model.Hop( from, to, type ); Preconditions.checkState( hops.stream().noneMatch( it -> it.getFrom() == from && it.getTo() == to ), "Hop from %s to %s already exists", from, to ); hops.add( hop ); return hop; }
public void setup_Graph(HashMap<AugmentedStmt, SwitchNode> binding) { Iterator rit = ((AugmentedStmt) as.bsuccs.get(0)).get_Reachers().iterator(); while (rit.hasNext()) { SwitchNode pred = binding.get(rit.next()); if (pred != null) { if (preds.contains(pred) == false) { preds.add(pred); } if (pred.succs.contains(this) == false) { pred.succs.add(this); } } } }
public void push() { final String item = (String) getSelectedItem(); final int count = getItemCount(); final LinkedList<String> l = new LinkedList<>(); for(int i=0; i<count; i++){ l.add(getItemAt(i)); } if(l.contains(item)){ // Item already present // Remove and add to bring it to the top removeItem(item); insertItemAt(item, 0); } else{ // Add new item if(item.trim().length() != 0 ) { // The total number of items should not exceed 20 if(count >= URL_COUNT_SIZE){ // Remove last item to give place // to new one removeItemAt(count - 1); } //l.addFirst(item); insertItemAt(item, 0); } } // make the selected item is the item we want setSelectedItem(item); } }
/** * Adds a directory that contains TypeScript definition files (sub-directories * are scanned recursively to find all .d.ts files). * * @param tsDefDir * a directory to scan for .d.ts files */ public void addTsDefDir(File tsDefDir) { if (!tsDefDirs.contains(tsDefDir)) { tsDefDirs.add(tsDefDir); } }