code
stringlengths
10
174k
nl
stringlengths
3
129k
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:10.577 -0500",hash_original_method="776A0D16BAF4033F49AFC0802778097D",hash_generated_method="1683E660BF0434876FDF5F0660A38086") public void preConcat(ColorMatrix prematrix)...
Concat this colormatrix with the specified prematrix. This is logically the same as calling setConcat(this, prematrix);
private Text text(Node node){ return new Text(node); }
This is used to convert the provided node to a text event. The conversion process ensures the node can be digested by the core reader and used to provide an <code>InputNode</code> that can be used to represent an XML attribute within the source document.
public CipherParameters generateDerivedMacParameters(int keySize){ return generateDerivedParameters(keySize); }
Generate a key parameter for use with a MAC derived from the password, salt, and iteration count we are currently initialised with.
private int convertToPanelX(double xval){ double temp=(xval - m_minX) / m_rangeX; temp=temp * m_panelWidth; return (int)temp; }
Convert an X coordinate from the instance space to the panel space.
public final void pushCurrentNodeAndExpression(int cn,int en){ m_currentNodes.push(cn); m_currentExpressionNodes.push(cn); }
Set the current context node and expression node.
private void addWaitLocations(int points,long startTime,TripStatistics tripStatistics,int timeOffset,int locationOffset){ for (int i=0; i < points; i++) { Location location=getLocation(locationOffset,locationOffset * .001,0,startTime + (i + timeOffset) * TEN_SECONDS); tripStatisticsUpdater.addLocation(locatio...
Sends some locations which are not moving and checks the statistics.
public static List propertyDescriptors(int apiLevel){ return PROPERTY_DESCRIPTORS; }
Returns a list of structural property descriptors for this node type. Clients must not modify the result.
@Override public boolean isActive(){ return amIActive; }
Used by the Whitebox GUI to tell if this plugin is still running.
private void loadSettings(){ loadStringSettings(); loadNumericSettings(); loadBooleanSettings(); loadListSettings(); loadMapSettings(); usercolorSettings.setData(owner.getUsercolorData()); imageSettings.setData(owner.getUsericonData()); imageSettings.setTwitchBadgeTypes(owner.getTwitchBadgeTypes()); h...
Loads all settings from the settings object
@Override public synchronized void addDataSourceListener(DataSourceListener dsl){ m_dataListeners.add(dsl); }
Add a data source listener
private MongoCollection readCollection(){ MongoClient mongoClient=new MongoClient(host,port); MongoDatabase db=mongoClient.getDatabase("local"); return db.getCollection("oplog.rs"); }
Loads the oplog collection.
private RequestInfo loadExistingRequest(int firstRequestNo) throws Exception { return loadRequest(providerDirPath + File.separator + firstRequestNo); }
Applies only to requests that are saved directly under queue directory.
public Object runSafely(Catbert.FastStack stack) throws Exception { String remoteName=getString(stack); int portNum=getInt(stack); SFIRTuner tun=ExternalTuningManager.getIRTunerPlugin(getString(stack),portNum); if (tun != null) return tun.getRemoteInfo(remoteName).confirmCmd; else return null; }
Gets the command that is to be sent as the last command to complete a channel change sequence. This is for devices that require an 'Enter' or other type of confirmation key to be pressed after the numeric channel codes are sent.
private static void checkCRL(DistributionPoint dp,ExtendedPKIXParameters paramsPKIX,X509Certificate cert,Date validDate,X509Certificate defaultCRLSignCert,PublicKey defaultCRLSignKey,CertStatus certStatus,ReasonsMask reasonMask,List certPathCerts) throws AnnotatedException { Date currentDate=new Date(System.currentTi...
Checks a distribution point for revocation information for the certificate <code>cert</code>.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:07.001 -0500",hash_original_method="4D4892762A483BC675FC4A10EF44F79C",hash_generated_method="6B225E7E6341B41D6D4DDAF47F896BB0") protected void geolocationPermissionsHidePrompt(){ mCallbackProxy.onGeolocationPermissionsHidePrompt()...
Hides the Geolocation permissions prompt.
public StrTokenizer(char[] input,StrMatcher delim){ this(input); setDelimiterMatcher(delim); }
Constructs a tokenizer splitting using the specified delimiter matcher. <p> The input character array is not cloned, and must not be altered after passing in to this method.
protected CascadedTable(Table parent,Predicate rowFilter,ColumnProjection colFilter,Class tupleType){ super(0,0,tupleType); m_parent=parent; m_pnames=new ArrayList(); m_rows=new CascadedRowManager(this); m_listener=new Listener(); setColumnProjection(colFilter); setRowFilter(rowFilter); m_parent.addTabl...
Create a new CascadedTable.
public static String encodePath(final String unescaped,final String charset) throws URIException { return encode(unescaped,URI.allowed_abs_path,charset); }
Escape and encode a string regarded as the path component of an URI with a given charset.
public NQueensBoard(int size){ this.size=size; squares=new int[size][size]; for (int i=0; i < size; i++) { for (int j=0; j < size; j++) { squares[i][j]=0; } } }
Creates a board with <code>size</code> rows and size columns. Column and row indices start with 0.
public void unblock(InetAddress address){ if (address == null) { throw new IllegalArgumentException("Adress to unblock can not be null"); } unblock(new Subnet(address,32)); }
Unblocks the specified endpoint.
public String[] snapshots(){ return this.snapshots; }
Returns the names of the snapshots.
void readString(StringBuilder sb) throws IOException { while (true) { int ch=read(); int len; switch (ch) { default : _peek=ch; return; case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e:...
Reads the Hessian value as an object.
public boolean isSetHeader(){ return this.header != null; }
Returns true if field header is set (has been assigned a value) and false otherwise
@DataProvider(name="RangeVersusCalendar") Object[][] provider_rangeVersusCalendar(){ return new Object[][]{{LocalDate.of(1873,1,1),LocalDate.of(2100,1,1)}}; }
Range of years to check consistency with java.util.Calendar
public boolean isQuoteAllQty(){ Object oo=get_Value(COLUMNNAME_IsQuoteAllQty); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; }
Get Quote All Quantities.
private void shareVideo(WXShareContent content,WXMediaMessage msg,SendMessageToWX.Req req){ WXVideoObject wxVideoObject=new WXVideoObject(); wxVideoObject.videoUrl=content.getVideo_url(); msg.mediaObject=wxVideoObject; msg.title=content.getTitle(); msg.description=content.getDescription(); req.transaction=b...
share video only
Node<E> first(){ restartFromHead: for (; ; ) { for (Node<E> h=head, p=h, q; ; ) { boolean hasItem=(p.item != null); if (hasItem || (q=p.next) == null) { updateHead(h,p); return hasItem ? p : null; } else if (p == q) continue restartFromHead; else p=q; } ...
Returns the first live (non-deleted) node on list, or null if none. This is yet another variant of poll/peek; here returning the first node, not element. We could make peek() a wrapper around first(), but that would cost an extra volatile read of item, and the need to add a retry loop to deal with the possibility of l...
@Override public boolean isActive(){ return amIActive; }
Used by the Whitebox GUI to tell if this plugin is still running.
public DeleteSubscriptionsResponse clone(){ DeleteSubscriptionsResponse result=new DeleteSubscriptionsResponse(); result.ResponseHeader=ResponseHeader == null ? null : ResponseHeader.clone(); result.Results=Results == null ? null : Results.clone(); result.DiagnosticInfos=DiagnosticInfos == null ? null : Diagnos...
Deep clone
public void route(ScheduledTour tour){ MatsimVehicleAdapter matsimVehicle=new MatsimVehicleAdapter(tour.getVehicle()); double currTime=tour.getDeparture(); Id prevLink=tour.getTour().getStartLinkId(); Leg prevLeg=null; for ( TourElement e : tour.getTour().getTourElements()) { if (e instanceof Leg) { ...
Routes a scheduledTour in time and space. <p>Uses a leastCostPathCalculator to calculate a route/path from one activity to another. It starts at the departureTime of the scheduledTour and determines activity arrival and departure times considering activities time-windows.
public boolean forEachKey(TFloatProcedure procedure){ return forEach(procedure); }
Executes <tt>procedure</tt> for each key in the map.
public static boolean zipAlignAPk(File in,File out){ if (out.exists()) { return true; } String[] cmd={S.getZipalign(),"4",in.getAbsolutePath(),out.getAbsolutePath()}; CmdUtils.runCommand(cmd); return out.exists(); }
zipalign a given apk
private int createServer() throws IOException { CacheServer server=null; Properties p=new Properties(); p.put(MCAST_PORT,"0"); p.put(LOCATORS,""); this.system=DistributedSystem.connect(p); this.cache=CacheFactory.create(system); server=this.cache.addCacheServer(); int port=AvailablePort.getRandomAvailab...
Creates and starts the server instance
private void addSCToXbrick(Map<String,List<String>> xBricksToSelectedSCs,String xBrick,String storageController){ if (xBricksToSelectedSCs.get(xBrick) == null) { xBricksToSelectedSCs.put(xBrick,new ArrayList<String>()); } if (!xBricksToSelectedSCs.get(xBrick).contains(storageController)) { xBricksToSelect...
Adds the selected Storage controller to X-brick in the xBricksToSelectedSCs map.
@Override public void discardAllEdits(){ super.discardAllEdits(); updateActions(); setHasSignificantEdits(false); }
Discards all edits.
public static Object invoke(Object obj,String methodName,Class clazz,Object newValue) throws NoSuchMethodException { try { Method method=obj.getClass().getMethod(methodName,new Class[]{clazz}); return method.invoke(obj,new Object[]{newValue}); } catch ( IllegalAccessException e) { throw new NoSuchMeth...
Invokes the specified setter method if it exists.
public static boolean isInPeriod(Date date,Date periodStart) throws AdeException { return getContainingPeriodStart(date).equals(periodStart); }
Check to see if a date is within a given period.
private static boolean contains(String value,int start,int length,String criteria1,String criteria2,String criteria3,String criteria4,String criteria5){ return contains(value,start,length,new String[]{criteria1,criteria2,criteria3,criteria4,criteria5}); }
Shortcut method with 5 criteria
private JSONArray arrayFromStrings(List<String> strings){ final JSONArray array=new JSONArray(); if (strings != null) { for ( final String eachString : strings) { array.put(eachString); } } return array; }
Converts an array of strings to a JSONArray
public static String exchangeForSessionToken(String onetimeUseToken,PrivateKey key) throws IOException, GeneralSecurityException, AuthenticationException { return exchangeForSessionToken(DEFAULT_PROTOCOL,DEFAULT_DOMAIN,onetimeUseToken,key); }
Exchanges the one time use token returned in the URL for a session token. <p> If the <code>key</code> is non-null, the token will be used securely and the request to make the exchange will be signed.
protected URL makeIssuesFeedUrl(String proj) throws MalformedURLException { return new URL(FEED_URI_BASE + "/p/" + proj+ "/issues"+ PROJECTION); }
Constructs issues feed URL.
private static void read(final InputStream istream,final byte[] bytes) throws IOException { int pos=0; while (pos < bytes.length) { int read=istream.read(bytes,pos,bytes.length - pos); if (read < 0) { throw new RuntimeException("premature EOF"); } pos+=read; } }
Helper method that will read the InputStream repeatedly until the given array is filled.
public static boolean putFloat(Context context,String key,float value){ SharedPreferences settings=context.getSharedPreferences(PREFERENCE_NAME,Context.MODE_PRIVATE); SharedPreferences.Editor editor=settings.edit(); editor.putFloat(key,value); return editor.commit(); }
put float preferences
private void testFloatRange(int precisionStep) throws Exception { final String field="ascfield" + precisionStep; final int lower=-1000, upper=+2000; Query tq=LegacyNumericRangeQuery.newFloatRange(field,precisionStep,NumericUtils.sortableIntToFloat(lower),NumericUtils.sortableIntToFloat(upper),true,true); TopDoc...
we fake a float test using int2float conversion of LegacyNumericUtils
public void copyInterval(TerminalRow line,int sourceX1,int sourceX2,int destinationX){ final int x1=line.findStartOfColumn(sourceX1); final int x2=line.findStartOfColumn(sourceX2); boolean startingFromSecondHalfOfWideChar=(sourceX1 > 0 && line.wideDisplayCharacterStartingAt(sourceX1 - 1)); final char[] sourceCh...
NOTE: The sourceX2 is exclusive.
private Object run(String expr){ StellarProcessor processor=new StellarProcessor(); assertTrue(processor.validate(expr)); return processor.parse(expr,null,StellarFunctions.FUNCTION_RESOLVER(),Context.EMPTY_CONTEXT()); }
Runs a Stellar expression.
public Object put(Object key,Object value){ key=convertKey(key); int hashCode=hash(key); int index=hashIndex(hashCode,data.length); HashEntry entry=data[index]; while (entry != null) { if (entry.hashCode == hashCode && isEqualKey(key,entry.key)) { Object oldValue=entry.getValue(); updateEntry(...
Puts a key-value mapping into this map.
public void requestFocus(){ Form rootForm=getComponentForm(); if (rootForm != null) { Component.setDisableSmoothScrolling(true); rootForm.requestFocus(this); Component.setDisableSmoothScrolling(false); } }
Changes the current component to the focused component, will work only for a component that belongs to a parent form.
public DocumentAnnotation_Type(JCas jcas,Type casType){ super(jcas,casType); casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType,getFSGenerator()); casFeat_language=jcas.getRequiredFeatureDE(casType,"language","uima.cas.String",featOkTst); casFeatCode_language=(null == casFeat_language) ? JC...
initialize variables to correspond with Cas Type and Features
public Categories addCategories(String... categories){ Categories prop=new Categories(categories); addCategories(prop); return prop; }
Adds a list of "tags" or "keywords" that describe the event.
public static void close(){ out.close(); }
Close standard output.
public long count(){ return count; }
Returns the number of values.
public void addRow(){ ViewGroup row=getLastResultsRow(); while (row.getChildCount() < 3) { inflate(getContext(),R.layout.image_card,row); } presenter.drawNewRowIfNeeded(); }
Inflate a new row Bind data to row Add row to container <p>
public static ToHitData toHit(IGame game,int attackerId,Targetable target){ final Entity ae=game.getEntity(attackerId); if (ae == null) { return new ToHitData(TargetRoll.IMPOSSIBLE,"You can't attack from a null entity!"); } if (!game.getOptions().booleanOption("tacops_grappling")) { return new ToHitData...
To-hit number
synchronized public void add(T item,double[] itemCoords){ this.addItem(item,itemCoords,null); }
Add an item to the quadtree. Any duplicates are duplicated in the tree.
public static String toStringWithLimit(Object parameter){ if (parameter == null) { return NULL_STR; } String value=parameter.toString(); try { if (value.length() > DEFAULT_ARG_STRING_MAX_LENGTH) { value=value.substring(0,DEFAULT_ARG_STRING_MAX_LENGTH) + DEFAULT_MAX_STRING_ENDING; } return ...
Turns a single method parameter into a string. To keep the functionality safe we truncate overly long strings and ignore any exceptions.
private void writeFlowModToSwitch(long dpid,OFFlowMod flowMod){ IOFSwitch ofSwitch=floodlightProvider.getSwitch(dpid); if (ofSwitch == null) { if (log.isDebugEnabled()) { log.debug("Not deleting key {} :: switch {} not connected",dpid); } return; } writeFlowModToSwitch(ofSwitch,flowMod); }
Writes an OFFlowMod to a switch. It checks to make sure the switch exists before it sends
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-02-25 10:38:09.193 -0500",hash_original_method="CE987E2D0639A8371474E03A1BAB7064",hash_generated_method="5AC65724670398C7D1047F737CC67B1A") public int group(String newsgroup) throws IOException { return sendCommand(NNTPCommand.GROUP,newsgroup...
A convenience method to send the NNTP GROUP command to the server, receive the reply, and return the reply code. <p>
AlignmentPatternFinder(BitMatrix image,int startX,int startY,int width,int height,float moduleSize,ResultPointCallback resultPointCallback){ this.image=image; this.possibleCenters=new ArrayList<AlignmentPattern>(5); this.startX=startX; this.startY=startY; this.width=width; this.height=height; this.moduleS...
<p>Creates a finder that will look in a portion of the whole image.</p>
public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; Text textNode; Text splitNode; String value; doc=(Document)load("staff",true); elementList=doc.getElementsByTagName("name"); nameNode=elementList.item(2); textNode=(Text)nameNode.getFirstChild(); splitNode=...
Runs the test case.
public final AC align(String side){ return align(side,curIx); }
Specifies the current row/column's columns default alignment <b>for its components</b>. It does not affect the positioning or size of the columns/row itself. For columns it is the horizonal alignment (e.g. "left") and for rows it is the vertical alignment (e.g. "top"). <p> For a more thorough explanation of what this c...
public void startClean() throws Exception { FileUtils.deleteDirectory(dataDir); start(); }
Starts the Cassandra DB but deletes any existing data files first
private void updateProgress(int progress){ if (myHost != null && progress != previousProgress) { myHost.updateProgress(progress); } previousProgress=progress; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
public static void nl(String nl){ Formatting.nl=nl; Formatting.dnl=nl + nl; Formatting.nltab=nl + tab; Formatting.scnl=SC + nl; Formatting.scdnl=SC + dnl; Formatting.cnl=COMMA + nl; }
Sets which new-line-character to use. Should be set before any code generation happens for indentation to work as expected.
double C(){ int N=data.size(); double C=0.0; int i=0; while (i < N) { int j=i + 1; while ((j < N) && (data.get(i).getValue() == data.get(j).getValue())) { j++; } C+=Math.pow(j - i,3.0) - (j - i); i=j; } return 1 - C / (Math.pow(N,3.0) - N); }
Computes the correction factor for ties. See equation (22-3) in the reference book for details.
public boolean doesTableOfContentsHaveAnyNotebooks(String tableOfContentsId){ return db.doesTableOfContentsHaveAnyNotebooks(tableOfContentsId); }
API method. Returns true if the table of contents has any notebooks.
public <D>D oneToMany(D destination,final T source,final NullPointerControl nullPointerControl,final MappingType mtDestination,final MappingType mtSource){ try { return this.<D,T>getJMapper(relationalOneToManyMapper,destination.getClass()).getDestination(destination,source,nullPointerControl,mtDestination,mtSourc...
This Method returns the destination given in input enriched with data contained in source given in input<br> with this setting: <table summary =""> <tr> <td><code>NullPointerControl</code></td><td>nullPointerControl</td> </tr><tr> <td><code>MappingType</code> of Destination</td><td>mtDestination</td> </tr><tr> <td><cod...
public Class<?> findClassImpl(String name) throws ClassNotFoundException { if (_isVerbose) verbose(name,"findClass"); if (_lifecycle.isDestroyed()) { log().fine("Class loader has been closed."); return super.findClass(name); } if (_lifecycle.isBeforeInit()) init(); if (name.indexOf('/') >= 0) na...
Load a class using this class loader
public ElemTemplateElement appendChild(ElemTemplateElement newChild){ int type=((ElemTemplateElement)newChild).getXSLToken(); switch (type) { case Constants.ELEMNAME_TEXTLITERALRESULT: case Constants.ELEMNAME_APPLY_TEMPLATES: case Constants.ELEMNAME_APPLY_IMPORTS: case Constants.ELEMNAME_CALLTEMPLATE: case Constants....
Add a child to the child list.
static void printXml(DexData dexData,boolean justClasses){ ClassRef[] externClassRefs=dexData.getExternalReferences(); String prevPackage=null; for (int i=0; i < externClassRefs.length; i++) { ClassRef cref=externClassRefs[i]; String declClassName=cref.getName(); String className=classNameOnly(declCla...
Prints the output in XML format. We shouldn't need to XML-escape the field/method info.
public static ObjectAnimator ofInt(Object target,String propertyName,int... values){ ObjectAnimator anim=new ObjectAnimator(target,propertyName); anim.setIntValues(values); return anim; }
Constructs and returns an ObjectAnimator that animates between int values. A single value implies that that value is the one being animated to. Two values imply a starting and ending values. More than two values imply a starting value, values to animate through along the way, and an ending value (these values will be d...
public void close(){ if (myListPopUp != null) { myListPopUp.cancel(); } }
Close suggestion list
public void testAddAndSumMT() throws Throwable { final int incs=1000000; final int nthreads=4; final ExecutorService pool=Executors.newCachedThreadPool(); LongAdder a=new LongAdder(); CyclicBarrier barrier=new CyclicBarrier(nthreads + 1); for (int i=0; i < nthreads; ++i) pool.execute(new AdderTask(a,barri...
adds by multiple threads produce correct sum
public boolean isCodenvyUsageLegal() throws ServerException, IOException { long actualUsers=userManager.getTotalCount(); int actualServers=dockerConnector.getAvailableNodes().size(); try { CodenvyLicense codenvyLicense=load(); return codenvyLicense.isLicenseUsageLegal(actualUsers,actualServers); } catc...
Return true if only Codenvy usage meets the constrains of license properties or free usage properties.
@Override public String toString(){ return this.name; }
An override of the toString() method
private void showFeedback(String feedback){ if (myHost != null) { myHost.showFeedback(feedback); } else { System.out.println(feedback); } }
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
@SuppressWarnings("unchecked") public <T>T loadAs(InputStream input,Class<T> type){ return (T)loadFromReader(new StreamReader(new UnicodeReader(input)),type); }
Parse the only YAML document in a stream and produce the corresponding Java object.
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:28:38.434 -0500",hash_original_method="13ED4597857164B01AAF7D1C6E2C9384",hash_generated_method="CCBE22CE3839C3F0D1FFDCDB80A9C33B") private synchronized long insertInternal(Conte...
Performs an insert, adding a new row with the given values.
public SignalServiceGroup(Type type,byte[] groupId,String name,List<String> members,SignalServiceAttachment avatar){ this.type=type; this.groupId=groupId; this.name=Optional.fromNullable(name); this.members=Optional.fromNullable(members); this.avatar=Optional.fromNullable(avatar); }
Construct a group context.
public void add(final double operand){ this.value+=operand; }
Adds a value to the value of this instance.
public DTMIterator cloneWithReset() throws CloneNotSupportedException { NodeSetDTM clone=(NodeSetDTM)clone(); clone.reset(); return clone; }
Get a cloned Iterator, and reset its state to the beginning of the iteration.
protected int index(int rank){ return zero + rank * stride; }
Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array. You may want to override this method for performance.
public static String monitorProcessOutput(Process p,String theString){ boolean keepReadingLines=true; boolean endOfLine=false; boolean foundIt=false; boolean appRunning=true; String ret=null; int readInt=-1; InputStream is=null; BufferedReader br=null; String line=""; try { is=p.getInputStream()...
Given a process and a string, monitors the output of the process for the string. Returns the line in which the string is found, or null if not found. It will continue until the process exits.
public void actionPerformed(ActionEvent e){ if (fileChooser == null) { fileChooser=jmri.jmrit.XmlFile.userFileChooser(Bundle.getMessage("PromptXmlFileTypes"),"xml"); fileChooser.setDialogType(JFileChooser.OPEN_DIALOG); fileChooser.setCurrentDirectory(new File(ThrottleFrame.getDefaultThrottleFolder())); ...
The action is performed. Let the user choose the file to load from. Read XML for each ThrottleFrame.
private void loadForm(HttpServletRequest request,TimetableManagerForm frm) throws Exception { Long mgrId=null; String uniqueId=request.getParameter("id"); if (uniqueId == null || uniqueId.trim().length() == 0) throw new Exception("Manager Id could not be read."); try { mgrId=new Long(uniqueId); } catch...
Load details of manager from database
boolean isConnected(){ if (fConnected == null) return false; return !fConnected.isEmpty(); }
Return whether or not any clients are connected to the receiver.
private void findAnnotations(int offset,IAnnotationModel model,IDocument document,int lineNumber){ annotations.clear(); if (model == null) { if (editor != null) { ITextEditor editor=this.editor; model=editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput()); } } if (model == ...
Finds annotations either by offset or by lineNumber
protected void computeFolderChildren(File folder,boolean isIncluded,String[] pkgName,ArrayList vChildren,char[][] inclusionPatterns,char[][] exclusionPatterns) throws JavaModelException { if (isIncluded) { IPackageFragment pkg=getPackageFragment(pkgName); vChildren.add(pkg); } try { File[] members=fol...
Starting at this folder, create package fragments and add the fragments that are not exclused to the collection of children.
public DefaultTableModel(Object[] columnNames,int rowCount){ this(convertToVector(columnNames),rowCount); }
Constructs a <code>DefaultTableModel</code> with as many columns as there are elements in <code>columnNames</code> and <code>rowCount</code> of <code>null</code> object values. Each column's name will be taken from the <code>columnNames</code> array.
public static boolean isTransaction(int choice){ return choice > 0 && choice < 4; }
Return true if choice is a transaction
public static String toStringPretty(JsonObject jsonObj,int level){ StringBuffer buf=new StringBuffer(); buf.append("{"); buf.append(fieldsToStringPretty(jsonObj,level + 1)); buf.append("}"); return buf.toString(); }
Returns a pretty printed string of the given Json object, indented at the given level.
public static void createTable(SQLiteDatabase db,boolean ifNotExists){ String constraint=ifNotExists ? "IF NOT EXISTS " : ""; db.execSQL("CREATE TABLE " + constraint + "'CONTACT' ("+ "'_id' INTEGER PRIMARY KEY ,"+ "'NAME' TEXT,"+ "'EMAIL' TEXT);"); }
Creates the underlying database table.
public Key minKey(){ if (isEmpty()) throw new NoSuchElementException("Priority queue is empty"); return min.key; }
Get the minimum key currently in the queue Worst case is O(1)
public void writeDouble(double d,boolean append){ writeDoubleArray(new double[]{d},append); }
Write a double in a binary File
public static void developerLog(final Throwable t){ if (License.isDeveloper()) { userLog(t); } }
Write a throwable to the log stream for developers only. If writing to the log stream fails and the log stream differs from <code>System.err</code>, then an attempt is made to redirect the message to <code>System.err</code>.
public void removeImageView(CubeImageView imageView){ if (null == imageView || null == mFirstImageViewHolder) { return; } ImageViewHolder holder=mFirstImageViewHolder; do { if (holder.contains(imageView)) { if (holder == mFirstImageViewHolder) { mFirstImageViewHolder=holder.mNext; } ...
Remove the ImageView from ImageTask
protected void updateTabButtonAt(int index){ TabButton button=buttonForTab(index); button.setText(tabPane.getTitleAt(index)); button.setIcon(tabPane.getIconAt(index)); button.setDisabledIcon(tabPane.getDisabledIconAt(index)); Color background=tabPane.getBackgroundAt(index); if (background == null) { bac...
Called whenever a property of a tab is changed
public static int toIntValue(boolean b){ return b ? 1 : 0; }
cast a boolean value to a int value (primitive value type)
public T remove(URI id){ return cache.remove(id); }
Removes a resource from the cache.
public static void apply(){ applyOpenSSLFix(); installLinuxPRNGSecureRandom(); }
Applies all fixes.