code
stringlengths
10
174k
nl
stringlengths
3
129k
@Override public boolean performCancel(){ CnAElementFactory.getInstance().reloadModelFromDatabase(); return true; }
Cause update to risk analysis object in loaded model.
public boolean isOpaque(){ checkOpacityMethodClient(); return explicitlyOpaque; }
Returns whether the background of this <code>BasicPanel</code> will be painted when it is rendered.
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); }
Adds semantic checks to the default deserialization method. This method must have the standard signature for a readObject method, and the body of the method must begin with "s.defaultReadObject();". Other than that, any semantic checks can be specified and do not need to stay the same from version to version. A readObject method of this form may be added to any class, even if Tetrad sessions were previously saved out using a version of the class that didn't include it. (That's what the "s.defaultReadObject();" is for. See J. Bloch, Effective Java, for help.
@Override public void resetDistribution(Instances data) throws Exception { Instances insts=new Instances(data,data.numInstances()); for (int i=0; i < data.numInstances(); i++) { if (whichSubset(data.instance(i)) > -1) { insts.add(data.instance(i)); } } Distribution newD=new Distribution(insts,this); newD.addInstWithUnknown(data,m_attIndex); m_distribution=newD; }
Sets distribution associated with model.
public static <T,R>R readStaticField(Class<T> klass,String fieldName) throws NoSuchFieldException { return readAvailableField(klass,null,fieldName); }
Reads the static field with given fieldName in given klass.
public static String extractFactor_Display(String laggedFactor){ int colonIndex=laggedFactor.indexOf(":L"); String factor=laggedFactor.substring(0,colonIndex); return factor; }
Parses the given string representing a lagged factor and return the part that represents the factor.
protected void deployCargoPing(WebLogicLocalContainer container) throws IOException { String deployDir=getFileHandler().createDirectory(getDomainHome(),container.getAutoDeployDirectory()); getResourceUtils().copyResource(RESOURCE_PATH + "cargocpc.war",getFileHandler().append(deployDir,"cargocpc.war"),getFileHandler()); }
Deploy the Cargo Ping utility to the container.
public int size(){ return this.count; }
Returns the number of mappings in this map
protected void parse(DataInputStream stream) throws Exception { int size=stream.readInt(); int ret, read=0; data=new byte[size]; while (size > 0) { ret=stream.read(data,read,size); size-=ret; read+=ret; } }
Loading method. (see NBT_Tag)
@Ignore("NaN behavior TBD") @Test public void testLinearAzimuth_WithNaN() throws Exception { Location begin=new Location(Double.NaN,Double.NaN); Location end=new Location(34.2,-119.2); double azimuth=begin.linearAzimuth(end); assertTrue("expecting NaN",Double.isNaN(azimuth)); }
Ensures linear azimuth is NaN when NaN members are used.
public MutableValueBuffer(final int capacity,final IRaba src){ if (src == null) throw new IllegalArgumentException(); checkCapacity(capacity); if (capacity < src.capacity()) throw new IllegalArgumentException(); nvalues=src.size(); values=new byte[capacity][]; int i=0; for ( byte[] a : src) { values[i++]=a; } }
Builds a mutable value buffer.
private void checkCircuits(){ _portalIconMap.clear(); _darkTrack.clear(); _unconvertedTrack.clear(); PortalManager portalMgr=InstanceManager.getDefault(jmri.jmrit.logix.PortalManager.class); Iterator<Positionable> it=_editor.getContents().iterator(); while (it.hasNext()) { Positionable pos=it.next(); if (pos instanceof IndicatorTrack) { OBlock block=((IndicatorTrack)pos).getOccBlock(); ((IndicatorTrack)pos).removePath(EditCircuitPaths.TEST_PATH); if (block != null) { addIcon(block,pos); } else { _darkTrack.add(pos); } } else if (pos instanceof PortalIcon) { PortalIcon pIcon=(PortalIcon)pos; String name=pIcon.getName(); Portal portal=portalMgr.getByUserName(name); if (portal == null) { log.error("No Portal for PortalIcon called \"" + name + "\". Discarding icon."); pIcon.remove(); } else { PortalIcon pi=_portalIconMap.get(name); if (pi != null) { log.error("Removing duplicate PortalIcon for Portal \"" + name + "\"."); pi.remove(); } _portalIconMap.put(name,pIcon); } } } Iterator<Entry<OBlock,ArrayList<Positionable>>> iters=_circuitMap.entrySet().iterator(); while (iters.hasNext()) { Entry<OBlock,ArrayList<Positionable>> entry=iters.next(); Iterator<Positionable> iter=entry.getValue().iterator(); while (iter.hasNext()) { Positionable pos=iter.next(); if (isUnconvertedTrack(pos)) { if (!_unconvertedTrack.contains(pos)) { _unconvertedTrack.add(pos); } } } } _bareBlock.clear(); _convertBlock.clear(); _badPortalIcon.clear(); OBlockManager manager=InstanceManager.getDefault(jmri.jmrit.logix.OBlockManager.class); String[] sysNames=manager.getSystemNameArray(); hasOBlocks=(sysNames.length > 0); for (int i=0; i < sysNames.length; i++) { OBlock block=manager.getBySystemName(sysNames[i]); java.util.List<Portal> list=block.getPortals(); if (list != null) { Iterator<Portal> iter=list.iterator(); while (iter.hasNext()) { Portal portal=iter.next(); PortalIcon pi=_portalIconMap.get(portal.getName()); if (pi != null) { addIcon(block,pi); } } } java.util.List<Positionable> icons=_circuitMap.get(block); if (log.isDebugEnabled()) { log.debug("checkCircuits: block " + block.getDisplayName() + " has "+ icons.size()+ " icons."); } if (icons == null || icons.size() == 0) { _bareBlock.add(block); } else { _bareBlock.remove(block); for (int k=0; k < icons.size(); k++) { Positionable pos=icons.get(k); if (!(pos instanceof IndicatorTrack) && !(pos instanceof PortalIcon)) { if (!_convertBlock.contains(block)) { _convertBlock.add(block); break; } } } } } List<NamedBean> list=portalMgr.getNamedBeanList(); Iterator<NamedBean> iter=list.iterator(); while (iter.hasNext()) { Portal portal=(Portal)iter.next(); String name=portal.getName(); PortalIcon pi=_portalIconMap.get(name); if (pi != null) { if (!checkPortalIcon(portal,pi)) { _badPortalIcon.put(name,portal); } } else { _badPortalIcon.put(name,portal); } } makeToDoMenu(); }
Find the blocks with no icons and the blocks with icons that need conversion Setup for main Frame - used in both initialization and close of an editing frame Build Lists that are used to create menu items
public OutOfLineContent(){ super(KEY); }
Constructs a new instance using the default metadata.
private static List<String> rewriteTermBruteForce(String term){ List<String> termsList=rewriteBrute(term); if (term == "" || !term.equals(termsList.get(termsList.size() - 1))) termsList.add(term); return termsList; }
Wrapper over main recursive method, rewriteBrute which performs the fuzzy tokenization of a term The original term may not be a valid dictionary word, but be a term particular to the database The method rewriteBrute only considers terms which are valid dictionary words In case original term is not a dictionary word, it will not be added to queryList by method rewriteBrute This wrapper ensures that if rewriteBrute does not include the original term, it will still be included For example, for the term "newyork", rewriteBrute will return the list <"new york"> But "newyork" also needs to be included in the list to support particular user queries This wrapper includes "newyork" in this list
public void test_sssp_linkType_constraint() throws Exception { final SmallWeightedGraphProblem p=setupSmallWeightedGraphProblem(); final IGASEngine gasEngine=getGraphFixture().newGASEngine(1); try { final IGraphAccessor graphAccessor=getGraphFixture().newGraphAccessor(null); final IGASContext<SSSP.VS,SSSP.ES,Integer> gasContext=gasEngine.newGASContext(graphAccessor,new SSSP()); gasContext.setLinkType((URI)p.getFoafKnows()); final IGASState<SSSP.VS,SSSP.ES,Integer> gasState=gasContext.getGASState(); gasState.setFrontier(gasContext,p.getV1()); gasContext.call(); assertEquals(0.0,gasState.getState(p.getV1()).dist()); assertEquals(1.0,gasState.getState(p.getV2()).dist()); assertEquals(1.0,gasState.getState(p.getV3()).dist()); assertEquals(2.0,gasState.getState(p.getV4()).dist()); assertEquals(2.0,gasState.getState(p.getV5()).dist()); } finally { gasEngine.shutdownNow(); } }
A unit test based on graph with link weights - in this version of the test we constrain the link type but do not specify the link attribute type. Hence it ignores the link weights. This provides a test of the optimized access path when just the link type constraint is specified.
public Id<DgCrossingNode> convertNodeId2NotExpandedCrossingNodeId(Id<Node> nodeId){ String idString=nodeId.toString(); return idPool.createId(idString,DgCrossingNode.class); }
converts a matsim node ID of a node outside the signals bounding box to the single crossing node ID existing for the not expanded crossing in the ks-model. (the signals bounding box determines the region of spatial expansion: all nodes within this area will be expanded.)
public Object runSafely(Catbert.FastStack stack) throws Exception { String k=getString(stack); String r=getString(stack); if (!Sage.WINDOWS_OS) return Pooler.EMPTY_STRING_ARRAY; return Sage.getRegistryNames(Sage.getHKEYForName(r),k); }
Returns a list of the Windows registry names which exist under the specified root &amp; key (Windows only) Acceptable values for the Root are: "HKCR", "HKEY_CLASSES_ROOT", "HKCC", "HKEY_CURRENT_CONFIG", "HKCU", "HKEY_CURRENT_USER", "HKU", "HKEY_USERS", "HKLM" or "HKEY_LOCAL_MACHINE" (HKLM is the default if nothing matches)
public APIPermissionSet(){ }
Creates a new permission set which contains no granted permissions. Any permissions must be added by manipulating or replacing the applicable permission collection.
@RequestMapping(value="/upload/single/initiation",method=RequestMethod.POST,consumes={"application/xml","application/json"}) @Secured(SecurityFunctions.FN_UPLOAD_POST) public UploadSingleInitiationResponse initiateUploadSingle(@RequestBody UploadSingleInitiationRequest uploadSingleInitiationRequest){ UploadSingleInitiationResponse uploadSingleInitiationResponse=uploadDownloadService.initiateUploadSingle(uploadSingleInitiationRequest); for ( BusinessObjectData businessObjectData : Arrays.asList(uploadSingleInitiationResponse.getSourceBusinessObjectData(),uploadSingleInitiationResponse.getTargetBusinessObjectData())) { BusinessObjectDataKey businessObjectDataKey=businessObjectDataHelper.getBusinessObjectDataKey(businessObjectData); for ( NotificationEventTypeEntity.EventTypesBdata eventType : Arrays.asList(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN,NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG)) { notificationEventService.processBusinessObjectDataNotificationEventAsync(eventType,businessObjectDataKey,businessObjectData.getStatus(),null); } for ( StorageUnit storageUnit : businessObjectData.getStorageUnits()) { notificationEventService.processStorageUnitNotificationEventAsync(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG,businessObjectDataKey,storageUnit.getStorage().getName(),storageUnit.getStorageUnitStatus(),null); } } return uploadSingleInitiationResponse; }
Initiates a single file upload capability by creating the relative business object data instance in UPLOADING state and allowing write access to a specific location in S3_MANAGED_LOADING_DOCK storage. <p>Requires WRITE permission on namespace</p>
public ArrayIntCompressed(int size,int leadingClearBits,int trailingClearBits){ init(size,BIT_LENGTH - leadingClearBits - trailingClearBits,trailingClearBits); }
Create <code>IntArrayCompressed</code> from number of ints to be stored, the number of leading and trailing clear bits. Everything else is stored in the internal data structure.
public String compXmlStringAt(byte[] arr,int strOff){ int strLen=arr[strOff + 1] << 8 & 0xff00 | arr[strOff] & 0xff; char[] chars=new char[strLen]; for (int ii=0; ii < strLen; ii++) { int p0=strOff + 2 + ii * 2; if (p0 >= arr.length - 1) break; chars[ii]=(char)(((arr[p0 + 1] & 0x00FF) << 8) + (arr[p0] & 0x00FF)); } return new String(chars); }
Return the string stored in StringTable format at offset strOff. This offset points to the 16 bit string length, which is followed by that number of 16 bit (Unicode) chars.
public AbstractExportOperation(File archiveFile,IFile mainFile,IN4JSEclipseProject project){ this.targetFile=archiveFile; this.mainFile=mainFile; this.project=project; this.workspace=project.getProject().getWorkspace(); rootLocation=project.getLocation().appendSegment(""); }
Create an operation that will export the given project to the given zip file.
@Override public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException { debugCodeCall("supportsMixedCaseQuotedIdentifiers"); String m=conn.getMode(); if (m.equals("MySQL")) { return false; } return true; }
Checks if a table created with CREATE TABLE "Test"(ID INT) is a different table than a table created with CREATE TABLE TEST(ID INT).
private static Shape leftEdge(BufferedImage image){ GeneralPath path=new GeneralPath(); Point2D p1=null; Point2D p2=null; Line2D line=new Line2D.Float(); Point2D p=new Point2D.Float(); int foundPointY=-1; for (int i=0; i < image.getHeight(); i++) { for (int j=0; j < image.getWidth(); j++) { if ((image.getRGB(j,i) & 0xff000000) != 0) { p=new Point2D.Float(j,i); foundPointY=i; break; } } if (foundPointY >= 0) { if (p2 == null) { p1=new Point2D.Float(image.getWidth() - 1,foundPointY); path.moveTo(p1.getX(),p1.getY()); p2=new Point2D.Float(); p2.setLocation(p); } else { p2=detectLine(p1,p2,p,line,path); } } } path.lineTo(p.getX(),p.getY()); if (foundPointY >= 0) { path.lineTo(image.getWidth() - 1,foundPointY); } path.closePath(); return path; }
trace the left side of the image
public void testSetMaxRows() throws Exception { Statement maxRowsStmt=null; try { maxRowsStmt=this.conn.createStatement(); maxRowsStmt.setMaxRows(1); this.rs=maxRowsStmt.executeQuery("SELECT 1"); } finally { if (maxRowsStmt != null) { maxRowsStmt.close(); } } }
Tests fix for BUG#907
public static void unregisterMbeans(){ unregisterMbeans(ManagementFactory.getPlatformMBeanServer()); }
unRegister all jamon related mbeans
public boolean free(T value){ return _ringQueue.offer(value); }
Frees the object. If the free list is full, the object will be garbage collected.
public NotificationChain basicSet_lok(LocalArgumentsVariable new_lok,NotificationChain msgs){ LocalArgumentsVariable old_lok=_lok; _lok=new_lok; if (eNotificationRequired()) { ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,N4JSPackage.FUNCTION_DECLARATION__LOK,old_lok,new_lok); if (msgs == null) msgs=notification; else msgs.add(notification); } return msgs; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void query(boolean onlyCurrentRows,int onlyCurrentDays,int maxRows){ m_mTab.query(onlyCurrentRows,onlyCurrentDays,maxRows); if (!isSingleRow()) vTable.autoSize(true); activateChilds(); }
Query Tab and resize Table (called from APanel)
@Override public EmpiricalDistribution queryProb(Query.ProbQuery query){ LikelihoodWeighting isquery=new LikelihoodWeighting(query,nbSamples,maxSamplingTime); List<Sample> samples=isquery.getSamples(); return new EmpiricalDistribution(samples); }
Queries for the probability distribution of the set of random variables in the Bayesian network, given the provided evidence
public char loadChar(Offset offset){ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); return (char)0; }
Loads a char from the memory location pointed to by the current instance.
public FloatBuffer put(float[] src,int off,int len){ int length=src.length; if (off < 0 || len < 0 || (long)off + (long)len > length) { throw new IndexOutOfBoundsException(); } if (len > remaining()) { throw new BufferOverflowException(); } for (int i=off; i < off + len; i++) { put(src[i]); } return this; }
Writes floats from the given float array, starting from the specified offset, to the current position and increases the position by the number of floats written.
public static void deleteCollectionLevelSnapshot(SolrZkClient zkClient,String collectionName,String commitName) throws InterruptedException, KeeperException { String zkPath=getSnapshotMetaDataZkPath(collectionName,Optional.of(commitName)); zkClient.delete(zkPath,-1,true); }
This method deletes an entry for the named snapshot for the specified collection in Zookeeper.
private void sortAndPrintSQL() throws SQLException { final Vector<String> statements=new Vector<String>(1000,500); final Vector<String> sortedStatements=new Vector<String>(1000,500); for (int i=0; i < m_newTables.size(); i++) { statements.add(m_newTables.get(i).getCreateStatement()); } for (int i=0; i < m_changedTables.size(); i++) { if (m_changedTables.get(i).isAlterAdd()) { statements.add(m_changedTables.get(i).getAlterAddStatement()); } else if (m_changedTables.get(i).isAlterDrop()) { statements.add(m_changedTables.get(i).getAlterDropStatement()); } else if (m_changedTables.get(i).isAlterModify()) { statements.add(m_changedTables.get(i).getAlterModifyStatement()); } } for (int i=0; i < m_constraintsToDrop.size(); i++) { statements.add(m_constraintsToDrop.get(i).getDropString()); } for (int i=0; i < m_newConstraints.size(); i++) { statements.add(m_newConstraints.get(i).getAlterTableString()); } Vector<String> tempVector=sortStatements(statements); for (int i=0; i < tempVector.size(); i++) { sortedStatements.add(tempVector.get(i)); } sortedStatements.add("COMMIT;"); sortedStatements.add("SET DEFINE OFF;"); statements.clear(); for (int i=0; i < m_newTableEntry.size(); i++) { statements.add(m_newTableEntry.get(i).replaceAll("\n"," ")); } tempVector=sortStatements(statements); for (int i=0; i < tempVector.size(); i++) { sortedStatements.add(tempVector.get(i)); } sortedStatements.add("COMMIT;"); sortedStatements.add("SET DEFINE OFF;"); statements.clear(); for (int i=0; i < m_alterADEntry.size(); i++) { statements.add(m_alterADEntry.get(i).replaceAll("\n"," ")); } tempVector=sortStatements(statements); for (int i=0; i < tempVector.size(); i++) { sortedStatements.add(tempVector.get(i)); } sortedStatements.add("COMMIT;"); sortedStatements.add("SET DEFINE OFF;"); statements.clear(); for (int i=0; i < m_deleteADEntry.size(); i++) { statements.add(m_deleteADEntry.get(i).replaceAll("\n"," ")); } tempVector=sortStatements(statements); for (int i=0; i < tempVector.size(); i++) { sortedStatements.add(tempVector.get(i)); } System.out.println(); System.out.println("---------------------------"); System.out.println("-- SCRIPT STARTS HERE!"); System.out.println("---------------------------"); System.out.println("-- UNABLE TO APPLY THESE STATEMENTS - START"); for (int i=0; i < m_unappliableStatements.size(); i++) { System.out.println(m_unappliableStatements.get(i)); } System.out.println("-- UNABLE TO APPLY THESE STATEMENTS - END"); System.out.println(); System.out.println("-- NEW/CHANGED TABLES - NEW/CHANGED AD_ENTRIES"); for (int i=0; i < sortedStatements.size(); i++) { System.out.println(sortedStatements.get(i)); } System.out.println(); System.out.println("-- NEW VIEWS"); for (int i=0; i < m_newViews.size(); i++) { System.out.println(m_newViews.get(i).getCreateStatement()); } System.out.println(); System.out.println("-- CHANGED VIEWS - but check them first - don't overwrite your customizations..."); for (int i=0; i < m_changedViews.size(); i++) { System.out.println(m_changedViews.get(i).getCreateStatement()); } System.out.println(); System.out.println("-- NEW OR CHANGED FUNCTIONS/PROCEDURES"); for (int i=0; i < m_newFunctionStatements.size(); i++) { System.out.println(m_newFunctionStatements.get(i)); } System.out.println(); System.out.println("-- DROP FUNCTIONS/PROCEDURES"); for (int i=0; i < m_dropFunctionStatements.size(); i++) { System.out.println(m_dropFunctionStatements.get(i)); } System.out.println(); System.out.println("-- DROP TRIGGERS"); for (int i=0; i < m_dropTriggerStatements.size(); i++) { System.out.println(m_dropTriggerStatements.get(i)); } System.out.println(); System.out.println("-- DROP INDEXES"); for (int i=0; i < m_dropIndexStatements.size(); i++) { System.out.println(m_dropIndexStatements.get(i)); } System.out.println(); System.out.println("-- NEW OR CHANGED INDEXES"); for (int i=0; i < m_newIndexStatements.size(); i++) { System.out.println(m_newIndexStatements.get(i)); } System.out.println(); System.out.println("-- PLEASE CHECK THE SEQUENCES BY HAND - USE:"); System.out.println("-- select * from user_sequences;"); System.out.println(); System.out.println(getUpdateVersionStatement()); System.out.println("COMMIT;"); }
Sorts the generated sql statements by applying them to db1 and prints the sorted statement list.
final private void turn22(IntGrid2D grid,int x,int y){ int p1, p2, p3, p4; p1=grid.get(grid.stx(x),grid.sty(y)); p2=grid.get(grid.stx(x + 1),grid.sty(y)); p3=grid.get(grid.stx(x + 1),grid.sty(y + 1)); p4=grid.get(grid.stx(x),grid.sty(y + 1)); if (p.r.nextBoolean()) { grid.set(grid.stx(x),grid.sty(y),p4); grid.set(grid.stx(x + 1),grid.sty(y),p1); grid.set(grid.stx(x + 1),grid.sty(y + 1),p2); grid.set(grid.stx(x),grid.sty(y + 1),p3); } else { grid.set(grid.stx(x),grid.sty(y),p2); grid.set(grid.stx(x + 1),grid.sty(y),p3); grid.set(grid.stx(x + 1),grid.sty(y + 1),p4); grid.set(grid.stx(x),grid.sty(y + 1),p1); } }
Diffuse a 2x2 block clockwise or counter-clockwise. This procedure was published by Toffoli and Margolus to simulate the diffusion in an ideal gas. The 2x2 blocks will be turned by random in one direction (clockwise or counter clockwise). Usually a second run will be done but this time with a offset of one to the previous run
public static double magnitude(double[] u){ return Math.sqrt(dot(u,u)); }
Returns the magnitude (Euclidean norm) of the specified vector.
public String toString(){ return statusString; }
Returns the String representation for thiz.
public void chopFrame(int offsetDelta,int k){ numOfEntries++; output.write(251 - k); write16(offsetDelta); }
Writes a <code>chop_frame</code>.
public AsyncHttpClient(boolean fixNoHttpResponseException,int httpPort,int httpsPort){ this(getDefaultSchemeRegistry(fixNoHttpResponseException,httpPort,httpsPort)); }
Creates new AsyncHttpClient using given params
public boolean verify(byte[] signature){ return verify(signature,false); }
Verifies the data (computes the secure hash and compares it to the input)
public synchronized void reqHistoricalData(int tickerId,Contract contract,String endDateTime,String durationStr,String barSizeSetting,String whatToShow,int useRTH,int formatDate,List<TagValue> chartOptions){ if (!m_connected) { notConnected(); return; } final int VERSION=6; try { if (m_serverVersion < 16) { error(EClientErrors.NO_VALID_ID,EClientErrors.UPDATE_TWS," It does not support historical data backfill."); return; } if (m_serverVersion < MIN_SERVER_VER_TRADING_CLASS) { if (!IsEmpty(contract.m_tradingClass) || (contract.m_conId > 0)) { error(tickerId,EClientErrors.UPDATE_TWS," It does not support conId and tradingClass parameters in reqHistroricalData."); return; } } send(REQ_HISTORICAL_DATA); send(VERSION); send(tickerId); if (m_serverVersion >= MIN_SERVER_VER_TRADING_CLASS) { send(contract.m_conId); } send(contract.m_symbol); send(contract.m_secType); send(contract.m_expiry); send(contract.m_strike); send(contract.m_right); send(contract.m_multiplier); send(contract.m_exchange); send(contract.m_primaryExch); send(contract.m_currency); send(contract.m_localSymbol); if (m_serverVersion >= MIN_SERVER_VER_TRADING_CLASS) { send(contract.m_tradingClass); } if (m_serverVersion >= 31) { send(contract.m_includeExpired ? 1 : 0); } if (m_serverVersion >= 20) { send(endDateTime); send(barSizeSetting); } send(durationStr); send(useRTH); send(whatToShow); if (m_serverVersion > 16) { send(formatDate); } if (BAG_SEC_TYPE.equalsIgnoreCase(contract.m_secType)) { if (contract.m_comboLegs == null) { send(0); } else { send(contract.m_comboLegs.size()); ComboLeg comboLeg; for (int i=0; i < contract.m_comboLegs.size(); i++) { comboLeg=contract.m_comboLegs.get(i); send(comboLeg.m_conId); send(comboLeg.m_ratio); send(comboLeg.m_action); send(comboLeg.m_exchange); } } } if (m_serverVersion >= MIN_SERVER_VER_LINKING) { StringBuilder chartOptionsStr=new StringBuilder(); int chartOptionsCount=chartOptions == null ? 0 : chartOptions.size(); if (chartOptionsCount > 0) { for (int i=0; i < chartOptionsCount; ++i) { TagValue tagValue=(TagValue)chartOptions.get(i); chartOptionsStr.append(tagValue.m_tag); chartOptionsStr.append("="); chartOptionsStr.append(tagValue.m_value); chartOptionsStr.append(";"); } } send(chartOptionsStr.toString()); } } catch ( Exception e) { error(tickerId,EClientErrors.FAIL_SEND_REQHISTDATA,"" + e); close(); } }
Note that formatData parameter affects intra-day bars only; 1-day bars always return with date in YYYYMMDD format.
@Override public String toString(){ return name().toLowerCase(); }
Returns the string representation of this instance, suitable for use in output. This is a lowercase version of the name.
public StringBand(int initialCapacity){ if (initialCapacity <= 0) { throw new IllegalArgumentException("Invalid initial capacity"); } array=new String[initialCapacity]; }
Creates an empty <code>StringBand</code> with provided capacity. Capacity refers to internal string array (i.e. number of joins) and not the total string size.
public boolean removeConstraint(ParticleConstraint2D c){ return constraints.remove(c); }
Attempts to remove the given constraint instance from the list of active constraints.
private DoneCallback(GridClientFutureCallback<R,T> cb,GridClientFutureListener<R> lsnr,GridClientFutureAdapter<T> chainedFut){ this.cb=cb; this.lsnr=lsnr; this.chainedFut=chainedFut; }
Constructs future finished notification callback.
private void addSignatureProfile(SignatureWrapper signature,XmlSignature xmlSignature){ SignatureType signatureType=SignatureType.NA; String certificateId=signature.getSigningCertificateId(); if (certificateId != null) { signatureType=getSignatureType(certificateId); } xmlSignature.setSignatureLevel(signatureType.name()); }
Here we determine the type of the signature.
public boolean isArray(){ return false; }
Determines if this Class object represents an array class.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 15:00:03.708 -0400",hash_original_method="AD50C4AE43C84CAFDA529E78BF7FE7D8",hash_generated_method="C8CCC8804046A2687F8D3D90AEE56A06") public Collection<? extends Certificate> engineGenerateCertificates(InputStream inStream) throws CertificateException { if (inStream == null) { throw new CertificateException("inStream == null"); } ArrayList<Certificate> result=new ArrayList<Certificate>(); try { if (!inStream.markSupported()) { inStream=new RestoringInputStream(inStream); } byte[] encoding=null; int second_asn1_tag=-1; inStream.mark(1); int ch; while ((ch=inStream.read()) != -1) { if (ch == '-') { encoding=decodePEM(inStream,FREE_BOUND_SUFFIX); } else if (ch == 0x30) { encoding=null; inStream.reset(); inStream.mark(CERT_CACHE_SEED_LENGTH); } else { if (result.size() == 0) { throw new CertificateException("Unsupported encoding"); } else { inStream.reset(); return result; } } BerInputStream in=(encoding == null) ? new BerInputStream(inStream) : new BerInputStream(encoding); second_asn1_tag=in.next(); if (encoding == null) { inStream.reset(); } if (second_asn1_tag != ASN1Constants.TAG_C_SEQUENCE) { if (result.size() == 0) { break; } else { return result; } } else { if (encoding == null) { result.add(getCertificate(inStream)); } else { result.add(getCertificate(encoding)); } } inStream.mark(1); } if (result.size() != 0) { return result; } else if (ch == -1) { return result; } if (second_asn1_tag == ASN1Constants.TAG_OID) { ContentInfo info=(ContentInfo)((encoding != null) ? ContentInfo.ASN1.decode(encoding) : ContentInfo.ASN1.decode(inStream)); SignedData data=info.getSignedData(); if (data == null) { throw new CertificateException("Invalid PKCS7 data provided"); } List<org.apache.harmony.security.x509.Certificate> certs=data.getCertificates(); if (certs != null) { for ( org.apache.harmony.security.x509.Certificate cert : certs) { result.add(new X509CertImpl(cert)); } } return result; } throw new CertificateException("Unsupported encoding"); } catch ( IOException e) { throw new CertificateException(e); } }
Generates the collection of the certificates on the base of provided via input stream encodings.
public NewSessionAction(){ super("New Session"); }
Creates a new session action for the given desktop.
private StringBuilder appendIfNotNull(StringBuilder source,String addStr,String delimiter){ if (addStr != null) { if (addStr.length() == 0) { delimiter=""; } return source.append(addStr).append(delimiter); } return source; }
Takes a string and adds to it, with a separator, if the bit to be added isn't null. Since the logger takes so many arguments that might be null, this method helps cut out some of the agonizing tedium of writing the same 3 lines over and over.
public void write(OutStream out) throws IOException { out.flushBits(); out.writeUBits(5,getBitSize()); out.writeSBits(bitSize,minX); out.writeSBits(bitSize,maxX); out.writeSBits(bitSize,minY); out.writeSBits(bitSize,maxY); out.flushBits(); }
Write the rect contents to the output stream
@SuppressWarnings("unused") private void checkCenter(LatLon center){ System.out.println("Testing fromLatLngToPoint using: " + center); Point2D p=googleMap.fromLatLngToPoint(center.toLatLong()); System.out.println("Testing fromLatLngToPoint result: " + p); System.out.println("Testing fromLatLngToPoint expected: " + mapComponent.getWidth() / 2 + ", " + mapComponent.getHeight() / 2); System.out.println("type = " + MarkerType.BROWN.iconPath()); }
Demonstrates how to go from lat/lon to pixel coordinates.
public BusinessObjectDataAttributeEntity createBusinessObjectDataAttributeEntity(String namespaceCode,String businessObjectDefinitionName,String businessObjectFormatUsage,String businessObjectFormatFileType,Integer businessObjectFormatVersion,String businessObjectDataPartitionValue,List<String> businessObjectDataSubPartitionValues,Integer businessObjectDataVersion,String businessObjectDataAttributeName,String businessObjectDataAttributeValue){ BusinessObjectDataKey businessObjectDataKey=new BusinessObjectDataKey(namespaceCode,businessObjectDefinitionName,businessObjectFormatUsage,businessObjectFormatFileType,businessObjectFormatVersion,businessObjectDataPartitionValue,businessObjectDataSubPartitionValues,businessObjectDataVersion); return createBusinessObjectDataAttributeEntity(businessObjectDataKey,businessObjectDataAttributeName,businessObjectDataAttributeValue); }
Creates and persists a new business object data attribute entity.
private synchronized boolean containsMapping(Object key,Object value){ int hash=Collections.secondaryHash(key); HashtableEntry<K,V>[] tab=table; int index=hash & (tab.length - 1); for (HashtableEntry<K,V> e=tab[index]; e != null; e=e.next) { if (e.hash == hash && e.key.equals(key)) { return e.value.equals(value); } } return false; }
Returns true if this map contains the specified mapping.
public Setting(Object value,int type,boolean save,String file){ this.value=value; if (type == MAP) { this.defaultValue=new HashMap<>((Map)value); } else if (type == LIST) { this.defaultValue=copyCollection((Collection)value); } else { this.defaultValue=value; } this.save=save; this.type=type; this.file=file; }
Creates a new Setting object with some initial values.
protected void layoutGraphicModifiers(DrawContext dc,AVList modifiers,OrderedSymbol osym){ }
Layout static graphic modifiers around the symbol. Static modifiers are not expected to change due to changes in view. The static layout is computed when a modifier is changed, but may not be computed each frame. For example, a text modifier indicating a symbol identifier would only need to be laid out when the text is changed, so this is best treated as a static modifier. However a direction of movement line that needs to be computed based on the current eye position should be treated as a dynamic modifier.
@HLEFunction(nid=0xE1D621D7,version=150,checkInsideInterrupt=true) public int sceNetAdhocInit(){ log.info(String.format("sceNetAdhocInit: using MAC address=%s, nick name='%s'",sceNet.convertMacAddressToString(Wlan.getMacAddress()),sceUtility.getSystemParamNickname())); if (isInitialized) { return SceKernelErrors.ERROR_NET_ADHOC_ALREADY_INITIALIZED; } isInitialized=true; return 0; }
Initialize the adhoc library.
public Assignment(List<String> booleanAssigns){ this(); booleanAssigns.stream().forEach(null); }
Creates an assignment with a list of boolean assignments (cf. method above).
public void testMergeSameFilterInTwoDocuments() throws Exception { String srcXml="<web-app>" + " <filter>" + " <filter-name>f1</filter-name>"+ " <filter-class>fclass1</filter-class>"+ " </filter>"+ " <filter-mapping>"+ " <filter-name>f1</filter-name>"+ " <url-pattern>/f1mapping1</url-pattern>"+ " </filter-mapping>"+ "</web-app>"; WebXml srcWebXml=WebXmlIo.parseWebXml(new ByteArrayInputStream(srcXml.getBytes("UTF-8")),null); String mergeXml="<web-app>" + " <filter>" + " <filter-name>f1</filter-name>"+ " <filter-class>fclass1</filter-class>"+ " </filter>"+ " <filter-mapping>"+ " <filter-name>f1</filter-name>"+ " <url-pattern>/f1mapping1</url-pattern>"+ " </filter-mapping>"+ "</web-app>"; WebXml mergeWebXml=WebXmlIo.parseWebXml(new ByteArrayInputStream(mergeXml.getBytes("UTF-8")),null); WebXmlMerger merger=new WebXmlMerger(srcWebXml); merger.mergeFilters(mergeWebXml); assertTrue(WebXmlUtils.hasFilter(srcWebXml,"f1")); List<String> filterMappings=WebXmlUtils.getFilterMappings(srcWebXml,"f1"); assertEquals(1,filterMappings.size()); assertEquals("/f1mapping1",filterMappings.get(0)); }
Tests whether the same filter in two different files is mapped correctly (i.e., once).
public static int countPeriods(String haystack){ return StringUtils.countOccurrencesOf(haystack,"."); }
Count the number of periods in a value.
public TwoColumnOutput(Writer out,int leftWidth,int rightWidth,String spacer){ if (out == null) { throw new NullPointerException("out == null"); } if (leftWidth < 1) { throw new IllegalArgumentException("leftWidth < 1"); } if (rightWidth < 1) { throw new IllegalArgumentException("rightWidth < 1"); } if (spacer == null) { throw new NullPointerException("spacer == null"); } StringWriter leftWriter=new StringWriter(1000); StringWriter rightWriter=new StringWriter(1000); this.out=out; this.leftWidth=leftWidth; this.leftBuf=leftWriter.getBuffer(); this.rightBuf=rightWriter.getBuffer(); this.leftColumn=new IndentingWriter(leftWriter,leftWidth); this.rightColumn=new IndentingWriter(rightWriter,rightWidth,spacer); }
Constructs an instance.
public static void main(final String[] args){ DOMTestCase.doMain(nodegetfirstchildnull.class,args); }
Runs this test from the command line.
public void actionPerformed(ActionEvent e){ JTextComponent target=getTextComponent(e); if ((target != null) && (e != null)) { if ((!target.isEditable()) || (!target.isEnabled())) { UIManager.getLookAndFeel().provideErrorFeedback(target); return; } String content=target.getText(); if (content != null && target.getSelectionStart() > 0) { content=content.substring(0,target.getSelectionStart()); } if (content != null) { target.setText(getNextMatch(content)); adaptor.markText(content.length()); } } }
Shows the next match.
public void clear(){ super.clear(); LEFT_PARENTHESES=""; RIGHT_PARENTHESES=""; }
removes the stored data but retains the dimensions of the matrix.
public void deleteChannel(CumulusChannel jsonChannel){ String jsonString=jsonChannel.toString(); Intent i=new Intent("com.felkertech.cumulustv.RECEIVER"); i.putExtra(INTENT_EXTRA_JSON,jsonString); i.putExtra(INTENT_EXTRA_ACTION,INTENT_EXTRA_ACTION_DELETE); sendBroadcast(i); finish(); }
Deletes the provided channel and resyncs. Then the app closes.
public static String toStringExclude(Object object,Collection excludeFieldNames){ return toStringExclude(object,toNoNullStringArray(excludeFieldNames)); }
Builds a String for a toString method excluding the given field names.
public StringDict(BufferedReader reader){ String[] lines=PApplet.loadStrings(reader); keys=new String[lines.length]; values=new String[lines.length]; for (int i=0; i < lines.length; i++) { String[] pieces=PApplet.split(lines[i],'\t'); if (pieces.length == 2) { keys[count]=pieces[0]; values[count]=pieces[1]; count++; } } }
Read a set of entries from a Reader that has each key/value pair on a single line, separated by a tab.
static <K,V>void writeMap(Map<K,V> map,ObjectOutputStream stream) throws IOException { stream.writeInt(map.size()); for ( Map.Entry<K,V> entry : map.entrySet()) { stream.writeObject(entry.getKey()); stream.writeObject(entry.getValue()); } }
Stores the contents of a map in an output stream, as part of serialization. It does not support concurrent maps whose content may change while the method is running. <p>The serialized output consists of the number of entries, first key, first value, second key, second value, and so on.
public NioDatagramAcceptor(){ this(new DefaultDatagramSessionConfig(),null); }
Creates a new instance.
public final <V>V callWithRetry(Callable<V> callable,Predicate<Throwable> isRetryable){ int failures=0; while (true) { try { return callable.call(); } catch ( Throwable e) { if (++failures == attempts || !isRetryable.apply(e)) { throwIfUnchecked(e); throw new RuntimeException(e); } logger.info(e,"Retrying transient error, attempt " + failures); try { sleeper.sleep(Duration.millis(pow(2,failures) * 100)); } catch ( InterruptedException e2) { Thread.currentThread().interrupt(); throwIfUnchecked(e); throw new RuntimeException(e); } } } }
Retries a unit of work in the face of transient errors. <p>Retrying is done a fixed number of times, with exponential backoff, if the exception that is thrown is deemed retryable by the predicate. If the error is not considered retryable, or if the thread is interrupted, or if the allowable number of attempts has been exhausted, the original exception is propagated through to the caller.
public int size(){ return n; }
Returns the number of items in this queue.
public String toXML(Network network){ StringWriter writer=new StringWriter(); writeXML(network,writer); writer.flush(); return writer.toString(); }
Covert the network into xml.
private String parseEntityAttribute(String fieldName){ Matcher m=_fnPattern.matcher(fieldName); if (m.find()) { return m.group(1); } return null; }
check whether this field is one entity attribute or not
void addScrapView(View scrap,int position,int viewType){ if (viewTypeCount == 1) { currentScrapViews.put(position,scrap); } else { scrapViews[viewType].put(position,scrap); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { scrap.setAccessibilityDelegate(null); } }
Put a view into the ScrapViews list. These views are unordered.
public AStart(){ }
Construct the applet
public static void dispose(){ disposeColors(); disposeImages(); disposeFonts(); disposeCursors(); }
Dispose of cached objects and their underlying OS resources. This should only be called when the cached objects are no longer needed (e.g. on application shutdown).
protected int bends(Geo g1,Geo g2,Geo g3){ double bend=g1.crossNormalize(g2).distance(g3) - (Math.PI / 2.0); if (Math.abs(bend) < .0001) { return STRAIGHT; } else { if (bend < 0) { return BENDS_LEFT; } } return BENDS_RIGHT; }
Method that determines which way the angle between the three points bends.
@Override public boolean eIsSet(int featureID){ switch (featureID) { case TypesPackage.PRIMITIVE_TYPE__DECLARED_ELEMENT_TYPE: return declaredElementType != null; case TypesPackage.PRIMITIVE_TYPE__ASSIGNMENT_COMPATIBLE: return assignmentCompatible != null; case TypesPackage.PRIMITIVE_TYPE__AUTOBOXED_TYPE: return autoboxedType != null; } return super.eIsSet(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
@Description(summary="Create h2client.jar with only the remote JDBC implementation.") public void jarClient(){ compile(true,true,false); FileList files=files("temp").exclude("temp/org/h2/build/*").exclude("temp/org/h2/dev/*").exclude("temp/org/h2/jaqu/*").exclude("temp/org/h2/java/*").exclude("temp/org/h2/jcr/*").exclude("temp/org/h2/mode/*").exclude("temp/org/h2/samples/*").exclude("temp/org/h2/test/*").exclude("*.bat").exclude("*.sh").exclude("*.txt").exclude("*.DS_Store"); files=excludeTestMetaInfFiles(files); long kb=jar("bin/h2-client" + getJarSuffix(),files,"temp"); if (kb < 350 || kb > 450) { throw new RuntimeException("Expected file size 350 - 450 KB, got: " + kb); } }
Create the h2client.jar. This only contains the remote JDBC implementation.
public Messages(String name){ this((Messages)null,name); }
Creates a messages bundle by full name.
public void providesSingletonInScope(){ Binding.this.singletonInScope(); isProvidingSingletonInScope=true; }
to provide a singleton using the binding's scope and reuse it inside the binding's scope
public void dispose(){ m_table.getColumn(m_field).removeColumnListener(this); }
Dispose of this metadata, freeing any resources and unregistering any listeners.
public void updateUI(){ super.updateUI(); if (myTree != null) { myTree.updateUI(); } LookAndFeel.installColorsAndFont(this,"Tree.background","Tree.foreground","Tree.font"); }
Overridden to message super and forward the method to the tree. Since the tree is not actually in the component hierarchy it will never receive this unless we forward it in this manner.
public ResourceNotificationException(String message){ super(message); }
Creates a new <code>ResourceNotificationException</code> object
public static double variance(double[] vector){ double sum=0, sumSquared=0; if (vector.length <= 1) { return 0; } for (int i=0; i < vector.length; i++) { sum+=vector[i]; sumSquared+=(vector[i] * vector[i]); } double result=(sumSquared - (sum * sum / (double)vector.length)) / (double)(vector.length - 1); if (result < 0) { return 0; } else { return result; } }
Computes the variance for an array of doubles.
@Override public Class<? extends Task> taskClass(){ return IgniteSinkTask.class; }
Obtains a sink task class to be instantiated for feeding data into grid.
public String createNode(final String path,final boolean watch,final boolean ephimeral){ String createdNodePath=null; try { final Stat nodeStat=zooKeeper.exists(path,watch); if (nodeStat == null) { createdNodePath=zooKeeper.create(path,new byte[0],Ids.OPEN_ACL_UNSAFE,(ephimeral ? CreateMode.EPHEMERAL_SEQUENTIAL : CreateMode.PERSISTENT)); } else { createdNodePath=path; } } catch ( KeeperException|InterruptedException e) { throw new IllegalStateException(e); } return createdNodePath; }
Create a zookeeper node
static ClassLoader findClassLoader() throws ConfigurationError { SecuritySupport ss=SecuritySupport.getInstance(); ClassLoader context=ss.getContextClassLoader(); ClassLoader system=ss.getSystemClassLoader(); ClassLoader chain=system; while (true) { if (context == chain) { ClassLoader current=ObjectFactory.class.getClassLoader(); chain=system; while (true) { if (current == chain) { return system; } if (chain == null) { break; } chain=ss.getParentClassLoader(chain); } return current; } if (chain == null) { break; } chain=ss.getParentClassLoader(chain); } ; return context; }
Figure out which ClassLoader to use. For JDK 1.2 and later use the context ClassLoader.
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.
public boolean isCellEditable(EventObject anEvent){ if (!m_mField.isEditable(false)) return false; log.fine(m_mField.getHeader()); if (anEvent instanceof MouseEvent && ((MouseEvent)anEvent).getClickCount() < CLICK_TO_START) return false; if (m_editor == null) createEditor(); return true; }
Ask the editor if it can start editing using anEvent. If editing can be started this method returns true. Previously called: MTable.isCellEditable
public void applyAll(Collection<? extends IChange> changes) throws BadLocationException { final Map<URI,List<IAtomicChange>> changesPerFile=organize(changes); for ( URI currURI : changesPerFile.keySet()) { final IXtextDocument document=getDocument(currURI); applyAllInSameDocument(changesPerFile.get(currURI),document); } }
Applies all given changes.
public void beginApplyInterval(){ intervalStartMillis=System.currentTimeMillis(); endMillis=intervalStartMillis; state=TaskState.apply; }
Start an apply interval.
public void updateDataset(CandleDataset source,int seriesIndex,boolean newBar){ if (source == null) { throw new IllegalArgumentException("Null source (CandleDataset)."); } for (int i=0; i < this.getSeriesCount(); i++) { CandleSeries series=this.getSeries(i); series.updateSeries(source.getSeries(seriesIndex),source.getSeries(seriesIndex).getItemCount() - 1,newBar); } }
Method updateDataset.
public int optInt(String key){ return this.optInt(key,0); }
Get an optional int value associated with a key, or zero if there is no 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.
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:30:28.318 -0500",hash_original_method="FEDEC1668E99CC7AC8B63903F046C2E4",hash_generated_method="270B33800028B49BD2EC75D7757AD67D") @Override protected void onStartLoading(){ if (mCursor != null) { deliverResult(mCursor); } if (takeContentChanged() || mCursor == null) { forceLoad(); } }
Starts an asynchronous load of the contacts list data. When the result is ready the callbacks will be called on the UI thread. If a previous load has been completed and is still valid the result may be passed to the callbacks immediately. Must be called from the UI thread
public boolean sameAs(DiskStore other){ if (this.autoCompact != other.getAutoCompact()) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_AUTOCOMPACT_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[]{name,this.autoCompact,other.getAutoCompact()})); } if (this.compactionThreshold != other.getCompactionThreshold()) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_COMPACTIONTHRESHOLD_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[]{name,this.compactionThreshold,other.getCompactionThreshold()})); } if (this.allowForceCompaction != other.getAllowForceCompaction()) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_ALLOWFORCECOMPACTION_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[]{name,this.allowForceCompaction,other.getAllowForceCompaction()})); } if (this.maxOplogSizeInBytes != other.getMaxOplogSize() * 1024 * 1024) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_MAXOPLOGSIZE_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[]{name,this.maxOplogSizeInBytes / 1024 / 1024,other.getMaxOplogSize()})); } if (this.timeInterval != other.getTimeInterval()) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_TIMEINTERVAL_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[]{name,this.timeInterval,other.getTimeInterval()})); } if (this.writeBufferSize != other.getWriteBufferSize()) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_WRITEBUFFERSIZE_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[]{name,this.writeBufferSize,other.getWriteBufferSize()})); } if (this.queueSize != other.getQueueSize()) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_QUEUESIZE_OF_0_IS_NOT_THE_SAME_THIS_1_OTHER_2.toLocalizedString(new Object[]{name,this.queueSize,other.getQueueSize()})); } if (!equal(this.diskDirs,other.getDiskDirs())) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_DISK_DIRS_OF_0_ARE_NOT_THE_SAME.toLocalizedString(name)); } if (!equal(this.diskDirSizes,other.getDiskDirSizes())) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_DISK_DIR_SIZES_OF_0_ARE_NOT_THE_SAME.toLocalizedString(name)); } if (!equal(getDiskUsageWarningPercentage(),other.getDiskUsageWarningPercentage())) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_DISK_USAGE_WARN_ARE_NOT_THE_SAME.toLocalizedString(name)); } if (!equal(getDiskUsageCriticalPercentage(),other.getDiskUsageCriticalPercentage())) { throw new RuntimeException(LocalizedStrings.DiskStoreAttributesCreation_DISK_USAGE_CRITICAL_ARE_NOT_THE_SAME.toLocalizedString(name)); } return true; }
Returns whether or not this <code>DiskStoreCreation</code> is equivalent to another <code>DiskStore</code>.
public JsonWriter name(String name) throws IOException { if (name == null) { throw new NullPointerException("name == null"); } beforeName(); string(name); return this; }
Encodes the property name.
protected void changeTimeBy(long amount){ changeTimeBy(amount,timeWrap,(amount >= 0 ? TimerStatus.FORWARD : TimerStatus.BACKWARD)); }
Call setTime with the amount given added to the current time. The amount should be negative if you are going backward through time. You need to make sure manageGraphics is called for the map to update. <p>
public void testCreateRenameNoClose() throws Exception { if (dual) return; create(igfs,paths(DIR,SUBDIR),null); IgfsOutputStream os=null; try { os=igfs.create(FILE,true); igfs.rename(FILE,FILE2); os.close(); } finally { U.closeQuiet(os); } }
Test rename on the file when it was opened for write(create) and is not closed yet.
public boolean equals(Object other){ if (other == null) return false; if (getClass() != other.getClass()) { return false; } HostPort that=(HostPort)other; return port == that.port && host.equals(that.host); }
returns true if the two objects are equals, false otherwise.