code
stringlengths
10
174k
nl
stringlengths
3
129k
public <K,V>void saveToGeode(String regionPath,PairFunction<T,K,V> func,Properties opConf){ dsf.saveToGeode(regionPath,func,dsf.defaultConnectionConf(),propertiesToScalaMap(opConf)); }
Save the JavaDStream to Geode key-value store.
public static SimpleScheduleBuilder repeatMinutelyForever(){ return simpleSchedule().withIntervalInMinutes(1).repeatForever(); }
Create a SimpleScheduleBuilder set to repeat forever with a 1 minute interval.
private void updateServiceEvents(VOPriceModel priceModel){ List<PricedEventRow> serviceEvents=new ArrayList<PricedEventRow>(); for ( VOPricedEvent pricedEvent : priceModel.getConsideredEvents()) { PricedEventRow row; if (pricedEvent.getSteppedPrices().isEmpty()) { row=new PricedEventRow(); row....
Create an exploded list of priced events and stepped prices.
private void readWayParams(){ for ( ConfigGroup e : config.getParameterSets(OsmConverterConfigGroup.OsmWayParams.SET_NAME)) { OsmConverterConfigGroup.OsmWayParams w=(OsmConverterConfigGroup.OsmWayParams)e; if (w.getOsmKey().equals(OsmTag.HIGHWAY)) { highwayParams.put(w.getOsmValue(),w); } else ...
reads the params from the config to different containers.
public ObjectFactory(){ }
Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: eu.europa.esig.jaxb.ecc
public static OrionEjbJarXml parseOracleEjbJarXml(InputStream input) throws IOException, JDOMException { OrionEjbJarXmlIo xio=new OrionEjbJarXmlIo(); return (OrionEjbJarXml)xio.parseXml(input); }
Parses a deployment descriptor provided as input stream.
LinkedEntry(){ super(null,null,0,null); nxt=prv=this; }
Create the header entry
@DSComment("Package priviledge") @DSBan(DSCat.DEFAULT_MODIFIER) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:30:46.584 -0500",hash_original_method="D497FA9053D718AE60BC2EFC5B528C4E",hash_generated_method="D497FA9053D718AE60BC2EFC5B528C4E") String publicNameFromDiskName(String dis...
Returns the public name (everything following the prefix) of the given diskName.
public Exp(){ super(Number.class,Number.class); }
Constructs a new node for calculating the result of Euler's number <i>e</i> raised to the power of a number.
public void validationText(String valid,String invalid,String empty){ this.valid=valid; this.invalid=invalid; this.empty=empty; }
validationText: Set validations message texts
protected void addFlags(int flags){ this.status|=(flags & ~KIND_MASK); }
Adds the given flags to this delta.
private static char[] zzUnpackCMap(String packed){ char[] map=new char[0x10000]; int i=0; int j=0; while (i < 1212) { int count=packed.charAt(i++); char value=packed.charAt(i++); do map[j++]=value; while (--count > 0); } return map; }
Unpacks the compressed character translation table.
public static void resetFileStates(List<FileState> fileStates){ for (Iterator<FileState> iter=fileStates.iterator(); iter.hasNext(); ) { FileState fileState=iter.next(); if (fileState.getModification() == deleted) { iter.remove(); } else { fileState.setModification(null); fileState.setP...
Remove modification, previousFileState and deleted entries
public AndSpecification(final Specification<T> spec1,final Specification<T> spec2){ this.spec1=spec1; this.spec2=spec2; }
Create a new AND specification based on two other spec.
public static CCAnimate action(float duration,CCAnimation anim,boolean restore){ assert anim != null : "Animate: argument anim must be non-null"; return new CCAnimate(duration,anim,restore); }
creates an action with a duration, animation and depending of the restoreOriginalFrame, it will restore the original frame or not. The 'delay' parameter of the animation will be overrided by the duration parameter.
public void accept(final ClassVisitor cv){ String[] exceptions=new String[this.exceptions.size()]; this.exceptions.toArray(exceptions); MethodVisitor mv=cv.visitMethod(access,name,desc,signature,exceptions); if (mv != null) { accept(mv); } }
Makes the given class visitor visit this method.
private Event gameStats(){ Event e=new Event(EType.GAMESTATS).setBoolean(isStarted); if (isStarted) { while (true) { try { waitingPlayers.await(); break; } catch ( InterruptedException ie) { } } int currentHuman=0; ArrayList<String> runningStrings=new ArrayLis...
returns game stats as an event is sent as a reply to HELLO
public static boolean isArrowpointAllowed(Object from,Object to,IKnowledge knowledge){ if (knowledge == null) { return true; } return !knowledge.isRequired(to.toString(),from.toString()) && !knowledge.isForbidden(from.toString(),to.toString()); }
Checks if an arrowpoint is allowed by background knowledge.
@Override protected void updateCastlingRightsForNonEpNonCastlingMove(Move move){ FischerRandomUtils.updateCastlingRightsForNonEpNonCastlingMove(this,move,initialShortRookFile,initialLongRookFile); }
Overridden to handle special FR castling rules.
public void removeMessageEventRequestListener(MessageEventRequestListener messageEventRequestListener){ synchronized (messageEventRequestListeners) { messageEventRequestListeners.remove(messageEventRequestListener); } }
Removes a message event request listener. The listener will be fired anytime a request for event notification is received.
public InferenceResult solveEqualities(Set<TypeVariable> targets,ConstraintMap constraintMap,AnnotatedTypeFactory typeFactory){ final InferenceResult solution=new InferenceResult(); do { dirty=false; for ( TypeVariable target : targets) { if (solution.containsKey(target)) { continue; ...
For each target, if there is one or more equality constraints involving concrete types that lets us infer a primary annotation in all qualifier hierarchies then infer a concrete type argument. else if there is one or more equality constraints involving other targets that lets us infer a primary annotation in all qualif...
public FlatButton(final Composite parent,final int style){ super(parent,style); this.listeners=new ArrayList<SelectionListener>(); buildAlignmentFromStyle(style); addListeners(); initializeDefaultColors(); }
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, usi...
private void startGame(){ Tile tile0=Tile.newRandomTile(); List<Location> randomLocs=new ArrayList<>(locations); Collections.shuffle(randomLocs); tile0.setLocation(randomLocs.get(0)); gameGrid.put(tile0.getLocation(),tile0); if (new Random().nextFloat() <= 0.8) { Tile tile1=Tile.newRandomTile(); if ...
Starts the game by adding 1 or 2 tiles at random locations
public void reset(){ classes.clear(); }
clears all loaded classes
public static X509Certificate verify(Signature signatureAlgorithm,X509TrustManager trustManager,List<String> certChainBase64,byte[] signatureBytes,byte[] contentBytes) throws InvalidKeyException, SignatureException { CertificateFactory certificateFactory; try { certificateFactory=getX509CertificateFactory(); ...
Verifies the signature of signed content based on a certificate chain.
public Builder category(Category category){ this.category=checkNotNull(category); return this; }
Sets the category.
public static OpenFlags validateFromOptions(Iterable<? extends OpenOption> options){ OpenFlags flags=fromOptions(options); if (!flags.read && !flags.write) { if (flags.append) { flags.write=true; } else { flags.read=true; } } if (flags.append && flags.read) { throw new IllegalArgume...
Converts the specified options to flags, sets missing implied flags, and checks for invalid combinations.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:02:43.010 -0500",hash_original_method="F1E314C8F9D29ADD33998DDD6715BE9D",hash_generated_method="A7B1F20FFC94114D5B1D891749AB46CF") protected TestResult createTestResult(){ return new TestResult(); }
Creates the TestResult to be used for the test run.
public static Iterable<String> toHexStrings(Iterable<ByteArray> arrays){ ArrayList<String> ret=new ArrayList<String>(); for ( ByteArray array : arrays) ret.add(HexString.toHexString(array.get())); return ret; }
Translate the each ByteArray in an iterable into a hexidecimal string
public void processingInstruction(StylesheetHandler handler,String target,String data) throws org.xml.sax.SAXException { }
Receive notification of a processing instruction.
public JSONObject optJSONObject(int index){ Object o=this.opt(index); return o instanceof JSONObject ? (JSONObject)o : null; }
Get the optional JSONObject associated with an index. Null is returned if the key is not found, or null if the index has no value, or if the value is not a JSONObject.
public Object runSafely(Catbert.FastStack stack) throws Exception { return sage.plugin.CorePluginManager.getInstance().getPluginProgress(); }
Returns a progress based status message regarding any current plugin installation. There is no progress messages for plugin uninstalls since they should happen relatively quickly.
public static void mixin(MetaClass self,Class categoryClass){ mixin(self,Collections.singletonList(categoryClass)); }
Extend class globally with category methods.
void requestClose(String reason){ close(reason,true,true,false,false); }
Request that the manager close this connection, or close it forcibly if there is no manager. Invoking this method ensures that the proper synchronization is done.
public void testSimpleWatchGet() throws Exception { WatchManager<String> em=new WatchManager<String>(); Watch<String> w=em.watch(new StringWatchPredicate("hello"),1); em.process("hello!",0); assertFalse("Not found yet",w.isDone()); em.process("hello",0); assertTrue("Should be done",w.isDone()); assertFals...
Prove that we can implement a simple watch for String events.
public Builder maxAge(Duration maxAge){ this.maxAge=maxAge; return this; }
Sets the maximum age of events allowed in the stream.
public int deserialize(final byte[] b,final int off){ if (b == null) { return 0; } int parsedBytes=0; try { if (keyProviderIdLen_ < 0) { parsedBytes+=parseKeyProviderIdLen(b,off + parsedBytes); } if (keyProviderId_ == null) { parsedBytes+=parseKeyProviderId(b,off + parsedBytes); ...
Deserialize the provided bytes starting at the specified offset to construct an instance of this class. <p> This method parses the provided bytes for the individual fields in this class. This methods also supports partial parsing where not all the bytes required for parsing the fields successfully are available.
public void clearParsers(){ if (parserManager != null) { parserManager.clearParsers(); } }
Removes all parsers from this text area.
public void handleExpansionRecursion(final HttpServerRequest request){ removeZipParameter(request); handleExpansionRequest(request,RecursiveHandlerFactory.RecursiveHandlerTypes.EXPANSION); }
Handles the request as if it is a recursive expansion.
@Override public int hashCode(){ return x ^ y; }
Returns an integer hash code for the receiver. Any two objects that return <code>true</code> when passed to <code>equals</code> must return the same value for this method.
public void createFailureNullCapacity2(){ new World(null,new AxisAlignedBounds(1,1)); }
Tests passing a null capacity.
final boolean tryMatchData(){ Object x=item; if (x != null && x != this && casItem(x,null)) { LockSupport.unpark(waiter); return true; } return false; }
Tries to artificially match a data node -- used by remove.
@SuppressWarnings("unchecked") protected final T_State enterShallowHistory(){ if (currentState != null) { return currentState; } else { if (initialStateClass != null) { return transitTo(initialStateClass); } else { return (T_State)this; } } }
Enters a shallow history point.
public static long formatSecondsByPeriod(long seconds,Seconds period){ return seconds - (seconds % Int.int2long(period.getSeconds())); }
For example: timestamp stands for time: 1990/01/07 12:45 and period is PT30, then result is 1990/01/07 12:30
public static void write(FileDescriptor fd,byte[] bytes,int byteOffset,int byteCount) throws IOException { Arrays.checkOffsetAndCount(bytes.length,byteOffset,byteCount); if (byteCount == 0) { return; } try { while (byteCount > 0) { int bytesWritten=Libcore.os.write(fd,bytes,byteOffset,byteCount); ...
java.io always writes every byte it's asked to, or fails with an error. (That is, unlike Unix it never just writes as many bytes as happens to be convenient.)
private Locale(boolean unused,String lowerCaseLanguageCode,String upperCaseCountryCode){ this.languageCode=lowerCaseLanguageCode; this.countryCode=upperCaseCountryCode; this.variantCode=""; }
There's a circular dependency between toLowerCase/toUpperCase and Locale.US. Work around this by avoiding these methods when constructing the built-in locales.
public void testCase14(){ byte rBytes[]={1}; BigInteger aNumber=BigInteger.ONE; BigInteger bNumber=BigInteger.ONE; BigInteger result=aNumber.divide(bNumber); byte resBytes[]=new byte[rBytes.length]; resBytes=result.toByteArray(); for (int i=0; i < resBytes.length; i++) { assertTrue(resBytes[i] == rByt...
Divide ONE by ONE.
public boolean onReceivedClientCertRequest(CordovaWebView view,ICordovaClientCertRequest request){ return false; }
Called when he system received an SSL client certificate request. Plugin can use the supplied ClientCertRequest to process this certificate challenge.
protected void notifySubscribers(Response data){ subject.onNext(data); }
Notify the subscribers of the subject of data change
void submit(ProcessAndDisplayImageTask task){ initExecutorsIfNeed(); taskExecutorForCachedImages.execute(task); }
Submits task to execution pool
@VisibleForTesting void realloc(int newLength){ ensureValid(); if (newLength <= mBufRef.get().getSize()) { return; } NativeMemoryChunk newbuf=mPool.get(newLength); mBufRef.get().copy(0,newbuf,0,mCount); mBufRef.close(); mBufRef=CloseableReference.of(newbuf,mPool); }
Reallocate the local buffer to hold the new length specified. Also copy over existing data to this new buffer
public PowerHostUtilizationHistory(int id,RamProvisioner ramProvisioner,BwProvisioner bwProvisioner,long storage,List<? extends Pe> peList,VmScheduler vmScheduler,PowerModel powerModel){ super(id,ramProvisioner,bwProvisioner,storage,peList,vmScheduler,powerModel); }
Instantiates a new PowerHostUtilizationHistory.
public void crossFade(){ if (mCrossFadeSlidingPaneLayout.isOpen()) { mCrossFadeSlidingPaneLayout.closePane(); } else { mCrossFadeSlidingPaneLayout.openPane(); } }
crossfade the current crossfader (toggle between first and second view)
public synchronized FontNameSetting createFontNameSetting(String key,String defaultValue){ FontNameSetting result=new FontNameSetting(DEFAULT_PROPS,PROPS,key,defaultValue); handleSettingInternal(result,null); return result; }
Creates a new <tt>FontNameSetting</tt> instance with the specified key and default value.
private static void locateFiles(String fileName,ArrayList<File> locatedFiles,File file,boolean isConfigFolder,boolean isDirectory){ fileName=fileName.trim(); if (file.exists()) { if (file.isDirectory()) { if (!isConfigFolder) { isConfigFolder=file.getName().equalsIgnoreCase(Constants.CONFIG_ROOT);...
Helper method to recursively look for files with the specified name under the specified folder or match the specified name with the specified file name.
public Boolean isSupports3D(){ return supports3D; }
Gets the value of the supports3D property.
public void testExclude() throws IOException { CharArraySet exclusionSet=new CharArraySet(asSet("havnedistriktene"),false); Analyzer a=new NorwegianAnalyzer(NorwegianAnalyzer.getDefaultStopSet(),exclusionSet); checkOneTerm(a,"havnedistriktene","havnedistriktene"); checkOneTerm(a,"havnedistrikter","havnedistrikt...
test use of exclusion set
public Coordinate findSplitPoint(Segment seg,Coordinate encroachPt){ Coordinate p0=seg.getStart(); Coordinate p1=seg.getEnd(); return new Coordinate((p0.x + p1.x) / 2,(p0.y + p1.y) / 2); }
Gets the midpoint of the split segment
private static int NewByteArray(JNIEnvironment env,int length){ if (traceJNI) VM.sysWrite("JNI called: NewByteArray \n"); RuntimeEntrypoints.checkJNICountDownToGC(); try { byte[] newArray=new byte[length]; return env.pushJNIRef(newArray); } catch ( Throwable unexpected) { if (traceJNI) unex...
NewByteArray: create a new byte array
public static final List<Vec3D> splitIntoSegments(Vec3D a,Vec3D b,float stepLength,List<Vec3D> segments,boolean addFirst){ if (segments == null) { segments=new ArrayList<Vec3D>(); } if (addFirst) { segments.add(a.copy()); } float dist=a.distanceTo(b); if (dist > stepLength) { Vec3D pos=a.copy();...
Splits the line between A and B into segments of the given length, starting at point A. The tweened points are added to the given result list. The last point added is B itself and hence it is likely that the last segment has a shorter length than the step length requested. The first point (A) can be omitted and not be ...
public static void createDefaultGroups(@NonNull Realm realm){ if (!isEmpty(realm)) { return; } realm.beginTransaction(); Group workGroup=realm.createObject(Group.class); workGroup.setName(GroupHelper.WORK); workGroup.setDescription("Great Projects"); workGroup.setCategoryName(GroupHelper.CATEGORY_POPU...
Firstly, create default groups if isEmpty is true.
public Object runSafely(Catbert.FastStack stack) throws Exception { java.util.Properties props=(java.util.Properties)stack.pop(); java.io.File dest=getFile(stack); String src=getString(stack); String serverName=getString(stack); return new FileDownloader(null).downloadFile(serverName,src,dest,false,props); }
Instructs the file transfer engine to download the specified file from the server to the local destination file. You may also download from remote http:// or ftp:// addresses; in that case just specify the URL in the ServerAddress argument and leave sourceFile as null. When downloading from http or ftp addresses, the t...
public void zoomInBoth(double x,double y){ Plot plot=this.chart.getPlot(); if (plot == null) { return; } boolean savedNotify=plot.isNotify(); plot.setNotify(false); zoomInDomain(x,y); zoomInRange(x,y); plot.setNotify(savedNotify); }
Zooms in on an anchor point (specified in screen coordinate space).
private boolean fireSelectionListeners(final SelectionEvent selectionEvent){ final Event event=new Event(); event.button=0; event.display=this.getDisplay(); event.item=null; event.widget=this; event.data=null; event.time=selectionEvent.time; event.x=selectionEvent.x; event.y=selectionEvent.y; final ...
Fire the selection listeners
public Boolean isAdminDisabled(){ return adminDisabled; }
Gets the value of the adminDisabled property.
public long next() throws IOException { if (ord == valueCount) { throw new EOFException(); } if (off == blockSize) { refill(); } final long value=values[off++]; ++ord; return value; }
Read the next value.
public void insert(MyMap myMap){ myMaps.add(0,myMap); notifyItemInserted(0); }
insert the object to the end of the list
public static void main(String[] args){ TestInterface tester=new TestInterface(); run(tester,ARGS,TEST,NEGATED_TEST); tester.printSummary(); }
The entry point of the test.
public void legacyProcess(Class clazz,Method m,MethodAppearanceDecision decision){ if (m.getDeclaringClass() != Object.class && m.getReturnType() != void.class && m.getParameterTypes().length == 0) { String mName=m.getName(); if (!looksLikePropertyReadMethod(mName)) { decision.setExposeMethodAs(null); ...
This only exists as the tests need to call this through the deprecated method too.
public void stdoutShouldNotMatch(String pattern){ Matcher matcher=Pattern.compile(pattern,Pattern.MULTILINE).matcher(stdout); if (matcher.find()) { reportDiagnosticSummary(); throw new RuntimeException("'" + pattern + "' found in stdout \n"); } }
Verify that the stdout contents of output buffer does not match the pattern
public static double mean(double lambda){ return 1.0 / (lambda); }
mean of the exponential distribution
public void assertSubsetOf(Query q1,Query q2) throws Exception { assertSubsetOf(q1,q2,null); int numFilters=TEST_NIGHTLY ? atLeast(10) : atLeast(3); for (int i=0; i < numFilters; i++) { Query filter=randomFilter(); assertSubsetOf(q1,q2,filter); assertSubsetOf(filteredQuery(q1,filter),filteredQuery(q2,...
Asserts that the documents returned by <code>q1</code> are a subset of those returned by <code>q2</code>
public boolean createDb(){ synchronized (this) { aDbHasEverBeenCreatedInThisProcess=true; db.createDb(); return true; } }
API method. Creates the DB and its indexes if needed.
public void start(@NonNull Activity activity){ start(activity,REQUEST_CROP); }
Send the crop Intent from an Activity
public static void writeToFile(final String path,final String content) throws IOException { System.gc(); FileOutputStream fileOutputStream=null; OutputStreamWriter outputStreamWriter=null; BufferedWriter bw=null; try { File parentDir=new File(path).getParentFile(); if (!parentDir.exists()) { par...
Saves HTML Source.
public void onDraw(Paint paint){ paint.setColor(paintColor); }
This method needs to be injected into the view's onDraw method.
public void newArray(final Type type){ int typ; switch (type.getSort()) { case Type.BOOLEAN: typ=Opcodes.T_BOOLEAN; break; case Type.CHAR: typ=Opcodes.T_CHAR; break; case Type.BYTE: typ=Opcodes.T_BYTE; break; case Type.SHORT: typ=Opcodes.T_SHORT; break; case Type.INT: typ=Opcodes.T_INT; break; case Type.FLOAT: ...
Generates the instruction to create a new array.
private void addBevelJoin(LineSegment offset0,LineSegment offset1){ segList.addPt(offset0.p1); segList.addPt(offset1.p0); }
Adds a bevel join connecting the two offset segments around a reflex corner.
public JmsQueueScriptCommand(Configuration configuration,String resourcePath,Resource resource){ super(configuration,resourcePath); this.resource=resource; }
Sets configuration containing all needed information for building configuration scripts.
public BackupCompletionNotification(URI uri){ super(uri); }
Create notification of backup.
private boolean calculatePL_VB(){ if (m_M_Product_ID == 0) return false; if (m_M_PriceList_ID == 0) { log.log(Level.SEVERE,"No PriceList"); Trace.printStack(); return false; } String sql="SELECT pp.PriceStd," + " pp.PriceList," + " pp.PriceLimit,"+ " p.C_UOM_ID,pv.ValidFrom,pl.C_Currency_ID,p.M_Pr...
Calculate Price based on P rice List and Vendor break
@Override public void exitQuery(CQNGrammarParser.QueryContext ctx){ numQueriesEncountered++; validateAllQueriesParsed(numQueriesEncountered,numQueriesParsed); }
This handler is called for all queries, allows us to validate that no handlers are missing.
public double evaluateClustering(Database db,Relation<? extends NumberVector> rel,Clustering<?> c){ boolean square=!(distance instanceof SquaredEuclideanDistanceFunction); int ignorednoise=0; List<? extends Cluster<?>> clusters=c.getAllClusters(); double ssq=0, sum=0; for ( Cluster<?> cluster : clusters) { ...
Evaluate a single clustering.
protected Range findRangeBounds(CategoryDataset dataset,boolean includeInterval){ if (dataset == null) { return null; } if (getDataBoundsIncludesVisibleSeriesOnly()) { List visibleSeriesKeys=new ArrayList(); int seriesCount=dataset.getRowCount(); for (int s=0; s < seriesCount; s++) { if (isS...
Returns the range of values the renderer requires to display all the items from the specified dataset.
int instanceChildIndex(Instance inst){ return this.splitTest.branchForInstance(inst); }
Method to route the instance using this split node
public static synchronized void addParallelLine(final JFreeChartPlotEngine engine,Point latestPopupLocation){ if (dialog == null) { dialog=new AddParallelLineDialog(); } dialog.setMousePosition(latestPopupLocation); dialog.setChartEngine(engine); dialog.showDialog(); }
Opens the add parallel line configuration dialog and then adds the line the user specified.
public void enableAnimations(){ mShouldAnimate=true; }
Enables animating the Views. This is the default.
protected void closeEventStream(){ try { this.eventStream.close(); this.eventStream=null; } catch ( IOException e) { String message=Logging.getMessage("generic.ExceptionClosingXmlEventReader"); Logging.logger().warning(message); } }
Closes the event stream associated with this context's XML event reader.
void sub(BigDecimalPolynomial b){ if (b.coeffs.length > coeffs.length) { int N=coeffs.length; coeffs=copyOf(coeffs,b.coeffs.length); for (int i=N; i < coeffs.length; i++) { coeffs[i]=ZERO; } } for (int i=0; i < b.coeffs.length; i++) { coeffs[i]=coeffs[i].subtract(b.coeffs[i]); } }
Subtracts another polynomial which can have a different number of coefficients.
public Object removeMultiKey(Object key1,Object key2,Object key3,Object key4){ int hashCode=hash(key1,key2,key3,key4); int index=map.hashIndex(hashCode,map.data.length); AbstractHashedMap.HashEntry entry=map.data[index]; AbstractHashedMap.HashEntry previous=null; while (entry != null) { if (entry.hashCode...
Removes the specified multi-key from this map.
public static String cut(final String version,final int parts){ int pos=0; for (int i=0; i < parts; i++) { final int temp=version.indexOf(".",pos + 1); if (temp < 0) { pos=version.length(); break; } pos=temp; } return version.substring(0,pos); }
Extract the specified number of parts from a version-string.
protected TryStatementImpl(){ super(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public boolean matchesNormalized(final Expression other){ if (other != null) { if (other.matcher == null) { if (getNormalized().equals(other.getNormalized())) { return true; } } else { if (matcher != null) { if (!matcher.equals(other.matcher)) { return false; ...
Check if two Expressions match each other.
@Override public Object clone(){ Trie result; result=new Trie(); result.m_Root=(TrieNode)m_Root.clone(); return result; }
returns a deep copy of itself
public static Map<String,String> createTimestampUserData(TModule module){ Resource resource=module.eResource(); long timestamp=0L; if (resource instanceof N4JSResource) { timestamp=((N4JSResource)resource).getModificationStamp(); } else { timestamp=System.currentTimeMillis(); } return Collections.s...
Creates user data with the modification stamp of the resource. This is done to have a nice reaction on changed models that are otherwise broken, e.g no module will be written to the index. We still want to have change affection, though.
public Date when(){ return when; }
Returns the date of this transaction.
public static void initDefaultFlowMod(OFFlowMod.Builder fmb,String entryName){ fmb.setIdleTimeout(INFINITE_TIMEOUT).setHardTimeout(INFINITE_TIMEOUT).setBufferId(OFBufferId.NO_BUFFER).setOutPort(OFPort.ANY).setCookie(computeEntryCookie(0,entryName)).setPriority(Integer.MAX_VALUE).setFlags(Collections.singleton(OFFlowM...
Sets defaults for an OFFlowMod used in the StaticFlowEntryPusher
public void writeRawLittleEndian32(final int value) throws IOException { writeRawByte((value) & 0xFF); writeRawByte((value >> 8) & 0xFF); writeRawByte((value >> 16) & 0xFF); writeRawByte((value >> 24) & 0xFF); }
Write a little-endian 32-bit integer.
public void testRandomStrings() throws Exception { checkRandomData(random(),analyzer,1000 * RANDOM_MULTIPLIER); }
blast some random strings through the analyzer
private void new_estimators(){ for (int i=0; i < m_num_clusters; i++) { for (int j=0; j < m_num_attribs; j++) { if (m_theInstances.attribute(j).isNominal()) { m_modelPrev[i][j]=m_model[i][j]; m_model[i][j]=new DiscreteEstimator(m_theInstances.attribute(j).numValues(),true); } else { ...
New probability estimators for an iteration