code
stringlengths
10
174k
nl
stringlengths
3
129k
public AtomicReferenceArray(E[] array){ this.array=Arrays.copyOf(array,array.length,Object[].class); }
Creates a new AtomicReferenceArray with the same length as, and all elements copied from, the given array.
@DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:35:09.487 -0500",hash_original_method="FCCCC0193355017A3AB410227E2B8C63",hash_generated_method="D9A90AA848BD3378AFD8B57E938B259A") public Intent putStringArrayListExtra(String name,ArrayList<String> value){ mExtras.put(name,value); return this; }
Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll".
public final CC gapBefore(String boundsSize){ hor.setGapBefore(ConstraintParser.parseBoundSize(boundsSize,true,true)); return this; }
Sets the horizontal gap before the component. <p> Note! This is currently same as gapLeft(). This might change in 4.x.
@Override public void registerOutParameter(int parameterIndex,int sqlType) throws SQLException { registerOutParameter(parameterIndex); }
Registers the given OUT parameter.
public static String copyToString(InputStream in,Charset charset) throws IOException { Assert.notNull(in,"No InputStream specified"); StringBuilder out=new StringBuilder(); InputStreamReader reader=new InputStreamReader(in,charset); char[] buffer=new char[BUFFER_SIZE]; int bytesRead=-1; while ((bytesRead=reader.read(buffer)) != -1) { out.append(buffer,0,bytesRead); } return out.toString(); }
Copy the contents of the given InputStream into a String. Leaves the stream open when done.
public static boolean isValidPath(String path){ Path test=new Path(path); for (int i=0, max=test.segmentCount(); i < max; i++) if (!isValidSegment(test.segment(i))) return false; return true; }
Returns whether the given string is syntactically correct as a path. The device id is the prefix up to and including the device separator for the local file system; the path proper is everything to the right of it, or the entire string if there is no device separator. When the platform location is a file system with no meaningful device separator, the entire string is treated as the path proper. The device id is not checked for validity; the path proper is correct if each of the segments in its canonicalized form is valid.
public static BuilderForGossipSeedDiscoverer forGossipSeedDiscoverer(){ return new BuilderForGossipSeedDiscoverer(); }
Creates a new builder for gossip seed discoverer.
public TileEntity createTileEntity(GlowChunk chunk,int cx,int cy,int cz){ return null; }
Create a new tile entity at the given location.
public static Interval zeroToBy(int count,int step){ return Interval.fromToBy(0,count,step); }
Returns an Interval starting from 0 to the specified count value with a step value of step.
public String plural(final String word){ final WordEntry entry=words.get(trimWord(word)); if (entry != null) { if ((entry.getType() != null) && !entry.getType().isPlural()) { return entry.getPlurSing(); } else { return entry.getNormalized(); } } else { return Grammar.plural(word); } }
Lookup the plural form of the given word from the word list.
public int innerNameIndex(int nth){ return ByteArray.readU16bit(get(),nth * 8 + 6); }
Returns <code>classes[nth].inner_name_index</code>.
public byte[] toWire(){ WireFormat.ArrayWriter writer=new WireFormat.ArrayWriter(); try { writer.writeHash(transactionId); writer.writeUint32(outputIndex); } catch ( IOException e) { } return writer.toByteArray(); }
Serialize to Bitcoin wire format
public static Version fromOrdinal(short ordinal,boolean forGFEClients) throws UnsupportedVersionException { if (ordinal == NOT_SUPPORTED_ORDINAL) { throw new UnsupportedVersionException("Un-versioned clients are not supported. "); } if (ordinal == TOKEN_ORDINAL) { return TOKEN; } if ((VALUES.length < ordinal + 1) || VALUES[ordinal] == null || (forGFEClients && CommandInitializer.getCommands(VALUES[ordinal]) == null)) { throw new UnsupportedVersionException(LocalizedStrings.Version_REMOTE_VERSION_NOT_SUPPORTED.toLocalizedString(ordinal,CURRENT.name)); } return VALUES[ordinal]; }
Return the <code>Version</code> represented by specified ordinal
protected CCLabel(CharSequence string,String fontname,float fontsize,int fontStyle){ this(string,CGSize.make(0,0),TextAlignment.CENTER,fontname,fontsize,fontStyle); }
initializes the CCLabel with a font name and font size
protected boolean isSameBackDestination(Container source,Container destination){ return source.getName() == null || destination.getName() == null || source.getName().equals(destination.getName()); }
When navigating from one form/container to another we sometimes might not want the back command to return to the previous container/form but rather to the one before source. A good example would be a "refresh" command or a toggle button that changes the form state.
public String toString(){ return toXML(false); }
Devuelve los valores de la instancia en una cadena de caracteres.
private AnalyticsQuery createAnalysisFromParams(AnalyticsQuery query,String BBID,String[] groupBy,String[] metrics,String[] filterExpressions,String period,String[] timeframe,String[] compareframe,String[] orderExpressions,String[] rollupExpressions,Long limit,Long offset,String[] beyondLimit,Integer maxResults,Integer startIndex,String lazy,Style style) throws ScopeException { if (query == null) query=new AnalyticsQueryImpl(); query.setBBID(BBID); int groupByLength=groupBy != null ? groupBy.length : 0; if (groupByLength > 0) { query.setGroupBy(new ArrayList<String>()); for ( String value : groupBy) { if (value != null && value.length() > 0) query.getGroupBy().add(value); } } if ((metrics != null) && (metrics.length > 0)) { query.setMetrics(new ArrayList<String>()); for ( String value : metrics) { if (value != null && value.length() > 0) query.getMetrics().add(value); } } if ((filterExpressions != null) && (filterExpressions.length > 0)) { query.setFilters(new ArrayList<String>()); for ( String value : filterExpressions) { if (value != null && value.length() > 0) query.getFilters().add(value); } } if (period != null) { query.setPeriod(period); } if (timeframe != null && timeframe.length > 0) { query.setTimeframe(new ArrayList<String>()); for ( String value : timeframe) { if (value != null && value.length() > 0) query.getTimeframe().add(value); } } if (compareframe != null && compareframe.length > 0) { query.setCompareTo(new ArrayList<String>()); for ( String value : compareframe) { if (value != null && value.length() > 0) query.getCompareTo().add(value); } } if ((orderExpressions != null) && (orderExpressions.length > 0)) { query.setOrderBy(new ArrayList<String>()); for ( String value : orderExpressions) { if (value != null && value.length() > 0) query.getOrderBy().add(value); } } if ((rollupExpressions != null) && (rollupExpressions.length > 0)) { List<RollUp> rollups=new ArrayList<RollUp>(); int pos=1; for (int i=0; i < rollupExpressions.length; i++) { RollUp rollup=new RollUp(); String expr=rollupExpressions[i].toLowerCase(); Position position=Position.FIRST; if (expr.startsWith("last(")) { position=Position.LAST; } expr=expr.replaceAll("",""); try { int index=Integer.parseInt(expr); if (index < -1 || index >= groupByLength) { throw new ScopeException("invalid rollup expression at position " + pos + ": the index specified ("+ index+ ") is not defined"); } rollup.setCol(index); rollup.setPosition(position); } catch ( NumberFormatException e) { throw new ScopeException("invalid rollup expression at position " + pos + ": must be a valid indexe N or the expression FIRST(N) or LAST(N) to set the rollup position"); } rollups.add(rollup); } query.setRollups(rollups); } if (limit != null && limit > 0) query.setLimit(limit); if (offset != null && offset > 0) query.setOffset(offset); if (beyondLimit != null && beyondLimit.length > 0) { query.setBeyondLimit(new ArrayList<String>()); for ( String value : beyondLimit) { if (value != null && value.length() > 0) query.getBeyondLimit().add(value); } } if (maxResults != null && maxResults > 0) query.setMaxResults(maxResults); if (startIndex != null && startIndex > 0) query.setStartIndex(startIndex); if (lazy != null) query.setLazy(lazy); if (style != null) query.setStyle(style); return query; }
transform the GET query parameters into a AnalysisQuery similar to the one used for POST
void close(int contextPrec,int ownPrec) throws IOException { if (ownPrec < contextPrec) out.write(")"); }
Leave precedence level. Emit a `(' if inner precedence level is less than precedence level we revert to.
public void addTag(String text){ addTag(text,mChildViews.size()); }
Inserts the specified TagView into this ContainerLayout at the end.
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); int size=s.readInt(); allocateElements(size); head=0; tail=size; for (int i=0; i < size; i++) elements[i]=s.readObject(); }
Deserialize this deque.
public void unsetId(){ issetBitfield=EncodingUtils.clearBit(issetBitfield,ID_ISSET_ID); }
Description: <br>
private void drawBetterImage(Graphics g,int yLoc){ int xLoc=100; int delta=(int)(SCALE_FACTOR * FULL_SIZE); for (int scaledSize=FULL_SIZE; scaledSize > 0; scaledSize-=delta) { Image scaledImage=getOptimalScalingImage(originalImage,FULL_SIZE,scaledSize); g.drawImage(scaledImage,xLoc,yLoc + (FULL_SIZE - scaledSize) / 2,null); xLoc+=scaledSize + 20; } }
Progressive Bilinear approach: this method gets each scaled version from the getOptimalScalingImage method and copies it into place.
public void removeObserver(final Observer observer){ observers.remove(observer); }
remove observer from list
public static void clearWinContext(int WindowNo){ clearWinContext(getCtx(),WindowNo); }
Clean up context for Window (i.e. delete it)
public static <K,V>Map<K,V> singletonMap(K key,V value){ return new SingletonMap<K,V>(key,value); }
Returns a Map containing the specified key and value. The map cannot be modified. The map is serializable.
private void readAndSetPreference(String name,byte typeId,DataInputStream reader,Editor editor) throws IOException { boolean save=true; if (doNotBackup.contains(name)) { save=false; } switch (typeId) { case ContentTypeIds.BOOLEAN_TYPE_ID: boolean booleanValue=reader.readBoolean(); if (save) { editor.putBoolean(name,booleanValue); } return; case ContentTypeIds.LONG_TYPE_ID: long longValue=reader.readLong(); if (save) { editor.putLong(name,longValue); } return; case ContentTypeIds.FLOAT_TYPE_ID: float floatValue=reader.readFloat(); if (save) { editor.putFloat(name,floatValue); } return; case ContentTypeIds.INT_TYPE_ID: int intValue=reader.readInt(); if (save) { editor.putInt(name,intValue); } return; case ContentTypeIds.STRING_TYPE_ID: String utfValue=reader.readUTF(); if (save) { editor.putString(name,utfValue); } return; } }
Reads a single preference and sets it into the given editor.
public Environment(){ this(null); }
Constructs a new, empty environment.
@Bean public PlatformTransactionManager transactionManager(final EntityManagerFactory emf){ final JpaTransactionManager txManager=new JpaTransactionManager(); txManager.setEntityManagerFactory(emf); return txManager; }
Sets up transaction management for Spring Data JPA so that database operations are transactional
public QuasiRandomColors(){ colorCache=new HashMap<Integer,Color>(); colorVariance=new float[]{0.00f,1.00f,0.75f,0.25f,0.25f,0.75f}; }
Creates a new QuasiRandomColors object with default color variance.
public String productSummary(MPPProductBOM bom){ String value=bom.getValue(); String name=bom.get_Translation(MPPProductBOM.COLUMNNAME_Name); StringBuffer sb=new StringBuffer(value); if (name != null && !name.equals(value)) sb.append("_").append(name); return sb.toString(); }
get Product Summary
public void translateRectInScreenToAppWindow(Rect rect){ rect.scale(applicationInvertedScale); }
Translate a Rect in screen coordinates into the app window's coordinates.
public static SupportedCountry findOrCreate(DataService mgr,String countryCode) throws NonUniqueBusinessKeyException { SupportedCountry result=(SupportedCountry)mgr.find(new SupportedCountry(countryCode)); if (result == null) { result=persistCountry(mgr,countryCode); } return result; }
Returns the SupportedCountry for the given country code. The SupportedCountry is created in case it does not exist. Normally all SupportedCountry objects are created during DB setup.
public final CC x2(String x2){ return corrPos(x2,2); }
Sets the x2-coordinate for the component (right side). This is used to set the x2 coordinate position to a specific value. The component bounds is still precalculated to the grid cell and this method should be seen as a way to correct the x position. <p> For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.
@HLEFunction(nid=0x5F10D406,version=150) public void sceKernelCpuResumeIntr(int flagInterrupts){ hleKernelCpuResumeIntr(flagInterrupts); }
Resume all interrupts.
public boolean containsImage(GliderImage image){ return image != null && this.imageTable.contains(image); }
Indicates whether a specified image is associated.
public DViewCertCsrPem(JDialog parent,String title,PKCS10CertificationRequest pkcs10Csr) throws CryptoException { super(parent,title,ModalityType.DOCUMENT_MODAL); this.pkcs10Csr=pkcs10Csr; initComponents(); }
Creates new DViewCertCsrPem dialog where the parent is a dialog.
@Override public void writeToParcel(Parcel dest,int flags){ if (DBG) log("writeToParcel(Parcel, int): " + toString()); dest.writeInt(mNetworkId); dest.writeInt(mSystemId); dest.writeInt(mBasestationId); dest.writeInt(mLongitude); dest.writeInt(mLatitude); }
Implement the Parcelable interface
@Override public boolean eIsSet(int featureID){ switch (featureID) { case RegularExpressionPackage.PATTERN_CHARACTER__VALUE: return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); } return super.eIsSet(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void move(MouseEvent e){ Point2D pnt=getProjectionPoint(e); int x=(int)pnt.getX(); int y=(int)pnt.getY(); if (line.getRenderType() == OMGraphic.RENDERTYPE_OFFSET) { gpm=new OffsetGrabPoint(x,y); gpm.addGrabPoint(gp1); gpm.addGrabPoint(gp2); } else { gpm=gpo; gpm.set(x,y); gpm.updateOffsets(); } movingPoint=gpm; }
Called to set the OffsetGrabPoint to the current mouse location, and update the OffsetGrabPoint with all the other GrabPoint locations, so everything can shift smoothly. Should also set the OffsetGrabPoint to the movingPoint. Should be called only once at the beginning of the general movement, in order to set the movingPoint. After that, redraw(e) should just be called, and the movingPoint will make the adjustments to the graphic that are needed.
private Object readResolve() throws ObjectStreamException { if (this.equals(AxisLocation.TOP_OR_RIGHT)) { return AxisLocation.TOP_OR_RIGHT; } else if (this.equals(AxisLocation.BOTTOM_OR_RIGHT)) { return AxisLocation.BOTTOM_OR_RIGHT; } else if (this.equals(AxisLocation.TOP_OR_LEFT)) { return AxisLocation.TOP_OR_LEFT; } else if (this.equals(AxisLocation.BOTTOM_OR_LEFT)) { return AxisLocation.BOTTOM_OR_LEFT; } return null; }
Ensures that serialization returns the unique instances.
@Override public void run(){ amIActive=true; if (args.length < 2) { showFeedback("Plugin parameters have not been set properly."); return; } String inputHeader=args[0]; String outputHeader=args[1]; if ((inputHeader == null) || (outputHeader == null)) { showFeedback("One or more of the input parameters have not been set properly."); return; } try { int row, col; double z1; int progress, oldProgress=-1; double[] data1; WhiteboxRaster inputFile1=new WhiteboxRaster(inputHeader,"r"); int rows=inputFile1.getNumberRows(); int cols=inputFile1.getNumberColumns(); double noData=inputFile1.getNoDataValue(); WhiteboxRaster outputFile=new WhiteboxRaster(outputHeader,"rw",inputHeader,WhiteboxRaster.DataType.FLOAT,noData); outputFile.setPreferredPalette(inputFile1.getPreferredPalette()); for (row=0; row < rows; row++) { data1=inputFile1.getRowValues(row); for (col=0; col < cols; col++) { z1=data1[col]; if (z1 != noData && z1 != 0) { outputFile.setValue(row,col,1 / z1); } } progress=(int)(100f * row / (rows - 1)); if (progress != oldProgress) { oldProgress=progress; updateProgress((int)progress); if (cancelOp) { cancelOperation(); return; } } } outputFile.addMetadataEntry("Created by the " + getDescriptiveName() + " tool."); outputFile.addMetadataEntry("Created on " + new Date()); inputFile1.close(); outputFile.close(); returnData(outputHeader); } catch ( OutOfMemoryError oe) { myHost.showFeedback("An out-of-memory error has occurred during operation."); } catch ( Exception e) { myHost.showFeedback("An error has occurred during operation. See log file for details."); myHost.logException("Error in " + getDescriptiveName(),e); } finally { updateProgress("Progress: ",0); amIActive=false; myHost.pluginComplete(); } }
Used to execute this plugin tool.
protected void initialize(Instances dataset,int capacity){ if (capacity < 0) { capacity=0; } m_ClassIndex=dataset.m_ClassIndex; m_RelationName=dataset.m_RelationName; m_Attributes=dataset.m_Attributes; m_Instances=new ArrayList<Instance>(capacity); }
initializes with the header information of the given dataset and sets the capacity of the set of instances.
public static void initQuirksList() throws IOException { String userDir=System.getProperty("user.dir"); if (!userDir.endsWith(File.separator)) { userDir+=File.separator; } String filePath=Configuration.dataDir().getAbsolutePath() + File.separator + "canonUnitQuirks.xml"; canonQuirkMap=loadQuirksFile(filePath); filePath=userDir + "mmconf" + File.separator+ "unitQuirksOverride.xml"; customQuirkMap=loadQuirksFile(filePath); initialized.set(true); }
Reads in the values from the canonUnitQuirks.xml file and stores them in memory.
protected void addVM(int pid,RemoteDUnitVMIF client){ VM vm=new VM(this,pid,client); this.vms.add(vm); }
Adds a VM to this <code>Host</code> with the given process id and client record.
public ExtendedGSSContext x(){ return x; }
Accesses the internal GSSContext object. Currently it's used for -- 1. calling requestXXX() before handshake 2. accessing source name Note: If the application needs to do any privileged call on this object, please use doAs(). Otherwise, it can be done directly. The methods listed above are all non-privileged calls.
protected void applyToBlockContainer(BlockContainer bc){ Iterator iterator=bc.getBlocks().iterator(); while (iterator.hasNext()) { Block b=(Block)iterator.next(); applyToBlock(b); } }
Applies the attributes of this theme to the specified container.
public static byte[] randomBytes(char len){ byte[] data=new byte[len]; for (int i=0; i < len; i++) { data[i]=randomByte(); } return data; }
Generate the random byte to be sent
protected void onException(final Exception e){ }
Invoked when a callback fails. By default exception is ignored.
public FencedAtom(Atom base,SymbolAtom l,SymbolAtom r){ this(base,l,null,r); }
Creates a new FencedAtom from the given base and delimiters
public static Object buildTwoDimensionalArray(int methodId,int dim0,int dim1,RVMArray arrayType){ RVMMethod method=MemberReference.getMethodRef(methodId).peekResolvedMethod(); if (VM.VerifyAssertions) VM._assert(method != null); if (!arrayType.isInstantiated()) { arrayType.resolve(); arrayType.instantiate(); } Object[] newArray=(Object[])resolvedNewArray(dim0,arrayType); RVMArray innerArrayType=arrayType.getElementType().asArray(); if (!innerArrayType.isInstantiated()) { innerArrayType.resolve(); innerArrayType.instantiate(); } for (int i=0; i < dim0; i++) { newArray[i]=resolvedNewArray(dim1,innerArrayType); } return newArray; }
Build a two-dimensional array.
public int addAlias(Alias alias){ if (alias != null) { mAliases.add(alias); int index=mAliases.size() - 1; fireTableRowsInserted(index,index); broadcast(new AliasEvent(alias,Event.ADD)); return index; } return -1; }
Adds the alias to the model
public Sorter(Comparator<Description> comparator){ this.comparator=comparator; }
Creates a <code>Sorter</code> that uses <code>comparator</code> to sort tests
public static <T>T checkNotNull(T reference){ if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && reference == null) { throw new NullPointerException(); } return reference; }
Ensures that an object reference is not null.
private void init(){ timeOut=Integer.parseInt(Configurator.getInstance().getProperty(ConfigurationKeys.KEY_SERVER_CACHE_ENTRY_TIMEOUT)) * 1000; }
Private methods
public void shareText(CharSequence text){ Intent intent=new Intent(); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.setAction(BS_PACKAGE + ".ENCODE"); intent.putExtra("ENCODE_TYPE","TEXT_TYPE"); intent.putExtra("ENCODE_DATA",text); String targetAppPackage=findTargetAppPackage(intent); if (targetAppPackage == null) { showDownloadDialog(); } else { intent.setPackage(targetAppPackage); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); activity.startActivity(intent); } }
Shares the given text by encoding it as a barcode, such that another user can scan the text off the screen of the device.
private ZyNodeBuilder(){ }
You are not supposed to instantiate this class.
public CoalesceExpression add(Expression expression){ this.getChildren().add(expression); return this; }
Add an expression to include in the computation.
@Override public void paintComponent(Graphics g){ Graphics2D g2d=(Graphics2D)g; GradientPaint gradient=new GradientPaint(0,0,color1,getWidth(),getHeight(),color2); g2d.setPaint(gradient); g.fillRect(0,0,this.getWidth(),this.getHeight()); }
Paint component with gradient.
public void initializePackageContents(){ if (isInitialized) return; isInitialized=true; setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); ModelPackage theModelPackage=(ModelPackage)EPackage.Registry.INSTANCE.getEPackage(ModelPackage.eNS_URI); InformationModelPackage theInformationModelPackage=(InformationModelPackage)EPackage.Registry.INSTANCE.getEPackage(InformationModelPackage.eNS_URI); FunctionblockPackage theFunctionblockPackage=(FunctionblockPackage)EPackage.Registry.INSTANCE.getEPackage(FunctionblockPackage.eNS_URI); DatatypePackage theDatatypePackage=(DatatypePackage)EPackage.Registry.INSTANCE.getEPackage(DatatypePackage.eNS_URI); mappingModelEClass.getESuperTypes().add(theModelPackage.getModel()); infoModelMappingModelEClass.getESuperTypes().add(this.getMappingModel()); infoModelMappingRuleEClass.getESuperTypes().add(this.getMappingRule()); infomodelSourceEClass.getESuperTypes().add(this.getSource()); infoModelPropertySourceEClass.getESuperTypes().add(this.getInfomodelSource()); infoModelAttributeSourceEClass.getESuperTypes().add(this.getInfomodelSource()); functionBlockMappingModelEClass.getESuperTypes().add(this.getMappingModel()); functionBlockMappingRuleEClass.getESuperTypes().add(this.getMappingRule()); functionBlockSourceEClass.getESuperTypes().add(this.getSource()); functionBlockPropertySourceEClass.getESuperTypes().add(this.getFunctionBlockSource()); functionBlockAttributeSourceEClass.getESuperTypes().add(this.getFunctionBlockSource()); configurationSourceEClass.getESuperTypes().add(this.getFunctionBlockPropertySource()); statusSourceEClass.getESuperTypes().add(this.getFunctionBlockPropertySource()); operationSourceEClass.getESuperTypes().add(this.getFunctionBlockSource()); eventSourceEClass.getESuperTypes().add(this.getFunctionBlockSource()); entityMappingModelEClass.getESuperTypes().add(this.getDataTypeMappingModel()); entityMappingRuleEClass.getESuperTypes().add(this.getMappingRule()); entitySourceEClass.getESuperTypes().add(this.getSource()); entityPropertySourceEClass.getESuperTypes().add(this.getEntitySource()); entityAttributeSourceEClass.getESuperTypes().add(this.getEntitySource()); enumMappingModelEClass.getESuperTypes().add(this.getDataTypeMappingModel()); enumMappingRuleEClass.getESuperTypes().add(this.getMappingRule()); enumSourceEClass.getESuperTypes().add(this.getSource()); enumPropertySourceEClass.getESuperTypes().add(this.getEnumSource()); enumAttributeSourceEClass.getESuperTypes().add(this.getEnumSource()); dataTypeMappingModelEClass.getESuperTypes().add(this.getMappingModel()); referenceTargetEClass.getESuperTypes().add(this.getTarget()); stereoTypeTargetEClass.getESuperTypes().add(this.getTarget()); faultSourceEClass.getESuperTypes().add(this.getFunctionBlockPropertySource()); initEClass(mappingModelEClass,MappingModel.class,"MappingModel",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getMappingModel_Rules(),this.getMappingRule(),null,"rules",null,0,-1,MappingModel.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEAttribute(getMappingModel_TargetPlatform(),ecorePackage.getEString(),"targetPlatform",null,0,1,MappingModel.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(infoModelMappingModelEClass,InfoModelMappingModel.class,"InfoModelMappingModel",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(infoModelMappingRuleEClass,InfoModelMappingRule.class,"InfoModelMappingRule",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(infomodelSourceEClass,InfomodelSource.class,"InfomodelSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getInfomodelSource_Model(),theInformationModelPackage.getInformationModel(),null,"model",null,0,1,InfomodelSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(infoModelPropertySourceEClass,InfoModelPropertySource.class,"InfoModelPropertySource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getInfoModelPropertySource_Property(),theInformationModelPackage.getFunctionblockProperty(),null,"property",null,0,1,InfoModelPropertySource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(infoModelAttributeSourceEClass,InfoModelAttributeSource.class,"InfoModelAttributeSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getInfoModelAttributeSource_Attribute(),this.getModelAttribute(),"attribute",null,0,1,InfoModelAttributeSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(functionBlockMappingModelEClass,FunctionBlockMappingModel.class,"FunctionBlockMappingModel",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(functionBlockMappingRuleEClass,FunctionBlockMappingRule.class,"FunctionBlockMappingRule",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(functionBlockSourceEClass,FunctionBlockSource.class,"FunctionBlockSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getFunctionBlockSource_Model(),theFunctionblockPackage.getFunctionblockModel(),null,"model",null,0,1,FunctionBlockSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(functionBlockPropertySourceEClass,FunctionBlockPropertySource.class,"FunctionBlockPropertySource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(functionBlockAttributeSourceEClass,FunctionBlockAttributeSource.class,"FunctionBlockAttributeSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getFunctionBlockAttributeSource_Attribute(),this.getModelAttribute(),"attribute",null,0,1,FunctionBlockAttributeSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(configurationSourceEClass,ConfigurationSource.class,"ConfigurationSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getConfigurationSource_Property(),theDatatypePackage.getProperty(),null,"property",null,0,1,ConfigurationSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(statusSourceEClass,StatusSource.class,"StatusSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getStatusSource_Property(),theDatatypePackage.getProperty(),null,"property",null,0,1,StatusSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(operationSourceEClass,OperationSource.class,"OperationSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getOperationSource_Operation(),theFunctionblockPackage.getOperation(),null,"operation",null,0,1,OperationSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(eventSourceEClass,EventSource.class,"EventSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getEventSource_Event(),theFunctionblockPackage.getEvent(),null,"event",null,0,1,EventSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getEventSource_EventProperty(),theDatatypePackage.getProperty(),null,"eventProperty",null,0,1,EventSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(entityMappingModelEClass,EntityMappingModel.class,"EntityMappingModel",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(entityMappingRuleEClass,EntityMappingRule.class,"EntityMappingRule",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(entitySourceEClass,EntitySource.class,"EntitySource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getEntitySource_Model(),theDatatypePackage.getEntity(),null,"model",null,0,1,EntitySource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(entityPropertySourceEClass,EntityPropertySource.class,"EntityPropertySource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getEntityPropertySource_Property(),theDatatypePackage.getProperty(),null,"property",null,0,1,EntityPropertySource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(entityAttributeSourceEClass,EntityAttributeSource.class,"EntityAttributeSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getEntityAttributeSource_Attribute(),this.getModelAttribute(),"attribute",null,0,1,EntityAttributeSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(enumMappingModelEClass,EnumMappingModel.class,"EnumMappingModel",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(enumMappingRuleEClass,EnumMappingRule.class,"EnumMappingRule",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(enumSourceEClass,EnumSource.class,"EnumSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getEnumSource_Model(),theDatatypePackage.getEnum(),null,"model",null,0,1,EnumSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(enumPropertySourceEClass,EnumPropertySource.class,"EnumPropertySource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getEnumPropertySource_Property(),theDatatypePackage.getEnumLiteral(),null,"property",null,0,1,EnumPropertySource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(enumAttributeSourceEClass,EnumAttributeSource.class,"EnumAttributeSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getEnumAttributeSource_Attribute(),this.getModelAttribute(),"attribute",null,0,1,EnumAttributeSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(dataTypeMappingModelEClass,DataTypeMappingModel.class,"DataTypeMappingModel",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(targetEClass,Target.class,"Target",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(referenceTargetEClass,ReferenceTarget.class,"ReferenceTarget",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getReferenceTarget_MappingModel(),this.getMappingModel(),null,"mappingModel",null,0,1,ReferenceTarget.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(stereoTypeTargetEClass,StereoTypeTarget.class,"StereoTypeTarget",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getStereoTypeTarget_Name(),ecorePackage.getEString(),"name",null,0,1,StereoTypeTarget.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getStereoTypeTarget_Attributes(),this.getAttribute(),null,"attributes",null,0,-1,StereoTypeTarget.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(attributeEClass,Attribute.class,"Attribute",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAttribute_Name(),ecorePackage.getEString(),"name",null,0,1,Attribute.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEAttribute(getAttribute_Value(),ecorePackage.getEString(),"value",null,0,1,Attribute.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_UNSETTABLE,!IS_ID,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(sourceEClass,Source.class,"Source",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEClass(faultSourceEClass,FaultSource.class,"FaultSource",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getFaultSource_Property(),theDatatypePackage.getProperty(),null,"property",null,0,1,FaultSource.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,!IS_COMPOSITE,IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEClass(mappingRuleEClass,MappingRule.class,"MappingRule",!IS_ABSTRACT,!IS_INTERFACE,IS_GENERATED_INSTANCE_CLASS); initEReference(getMappingRule_Target(),this.getTarget(),null,"target",null,0,1,MappingRule.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,IS_ORDERED); initEReference(getMappingRule_Sources(),this.getSource(),null,"sources",null,0,-1,MappingRule.class,!IS_TRANSIENT,!IS_VOLATILE,IS_CHANGEABLE,IS_COMPOSITE,!IS_RESOLVE_PROXIES,!IS_UNSETTABLE,IS_UNIQUE,!IS_DERIVED,!IS_ORDERED); initEEnum(modelAttributeEEnum,ModelAttribute.class,"ModelAttribute"); addEEnumLiteral(modelAttributeEEnum,ModelAttribute.NAME); addEEnumLiteral(modelAttributeEEnum,ModelAttribute.NAMESPACE); addEEnumLiteral(modelAttributeEEnum,ModelAttribute.VERSION); addEEnumLiteral(modelAttributeEEnum,ModelAttribute.DISPLAYNAME); addEEnumLiteral(modelAttributeEEnum,ModelAttribute.DESCRIPTION); addEEnumLiteral(modelAttributeEEnum,ModelAttribute.CATEGORY); createResource(eNS_URI); }
Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc -->
private void registerListener(TrackDataType trackDataType){ switch (trackDataType) { case TRACKS_TABLE: dataSource.registerContentObserver(TracksColumns.CONTENT_URI,tracksTableObserver); break; case WAYPOINTS_TABLE: dataSource.registerContentObserver(WaypointsColumns.CONTENT_URI,waypointsTableObserver); break; case SAMPLED_IN_TRACK_POINTS_TABLE: dataSource.registerContentObserver(TrackPointsColumns.CONTENT_URI,trackPointsTableObserver); break; case SAMPLED_OUT_TRACK_POINTS_TABLE: break; case PREFERENCE: dataSource.registerOnSharedPreferenceChangeListener(preferenceListener); break; default : break; } }
Registers a listener with data source.
public Surface translate(float x,float y){ tx().translate(x,y); return this; }
Translates the current transformation matrix by the given amount.
protected void sequence_AnnotatedPropertyAssignment_BogusTypeRefFragment_ColonSepTypeRef_GetterHeader_PropertyGetterDeclaration(ISerializationContext context,PropertyGetterDeclaration semanticObject){ genericSequencer.createSequence(context,semanticObject); }
Contexts: PropertyAssignment<Yield> returns PropertyGetterDeclaration PropertyAssignment returns PropertyGetterDeclaration Constraint: ( annotationList=AnnotatedPropertyAssignment_PropertyGetterDeclaration_1_1_0_0_0? bogusTypeRef=BogusTypeRef? declaredName=LiteralOrComputedPropertyName declaredTypeRef=TypeRef? (body=Block | body=Block) )
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:00.118 -0500",hash_original_method="FEB84A328EE7F3166E4E0FA71F02D2E0",hash_generated_method="A8A19550D0A1B28AF44CDAE5D0E2399B") private static String limit(int lower,int upper){ if ((lower < 0) || (upper <= 0) || (upper < lower)) { throw new IllegalArgumentException(); } return "{" + lower + ","+ upper+ "}"; }
Returns a regular expression quantifier with an upper and lower limit.
@Override public boolean eIsSet(int featureID){ switch (featureID) { case UmplePackage.BOOL_EXPR___LITERAL_1: return LITERAL_1_EDEFAULT == null ? literal_1 != null : !LITERAL_1_EDEFAULT.equals(literal_1); case UmplePackage.BOOL_EXPR___NAME_1: return NAME_1_EDEFAULT == null ? name_1 != null : !NAME_1_EDEFAULT.equals(name_1); case UmplePackage.BOOL_EXPR___EQUALITY_OP_1: return equalityOp_1 != null && !equalityOp_1.isEmpty(); case UmplePackage.BOOL_EXPR___INDEX_1: return INDEX_1_EDEFAULT == null ? index_1 != null : !INDEX_1_EDEFAULT.equals(index_1); } return super.eIsSet(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public T caseConditionalExpression(ConditionalExpression object){ return null; }
Returns the result of interpreting the object as an instance of '<em>Conditional Expression</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
@Override public GraphQuery has(final String key,final Predicate predicate,final Object value){ if (!knownPredicates.contains(predicate.getClass())) { throw new IllegalArgumentException(); } criteria.add(new Has(key,value,BigdataPredicate.toBigdataPredicate(predicate))); return this; }
Filter out the element if it does not have a property with a comparable value.
public boolean isContentsEmpty(){ return contents.isEmpty(); }
It checks if the list of contents is empty.
public Property weekyear(){ return new Property(this,getChronology().weekyear()); }
Get the year of a week based year property which provides access to advanced functionality.
public static int maxProfitB(int[] prices){ if (prices == null || prices.length < 2) { return 0; } int min=prices[0]; int max=0; int len=prices.length; int[] history=new int[len]; for (int i=0; i < len - 1; i++) { min=min < prices[i] ? min : prices[i]; if (i > 0) { history[i]=Math.max(history[i - 1],prices[i] - min); max=history[i] > max ? history[i] : max; } } return max; }
DP, bottom-up. Keep track of minimum price of the stock. Keep track of the maximum profit before today. Get the maximum profit of today, and compare with previous maximum. Update maximum if today's profit is larger. Stop until the array is fully traversed. O(n) Time, O(n) Space.
public static <T>Set<T> eachWithIndex(Set<T> self,@ClosureParams(value=FromString.class,options="T,java.lang.Integer") Closure closure){ return (Set<T>)eachWithIndex((Iterable<T>)self,closure); }
Iterates through a Set, passing each item and the item's index (a counter starting at zero) to the given closure.
public void testPipelineWithEvents() throws Exception { TungstenProperties config=helper.createRuntimeWithStore(1); ReplicatorRuntime runtime=new ReplicatorRuntime(config,new MockOpenReplicatorContext(),ReplicatorMonitor.getInstance()); runtime.configure(); runtime.prepare(); Pipeline pipeline=runtime.getPipeline(); pipeline.start(new MockEventDispatcher()); Future<ReplDBMSHeader> wait=pipeline.watchForCommittedSequenceNumber(9,false); ReplDBMSHeader lastEvent=wait.get(10,TimeUnit.SECONDS); assertEquals("Expected 10 sequence numbers",9,lastEvent.getSeqno()); assertEquals("committed event seqno",9,pipeline.getLastAppliedEvent().getSeqno()); assertEquals("applied seqno",9,pipeline.getLastAppliedSeqno()); assertEquals("extracted seqno",9,pipeline.getLastExtractedSeqno()); List<ShardProgress> shards=pipeline.getShardProgress(); assertEquals("empty shard list",1,shards.size()); List<TaskProgress> tasks=pipeline.getTaskProgress(); assertEquals("two tasks in list",2,tasks.size()); TaskProgress task=tasks.get(1); assertEquals("applied event",lastEvent,task.getLastCommittedEvent()); assertEquals("committed event seqno",lastEvent.getSeqno(),task.getLastCommittedEvent().getSeqno()); assertEquals("events processed on task",10,task.getEventCount()); pipeline.shutdown(false); pipeline.release(runtime); }
Verify that the pipeline tracks processed sequence numbers.
public Instrumenter attachR1Collector(){ includeR1=true; return this; }
Includes the R1 collector when instrumenting algorithms.
private void quadFullScreenVao(){ this.vao=glGenVertexArrays(); int vbo=glGenBuffers(); glBindVertexArray(vao); glBindBuffer(GL_ARRAY_BUFFER,vbo); ByteBuffer bb=BufferUtils.createByteBuffer(4 * 2 * 6); FloatBuffer fv=bb.asFloatBuffer(); fv.put(-1.0f).put(-1.0f); fv.put(1.0f).put(-1.0f); fv.put(1.0f).put(1.0f); fv.put(1.0f).put(1.0f); fv.put(-1.0f).put(1.0f); fv.put(-1.0f).put(-1.0f); glBufferData(GL_ARRAY_BUFFER,bb,GL_STATIC_DRAW); glEnableVertexAttribArray(0); glVertexAttribPointer(0,2,GL_FLOAT,false,0,0L); glBindBuffer(GL_ARRAY_BUFFER,0); glBindVertexArray(0); }
Create a VAO with a full-screen quad VBO.
@Override public void initCPTs(BayesNet bayesNet) throws Exception { bayesNet.m_Distributions=new Estimator[bayesNet.m_Instances.numAttributes()][2]; }
initCPTs reserves space for CPTs and set all counts to zero
public static List<CliFunctionResult> cleanResults(List<?> results){ List<CliFunctionResult> returnResults=new ArrayList<CliFunctionResult>(results.size()); for ( Object result : results) { if (result instanceof CliFunctionResult) { returnResults.add((CliFunctionResult)result); } } Collections.sort(returnResults); return returnResults; }
Remove elements from the list that are not instances of CliFunctionResult and then sort the results.
public RenameEnumConstProcessor(JavaRefactoringArguments arguments,RefactoringStatus status){ super(null); RefactoringStatus initializeStatus=initialize(arguments); status.merge(initializeStatus); }
Creates a new rename enum const processor.
public PolicyQualifierInfoTableModel(){ columnNames=new String[1]; columnNames[0]=res.getString("PolicyQualifierInfoTableModel.PolicyQualifierInfoColumn"); data=new Object[0][0]; }
Construct a new PolicyQualifierInfoTableModel.
@Override public String readLine() throws IOException { if (this.pointer >= this.data.length - 1) { return null; } else { final StringBuilder buf=new StringBuilder(); int c; while ((c=read()) >= 0) { if ((c == 10) || (c == 13)) { if (((peek() == 10) || (peek() == 13)) && (peek() != c)) { read(); } break; } buf.append((char)c); } return buf.toString(); } }
return next line (returns null if no line)
public static void putbytes2Uint8s(char[] destUint8s,byte[] srcBytes,int destOffset,int srcOffset,int count){ for (int i=0; i < count; i++) { destUint8s[destOffset + i]=convertByte2Uint8(srcBytes[srcOffset + i]); } }
Put byte[] into char[]( we treat char[] as uint8[])
protected SMMessage(int sender,int cid,int type,ApplicationState state,View view,int regency,int leader){ super(sender); this.state=state; this.view=view; this.cid=cid; this.type=type; this.sender=sender; this.regency=regency; this.leader=leader; if (type == TOMUtil.TRIGGER_SM_LOCALLY && sender == -1) this.TRIGGER_SM_LOCALLY=true; else this.TRIGGER_SM_LOCALLY=false; }
Constructs a SMMessage
@Override public IMultiPoint[] generate(int size){ return convert(pointGen.generate(size)); }
Invoke inner generator and convert all to IMultiPoint.
public short calcHeaderLength(DbfTableModel model){ int length=0; length+=model.getColumnCount() * 32; length+=32; length+=1; Integer integer=new Integer(length); return integer.shortValue(); }
Calculates the length of the header in terms of bytes
protected BlockConsistencyGroup findConsistencyGroup(String consistencyGroupId,String openstackTenantId){ BlockConsistencyGroup blockConsistencyGroup=(BlockConsistencyGroup)getCinderHelper().queryByTag(URI.create(consistencyGroupId),getUserFromContext(),BlockConsistencyGroup.class); return blockConsistencyGroup; }
This function returns consistency group
public Item pop(){ if (isEmpty()) throw new NoSuchElementException("Stack underflow"); Item item=first.item; first=first.next; n--; return item; }
Removes and returns the item most recently added to this stack.
public Bucket createBucket(CreateBucketRequest createBucketRequest) throws OSSException, ClientException { assertParameterNotNull(createBucketRequest,"createBucketRequest"); String bucketName=createBucketRequest.getBucketName(); assertParameterNotNull(bucketName,"bucketName"); ensureBucketNameValid(bucketName); Map<String,String> headers=new HashMap<String,String>(); addOptionalACLHeader(headers,createBucketRequest.getCannedACL()); RequestMessage request=new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint()).setMethod(HttpMethod.PUT).setBucket(bucketName).setHeaders(headers).setInputStreamWithLength(createBucketRequestMarshaller.marshall(createBucketRequest)).setOriginalRequest(createBucketRequest).build(); doOperation(request,emptyResponseParser,bucketName,null); return new Bucket(bucketName); }
Create a bucket.
private static Pair<String,String> postIndexedROR(final long offset,final ITranslationEnvironment environment,final List<ReilInstruction> instructions,final String registerNodeValue1,final String registerNodeValue2,final String immediateNodeValue){ final String address=environment.getNextVariableString(); final String index=environment.getNextVariableString(); final String tmpVar=environment.getNextVariableString(); final String tmpVar1=environment.getNextVariableString(); final String tmpVar2=environment.getNextVariableString(); final String tmpVar3=environment.getNextVariableString(); long baseOffset=offset; instructions.add(ReilHelpers.createStr(baseOffset++,dw,registerNodeValue1,dw,address)); instructions.add(ReilHelpers.createBsh(baseOffset++,dw,registerNodeValue2,dw,"-" + Integer.decode(immediateNodeValue),dw,tmpVar1)); instructions.add(ReilHelpers.createBsh(baseOffset++,dw,registerNodeValue2,dw,String.valueOf(32 - Integer.decode(immediateNodeValue)),dw,tmpVar2)); instructions.add(ReilHelpers.createOr(baseOffset++,dw,tmpVar1,dw,tmpVar2,dw,tmpVar3)); instructions.add(ReilHelpers.createAnd(baseOffset++,dw,tmpVar3,dw,dWordBitMask,dw,index)); instructions.add(ReilHelpers.createAdd(baseOffset++,dw,registerNodeValue1,dw,index,dw,tmpVar)); instructions.add(ReilHelpers.createAnd(baseOffset++,dw,tmpVar,dw,dWordBitMask,dw,registerNodeValue1)); return new Pair<String,String>(address,registerNodeValue1); }
Operation: [<Rn>], +/-<Rm>, ROR #<shift_imm> address = Rn 0b11 / ROR or RRX / if shift_imm == 0 then / RRX / index = (C Flag Logical_Shift_Left 31) OR (Rm Logical_Shift_Right 1) else / ROR / index = Rm Rotate_Right shift_imm if ConditionPassed(cond) then if U == 1 then Rn = Rn + index else / U == 0 / Rn = Rn - index
public boolean selectAll(double x,double y){ beginMark=textPainter.selectFirst(this); endMark=textPainter.selectLast(this); return true; }
Selects all the text in this TextNode. The coordinates are ignored.
protected final boolean handlePossibleCenter(int[] stateCount,int i,int j){ int stateCountTotal=stateCount[0] + stateCount[1] + stateCount[2]+ stateCount[3]+ stateCount[4]; float centerJ=centerFromEnd(stateCount,j); float centerI=crossCheckVertical(i,(int)centerJ,stateCount[2],stateCountTotal); if (!Float.isNaN(centerI)) { centerJ=crossCheckHorizontal((int)centerJ,(int)centerI,stateCount[2],stateCountTotal); if (!Float.isNaN(centerJ)) { float estimatedModuleSize=(float)stateCountTotal / 7.0f; boolean found=false; for (int index=0; index < possibleCenters.size(); index++) { FinderPattern center=possibleCenters.get(index); if (center.aboutEquals(estimatedModuleSize,centerI,centerJ)) { possibleCenters.set(index,center.combineEstimate(centerI,centerJ,estimatedModuleSize)); found=true; break; } } if (!found) { FinderPattern point=new FinderPattern(centerJ,centerI,estimatedModuleSize); possibleCenters.add(point); if (resultPointCallback != null) { resultPointCallback.foundPossibleResultPoint(point); } } return true; } } return false; }
<p>This is called when a horizontal scan finds a possible alignment pattern. It will cross check with a vertical scan, and if successful, will, ah, cross-cross-check with another horizontal scan. This is needed primarily to locate the real horizontal center of the pattern in cases of extreme skew.</p> <p>If that succeeds the finder pattern location is added to a list that tracks the number of times each location has been nearly-matched as a finder pattern. Each additional find is more evidence that the location is in fact a finder pattern center
@Deprecated public static void write(StringBuffer data,Writer output) throws IOException { if (data != null) { output.write(data.toString()); } }
Writes chars from a <code>StringBuffer</code> to a <code>Writer</code>.
public Type pingType(final Type type_){ Type typex=type_; if ("void*".equals(typex.name) && getTypeByName(typex.name) != null) return getTypeByName(typex.name); if (typex.name != null) typex=Type.merge(typex,getTypeByName(typex.name)); else typex=Type.merge(typex,getTypeByNTypes(new Pair(typex.type32,typex.type64))); putTypeByName(typex.name,typex); putTypeByNTypes(new Pair(typex.type32,typex.type64),typex); return typex; }
When a new Type is discovered, pass it through here to hit the cache, potentially merge with other types, etc. Always do: Type type = TypeCache.inst().pingType(new Type(a,b,c)); because this should return a better merge for you.
public static SmashQueue buildSmashQueue(Context context){ try { String packageName=context.getPackageName(); PackageInfo info=context.getPackageManager().getPackageInfo(packageName,0); sCachedUserAgent=packageName + "/" + info.versionCode; } catch ( PackageManager.NameNotFoundException ignored) { } SmashQueue queue=new SmashQueue(); queue.start(); return queue; }
Builds new SmashQueue to handle requests.
private int lastIndexOf(int elem){ int boffset=m_firstFree & m_MASK; for (int index=m_firstFree >>> m_SHIFT; index >= 0; --index) { int[] block=m_map[index]; if (block != null) for (int offset=boffset; offset >= 0; --offset) if (block[offset] == elem) return offset + index * m_blocksize; boffset=0; } return -1; }
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
public void showNext(){ setDisplayedChild(mWhichChild + 1); }
Manually shows the next child.
final void putFloat(int offset,float value){ unsafe.putFloat(offset + address,value); }
Writes a float at the specified offset from this native object's base address.
public Sequence(Class<?>... types){ super(types[types.length - 1],types); }
Constructs a new node for executing a specified number of expressions in sequence.
@Override public void closingCancel(){ }
Actions to perform when the user has closed the dialog with the Cancel button
@Deprecated public void write(DataOutput out) throws IOException { this.comparator.write(out); }
Old interface in hbase-0.94
public AverageTrueRangeSeries(Strategy strategy,String name,String type,String description,Boolean displayOnChart,Integer chartRGBColor,Boolean subChart){ super(strategy,name,type,description,displayOnChart,chartRGBColor,subChart); }
Creates a new empty series. By default, items added to the series will be sorted into ascending order by period, and duplicate periods will not be allowed.
public static String encrypt(String text) throws GeneralSecurityException { return new String(encrypt(text.getBytes())); }
Encrypts a given string based on a shared secret.
@Override public boolean exists(){ return getJar().exists(getPath()); }
Returns true if the entry exists in the jar file.