code
stringlengths
10
174k
nl
stringlengths
3
129k
public static StringBuilder formatTo(StringBuilder buf,double[] d,String sep){ if (d == null) { return buf.append("null"); } if (d.length == 0) { return buf; } buf.append(d[0]); for (int i=1; i < d.length; i++) { buf.append(sep); buf.append(d[i]); } return buf; }
Formats the double array d with the default number format.
@Override public boolean dataDefinitionCausesTransactionCommit(){ debugCodeCall("dataDefinitionCausesTransactionCommit"); return true; }
Returns whether CREATE/DROP commit an open transaction.
public static Attribute createAttribute(int valueType){ return createAttribute(createName(),valueType); }
Creates a simple single attribute depending on the given value type. The name is randomly created. This attribute can also be used for generators to define their desired input attributes for compatibility checks.
public TitledBorder(Border border){ this(border,"",LEADING,DEFAULT_POSITION,null,null); }
Creates a TitledBorder instance with the specified border and an empty title.
public float computeDistance(Vec2 p,int childIndex,Vec2 normalOut){ return m_shape.computeDistanceToOut(m_body.getTransform(),p,childIndex,normalOut); }
Compute the distance from this fixture.
protected void reset(){ try { changing=true; element.setAttributeNS(namespaceURI,localName,Float.toString(x) + ' ' + y+ ' '+ w+ ' '+ h); } finally { changing=false; } }
Resets the value of the associated attribute.
public static SnapshotDirectory from(Snapshot snapshot,FileConfig config){ return SnapshotDirectory.from(config.base(),snapshot.backupUDID(),Integer.toString(snapshot.snapshotID()),config.isFlat(),config.isCombined(),config.combinedDirectory()); }
Returns a new instance.
@Bean ItemProcessor<StudentDTO,StudentDTO> excelStudentProcessor(){ return new LoggingStudentProcessor(); }
If your Excel document has no header, you have to create a custom row mapper and configure it here.
private void updateProgress(String progressLabel,int progress){ if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) { myHost.updateProgress(progressLabel,progress); } previousProgress=progress; previousProgressLabel=progressLabel; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
FormatInformation readFormatInformation() throws FormatException { if (parsedFormatInfo != null) { return parsedFormatInfo; } int formatInfoBits1=0; for (int i=0; i < 6; i++) { formatInfoBits1=copyBit(i,8,formatInfoBits1); } formatInfoBits1=copyBit(7,8,formatInfoBits1); formatInfoBits1=copyBit(8,8...
<p>Reads format information from one of its two locations within the QR Code.</p>
public SocketConnection acceptConnection() throws IOException { if (mAcceptSocket != null) { if (sLogger.isActivated()) { sLogger.debug("Socket serverSocket is waiting for incoming connection"); } Socket socket=mAcceptSocket.accept(); return new AndroidSocketConnection(socket); } throw new I...
Accept connection
public ProtocolHeartbeat(){ super(null); }
Instantiate heartbeat event. Heartbeats do not have a payload.
public boolean shouldSendToCrashlytics(){ return report; }
Returns true, if this exception should be logged
public IntegerInterleavedRaster(SampleModel sampleModel,DataBuffer dataBuffer,Point origin){ this(sampleModel,dataBuffer,new Rectangle(origin.x,origin.y,sampleModel.getWidth(),sampleModel.getHeight()),origin,null); }
Constructs a IntegerInterleavedRaster with the given SampleModel and DataBuffer. The Raster's upper left corner is origin and it is the same sizes the SampleModel. The DataBuffer is not initialized and must be a DataBufferInt compatible with SampleModel. SampleModel must be of type SinglePixelPackedSampleModel.
protected void put(String propName,Object propValue){ properties.put(propName,propValue); }
Allow StringTemplate to add values, but prevent the end user from doing so.
public void printDate(Calendar calendar) throws IOException { int year=calendar.get(Calendar.YEAR); os.write((char)('0' + (year / 1000 % 10))); os.write((char)('0' + (year / 100 % 10))); os.write((char)('0' + (year / 10 % 10))); os.write((char)('0' + (year % 10))); int month=calendar.get(Calendar.MONTH) + 1...
Prints a date.
static void stopQRMThread(){ qrmThread.shutdown(); }
get the qrm thread for testing purposes
private int readAheadNonBlocking() throws IOException { int avail=in.available(); if (avail > 0) { ensureRawAvailable(avail); int nread; try { nread=in.read(rawData,rawCount,avail); } catch ( IOException e) { error=true; throw e; } if (nread < 0) { error=true; ...
Reads any available bytes from the underlying stream into <code>rawData</code> and returns the number of bytes of chunk data available in <code>chunkData</code> that the application can read.
public Item(String affiliation,String role){ this.affiliation=affiliation; this.role=role; }
Creates a new item child.
public Object runSafely(Catbert.FastStack stack) throws Exception { MediaFile mf=getMediaFile(stack); if (mf != null && mf.isPicture()) { if (!mf.isThumbnailEmbedded()) { java.io.File thumbPath=mf.getGeneratedThumbnailFileLocation(); thumbPath.delete(); MetaImage.clearFromCache(thumbPath); ...
Regenerates the thumbnail associated with the specified picture file. Sometimes the rotation may be mis-aligned from the thumbnail and this allows a way to repair that.
@Override public Vertex parseState(TextStream stream,Map<String,Map<String,Vertex>> elements,boolean debug,Network network){ List<String> comments=null; String next=stream.nextWord(); if (next == null || !next.equalsIgnoreCase("state")) { throw new SelfParseException("Expecting state not: " + next,stream); ...
Parse the state and any referenced states or variables.
@ObjectiveCName("onProfileClosedWithUid:") public void onProfileClosed(int uid){ modules.getEvents().post(new PeerInfoClosed(Peer.user(uid))); }
MUST be called on profile closed
private void finishBuildingStateTable(boolean forward){ backfillLoopingStates(); int[] rowNumMap=new int[tempStateTable.size()]; Stack<Integer> rowsToFollow=new Stack<>(); rowsToFollow.push(new Integer(1)); rowNumMap[1]=1; while (rowsToFollow.size() != 0) { int rowNum=rowsToFollow.pop().intValue(); ...
This function completes the state-table-building process by doing several postprocessing steps and copying everything into its final resting place in the iterator itself
public static boolean isMimeTypeImage(String mimeType){ return mimeType != null && mimeType.startsWith("image/"); }
Checks whether the MIME type represents an image media item.
public ModuleLoader createModuleLoaderFromString(EDataType eDataType,String initialValue){ ModuleLoader result=ModuleLoader.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '"+ eDataType.getName()+ "'"); return result; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void periodicProcessing() throws PayloadException, NetworkException { if (sLogger.isActivated()) { sLogger.info("Execute re-registration"); } register(); }
Registration processing
ArchivedCoupling addCoupling(final Coupling<?> coupling){ ArchivedCoupling c=new ArchivedCoupling(this,coupling); archivedCouplings.add(c); return c; }
Adds a coupling to the archive.
public void delay(int napTime){ try { Thread.sleep(napTime); } catch ( InterruptedException e) { } }
The delay() function causes the program to halt for a specified time. Delay times are specified in thousandths of a second. For example, running delay(3000) will stop the program for three seconds and delay(500) will stop the program for a half-second. <p/> The screen only updates when the end of draw() is reached, so ...
public boolean isValidSavepoint(Savepoint sp){ if (isSource()) return false; boolean result=false; if (sp != null) result=true; return result; }
checks whether a savepoint is valid
public void stop(){ Logger.printDebug("OscP5.stop","starting to stop oscP5."); _myOscNetManager.stop(); Logger.printDebug("OscP5.stop","stopping oscP5."); }
stop oscP5 and close open Sockets.
private static Object[] loadKey(final InputStream keyInput) throws Exception { final Object[] sizeModExp=new Object[3]; try (final DataInputStream in=new DataInputStream(keyInput)){ sizeModExp[0]=in.readInt(); byte[] buff=new byte[in.readInt()]; in.read(buff); sizeModExp[1]=new BigInteger(buff); ...
Loads a key from the specified file.
public static String displaySet(String setName,Set<String> set){ StringBuilder sb=new StringBuilder(); sb.append(setName); sb.append(":\n"); if (set.isEmpty()) { sb.append("None\n"); } else { int count=0; for ( String value : set) { sb.append(" ["); sb.append(++count); sb.ap...
Display the values in a Set
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:31.227 -0500",hash_original_method="5859C0A727537B8EC88F05E2B2FE00D6",hash_generated_method="F741D2A1942CB111613D0D4114618CDE") public static Integer valueOf(String string,...
Parses the specified string as a signed integer value using the specified radix.
public CursorResponseMessage(CursorResponseMessage other){ __isset_bitfield=other.__isset_bitfield; if (other.isSetHeader()) { this.header=new AsyncMessageHeader(other.header); } this.cursorId=other.cursorId; if (other.isSetValues()) { List<KeyedValues> __this__values=new ArrayList<KeyedValues>(); ...
Performs a deep copy on <i>other</i>.
public void destroy(){ mController.destroy(); }
Optionally call when no longer using the TransportController. Its resources will also be automatically cleaned up when your activity/view is detached from its window, so you don't normally need to call this explicitly.
public void tokenVerified(boolean valid,String result){ setTokenInfo(result); verifyToken.setEnabled(true); update(); }
Set the result of the token verification (except the scopes).
private static String stringValue(Object attributeValue){ if (attributeValue == null) { return (null); } else if (attributeValue instanceof String) { return ((String)attributeValue); } else { return (attributeValue.toString()); } }
<p>Return the specified attribute value, converted to a <code>String</code>.</p>
public boolean isLeaveBlacklisted(){ return fieldLeaveBlacklisted; }
Returns the keepRejected.
public static <T>LazySortedSetX<T> fromIterable(Collector<T,?,SortedSet<T>> collector,Iterable<T> it){ if (it instanceof LazySortedSetX) return (LazySortedSetX<T>)it; if (it instanceof SortedSet) return new LazySortedSetX<T>((SortedSet<T>)it,collector); return new LazySortedSetX<T>(Flux.fromIterable(it),colle...
Construct a LazySortedSetX from an Iterable, using the specified Collector.
@Override public boolean equals(Object obj){ if (this == obj) { return true; } if (obj instanceof VOPaymentType) { VOPaymentType other=(VOPaymentType)obj; if (paymentTypeId != null) { return paymentTypeId.equals(other.paymentTypeId); } } return false; }
Indicates whether the given object is equal to this one.
public String decode(String input){ if (Encoding.isURLEncoded(input)) { input=helpers.urlDecode(input); } if (Encoding.isBase64Encoded(input)) { input=helpers.bytesToString(helpers.base64Decode(input)); } if (Encoding.isJSON(input)) { return input; } return null; }
Decode the JSON String.
protected List<RandomVariable> order(BayesianNetwork bn,Collection<RandomVariable> vars){ List<RandomVariable> order=new ArrayList<RandomVariable>(vars); Collections.reverse(order); return order; }
<b>Note:</b>Override this method for a more efficient implementation as outlined in AIMA3e pgs. 527-28. The default implementation does not perform any of these.<br>
public void updateAll(){ if (!busy) { setUpdateBusy(); LnSensorUpdateThread thread=new LnSensorUpdateThread(this,tc); thread.start(); } }
Requests status updates from all layout sensors.
public float[] generateTransformedValuesBarChart(List<? extends Entry> entries,int dataSet,BarData bd,float phaseY){ float[] valuePoints=new float[entries.size() * 2]; int setCount=bd.getDataSetCount(); float space=bd.getGroupSpace(); for (int j=0; j < valuePoints.length; j+=2) { Entry e=entries.get(j / 2);...
Transforms an List of Entry into a float array containing the x and y values transformed with all matrices for the BARCHART.
public OptionsHttpSessionsTableModel(){ super(); }
Instantiates a new options http sessions table model.
public void accumulateAll(List<TaggedLogAPIEntity> entities) throws Exception { for ( TaggedLogAPIEntity entity : entities) { accumulate(entity); } }
accumulate a list of entities
public static EverythingMatcher<TriggerKey> allTriggers(){ return new EverythingMatcher<TriggerKey>(); }
Create an EverythingMatcher that matches all triggers.
public void updateFromRaw(FilterType ftype,byte[] rowb,byte[] rowbprev,int rown){ updateFromRawOrFiltered(ftype,null,rowb,rowbprev,rown); }
alternative: computes statistic without filtering
public void addRecentFile(File recentFile){ jmrfRecentFiles.add(createRecentFileMenuItem(jmrfRecentFiles,recentFile)); }
Add a file to the top of the recently opened files.
public static void writeApplicationXml(ApplicationXml appXml,OutputStream output,String encoding,boolean isIndent) throws IOException { Format format=Format.getPrettyFormat(); if (encoding != null) { format.setEncoding(encoding); } XMLOutputter serializer=new XMLOutputter(format); serializer.output(appXml...
Writes the specified document to an output stream.
public void test_tx_begin_rollback() throws RepositoryException { assertFalse(cxn.isActive()); cxn.begin(); assertTrue(cxn.isActive()); cxn.rollback(); assertFalse(cxn.isActive()); }
Basic test creates a read/write connection, issues begin(), and then issues rollback() on the connection.
public IElementType advance() throws java.io.IOException { int zzInput; int zzAction; int zzCurrentPosL; int zzMarkedPosL; int zzEndReadL=zzEndRead; CharSequence zzBufferL=zzBuffer; char[] zzBufferArrayL=zzBufferArray; char[] zzCMapL=ZZ_CMAP; int[] zzTransL=ZZ_TRANS; int[] zzRowMapL=ZZ_ROWMAP; int...
Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.
private void enableOrDisable(final PWRow row,final boolean enabled){ for ( final PWWidget widget : row.widgets) { final boolean widgetEnable=widget.enableOrDisable(); for ( final Control c : widget.getControls()) { if (!c.isDisposed()) { c.setEnabled(enabled && widgetEnable); } } ...
Enable or disable a row
public void testResourcesAvailable(){ new IrishAnalyzer().close(); }
This test fails with NPE when the stopwords file is missing in classpath
private PropertyManager(Properties props){ this.props=props; }
<p>Constructs a new <code>PropertyManager</code> instance.</p>
public Jerry toggleClass(String... classNames){ for ( Node node : nodes) { String attrClass=node.getAttribute("class"); Set<String> classes=createPropertiesSet(attrClass,' '); for ( String className : classNames) { if (classes.contains(className) == true) { classes.remove(className); ...
Adds or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
public RenamePackageProcessor(IPackageFragment fragment){ fPackage=fragment; if (fPackage != null) setNewElementName(fPackage.getElementName()); fUpdateReferences=true; fUpdateTextualMatches=false; fRenameSubpackages=false; }
Creates a new rename package processor.
public void write(String str,int off,int len) throws IOException { out.write(str,off,len); }
Writes a portion of a string.
public void removeAll(){ dockPanel.removeAll(); }
We need to handle removing all components specially.
public T progress(Object view){ progress=view; return self(); }
Set the progress bar and show the progress for the next ajax/image request. Once ajax or image is called, current progress view is consumed. Subsequent ajax/image calls won't show progress view unless progress is called again. If a file or network requests is required, the progress bar is set to be "VISIBLE". Once the...
private void terminateProperlyAudit(AuditServiceThread thread){ thread.remove(this); if (pageAuditExecutionList.remove(thread)) { processPageAuditWaitQueue(); } else if (scenarioAuditExecutionList.remove(thread)) { processScenarioAuditWaitQueue(); } else if (uploadAuditExecutionList.remove(thread)...
Interrogate each execution List to properly remove the current thread and eventually launch audit waiting in the queue
@Deprecated public void resumeAllActions(CCNode target){ this.resume(target); }
Resumes all actions for a certain target. Once the actions are resumed, they will be "ticked" in every frame.
@Hook("android.net.ConnectivityManager->setNetworkPreference") public static void ConnectivityManager_setNetworkPreference(ConnectivityManager manager,int preference){ Log.d(TAG,"Making something from nothing!"); OriginalMethod.by(new $(){ } ).invoke(manager,preference); }
Hooking an empty method
@Override public void merge(MeasureAggregator aggregator){ SumDistinctDoubleAggregator distinctAggregator=(SumDistinctDoubleAggregator)aggregator; if (!aggregator.isFirstTime()) { agg(distinctAggregator.valueSet); firstTime=false; } }
merge the valueset so that we get the count of unique values
protected void drawCropGrid(@NonNull Canvas canvas){ if (mShowCropGrid) { if (mGridPoints == null && !mCropViewRect.isEmpty()) { mGridPoints=new float[(mCropGridRowCount) * 4 + (mCropGridColumnCount) * 4]; int index=0; for (int i=0; i < mCropGridRowCount; i++) { mGridPoints[index++]=mCro...
This method draws crop bounds (empty rectangle) and crop guidelines (vertical and horizontal lines inside the crop bounds) if needed.
public void start(){ runningThread=new Thread(this); runningThread.setName("IdentServer"); runningThread.start(); }
Start the ident server in a new thread.
public long optLong(String key,long defaultValue){ try { return getLong(key); } catch ( Exception e) { return defaultValue; } }
Get an optional long value associated with a key, or the default if there is unknown such key or if the value is not a number. If the value is a string, an attempt will be made to evaluate it as a number.
@SuppressWarnings("unchecked") @Override public void eSet(int featureID,Object newValue){ switch (featureID) { case N4JSPackage.N4_ENUM_DECLARATION__LITERALS: getLiterals().clear(); getLiterals().addAll((Collection<? extends N4EnumLiteral>)newValue); return; } super.eSet(featureID,newValue); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public boolean fireMapMouseClicked(MouseEvent evt){ if (DEBUG) { logger.fine("MapMouseSupport: fireMapMouseClicked"); } clickHappened=true; boolean consumed=false; evt=new MapMouseEvent(getParentMode(),evt); if (priorityListener != null && evt.getClickCount() > 1) { priorityListener.mouseClicked(evt...
Handle a mouseClicked MouseListener event. If the priorityListener is set, it automatically gets the clicked event. If it is not set, the other listeners get a shot at the event according to the consumeEvent mode.
public void close() throws IOException { super.close(); cache.close(); cacheFile.delete(); }
Closes this stream and releases any system resources associated with the stream.
protected boolean mustDrawFill(SymbolCode code){ String masked=code.toMaskedString(); return TacGrpSidc.MOBSU_CBRN_NDGZ.equalsIgnoreCase(masked) || TacGrpSidc.MOBSU_CBRN_REEVNT_BIO.equalsIgnoreCase(masked) || TacGrpSidc.MOBSU_CBRN_REEVNT_CML.equalsIgnoreCase(masked); }
Indicates whether or not a fill must be drawn for a graphic.
private static void writeInt(int value,byte[] array,int offset){ for (int i=0; i < 4; i++) { array[offset + i]=(byte)(value >>> (8 * i)); } }
Writes an number into an array using 4 bytes.
protected Map<String,Object> createDefaultVertexStyle(){ Map<String,Object> style=new Hashtable<String,Object>(); style.put(mxConstants.STYLE_SHAPE,mxConstants.SHAPE_RECTANGLE); style.put(mxConstants.STYLE_PERIMETER,mxPerimeter.RectanglePerimeter); style.put(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MI...
Creates and returns the default vertex style.
public void paintComponent(Graphics g){ super.paintComponent(g); paint((Graphics2D)g); }
Paint the component on the GUI
public CThreadPanelSynchronizer(final CThreadComboBox tidBox,final CDebugPerspectiveModel debugPerspectiveModel){ m_tidBox=Preconditions.checkNotNull(tidBox,"IE01519: Thead box argument can not be null"); m_debugPerspectiveModel=Preconditions.checkNotNull(debugPerspectiveModel,"IE01520: Debug perspective model argu...
Creates a new thread box synchronizer object.
public final CC grow(float... widthHeight){ switch (widthHeight.length) { default : throw new IllegalArgumentException("Illegal argument count: " + widthHeight.length); case 2: growY(widthHeight[1]); case 1: growX(widthHeight[0]); } return this; }
grow weight for the component horizontally and optionally vertically. <p> For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.
public void addAccessibleSelection(int i){ TreeModel model=JTree.this.getModel(); if (model != null) { if (i >= 0 && i < getAccessibleChildrenCount()) { TreePath path=getChildTreePath(i); JTree.this.addSelectionPath(path); } } }
Adds the specified selected item in the object to the object's selection. If the object supports multiple selections, the specified item is added to any existing selection, otherwise it replaces any existing selection in the object. If the specified item is already selected, this method has no effect.
public void testSharedMode() throws Exception { depMode=DeploymentMode.SHARED; processTest(false,false); }
Test GridDeploymentMode.SHARED mode.
public boolean isDigit(char c){ return c >= '0' && c <= '9'; }
returns if c is a digit or not
@Override protected void processResponseHeaders(final HttpState state,final HttpConnection conn){ LOG.trace("enter OptionsMethod.processResponseHeaders(HttpState, HttpConnection)"); final Header allowHeader=getResponseHeader("allow"); if (allowHeader != null) { final String allowHeaderValue=allowHeader.getVal...
<p> This implementation will parse the <tt>Allow</tt> header to obtain the set of methods supported by the resource identified by the Request-URI. </p>
public void addLineEndCap(Coordinate p0,Coordinate p1){ LineSegment seg=new LineSegment(p0,p1); LineSegment offsetL=new LineSegment(); computeOffsetSegment(seg,Position.LEFT,distance,offsetL); LineSegment offsetR=new LineSegment(); computeOffsetSegment(seg,Position.RIGHT,distance,offsetR); double dx=p1.x - ...
Add an end cap around point p1, terminating a line segment coming from p0
public void staleLocator(final PartitionLocator locator){ if (locator == null) throw new IllegalArgumentException(); if (timestamp != ITx.UNISOLATED && timestamp != ITx.READ_COMMITTED) { throw new RuntimeException("Stale locator, but views should be consistent? timestamp=" + TimestampUtility.toString(timestam...
Re-fetches the locator(s).
public static ActiveMQConnectionFactory createConnectionFactory(final String url,String name) throws Exception { ConnectionFactoryParser parser=new ConnectionFactoryParser(); return parser.newObject(parser.expandURI(url),name); }
Creates an ActiveMQConnectionFactory;
public boolean mouseMoved(MouseEvent e){ EsriGraphicList list=getEsriGraphicList(); boolean ret=false; if (list != null) { OMGraphic omg=list.findClosest(e.getX(),e.getY(),4); if (omg != null) { int index; Integer I=((Integer)omg.getAttribute(SHAPE_INDEX_ATTRIBUTE)); if (I != null) { ...
Handle mouse moved events (Used for firing tool tip descriptions over graphics)
protected void damageLineRange(int line0,int line1,Shape a,Component host){ if (a != null) { Rectangle area0=lineToRect(a,line0); Rectangle area1=lineToRect(a,line1); if ((area0 != null) && (area1 != null)) { Rectangle dmg=area0.union(area1); host.repaint(dmg.x,dmg.y,dmg.width,dmg.height); ...
Repaint the given line range.
public int[] estimateCellPosition(int x,int y){ return new int[]{getPaddingLeft() + (x * mCellWidth) + (x * mWidthGap)+ (mCellWidth / 2),getPaddingTop() + (y * mCellHeight) + (y * mHeightGap)+ (mCellHeight / 2)}; }
Returns an estimated center position of the cell at the specified index
private void initialize(URI p_base,String p_uriSpec) throws MalformedURIException { if (p_base == null && (p_uriSpec == null || p_uriSpec.trim().length() == 0)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,null)); } if (p_uriSpec == null || p_uriSpec.tri...
Initializes this URI from a base URI and a URI specification string. See RFC 2396 Section 4 and Appendix B for specifications on parsing the URI and Section 5 for specifications on resolving relative URIs and relative paths.
private List<Group> parseGroups(JSONArray groups,String groupType) throws JSONException, AdeUsageException { if (groups.length() == 0) throw new AdeUsageException("No groups specified for group of type " + groupType); List<Group> currentGroups=new ArrayList<Group>(); for (int i=0; i < groups.length(); i++) { ...
Main logic for parsing the groups from the JSON file. Also does validation of the groups attributes.
public boolean isBufferResultSetToLocalTemp(){ return bufferResultSetToLocalTemp; }
Should the return value ResultSet be buffered in a local temporary file?
public static File relativeFile(File root,File file){ if (root != null && file != null) { String absRoot=absoluteFile(root).getPath(); String absFile=absoluteFile(file).getPath(); if (absFile.startsWith(absRoot)) { String path=absFile.substring(absRoot.length()); if (path.startsWith(File.separ...
Given a file and a possible parent folder returns the file relative to the parent. If the file wasn't relative to the parent it is returned unmodified.
private void adjustFocus(boolean inWindow){ RTextArea textArea=getTextArea(); if ((textArea != null) && textArea.isEnabled() && textArea.isRequestFocusEnabled()) { if (inWindow) textArea.requestFocusInWindow(); else textArea.requestFocus(); } }
Adjusts the focus, if necessary.
protected int bytesPerLine(){ return (72); }
Any multiple of 4 will do, 72 might be common
public static BlockObject querySnapshotSessionSource(URI sourceURI,UriInfo uriInfo,boolean checkAssociatedVolumes,DbClient dbClient){ ArgValidator.checkUri(sourceURI); if ((!URIUtil.isType(sourceURI,Volume.class)) && (!URIUtil.isType(sourceURI,BlockSnapshot.class))) { throw APIException.badRequests.invalidSnaps...
Returns the volume or block snapshot instance for the passed URI.
static RendererContext createContext(){ final RendererContext newCtx=new RendererContext("ctx" + Integer.toString(CTX_COUNT.getAndIncrement())); if (DO_STATS || DO_MONITORS) { RendererStats.ALL_CONTEXTS.add(newCtx); } return newCtx; }
Create a new renderer context
public static int[] createColors(int count){ RandomColor r=new RandomColor(); int[] colors=new int[count]; for (int i=0; i < count; ++i) { colors[i]=r.randomColor(0,SaturationType.RANDOM,Luminosity.LIGHT); } return colors; }
Create an array of random, but light, colors
public static void dropTable(SQLiteDatabase db,boolean ifExists){ String sql="DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "'BabyModel'"; db.execSQL(sql); }
Drops the underlying database table.
public static PrintWriter openScriptWriter(String fileName,String compressionAlgorithm,String cipher,String password,String charset) throws IOException { try { OutputStream out; if (cipher != null) { byte[] key=SHA256.getKeyPasswordHash("script",password.toCharArray()); FileUtils.delete(fileName);...
Open a script writer.
public static void startAndroidTool(){ startAndroidTool(false); }
Starts the Android target configuration utility.
private Type(final int sort,final char[] buf,final int off,final int len){ this.sort=sort; this.buf=buf; this.off=off; this.len=len; }
Constructs a reference type.
public PartialHull(IPoint first,IPoint second){ points.add(first); points.add(second); }
Construct the initial partial hull.