code
stringlengths
10
174k
nl
stringlengths
3
129k
public Enumeration oids(){ return ordering.elements(); }
return an Enumeration of the extension field's object ids.
protected void threadStart(){ if (thread != null) { return; } threadDone=false; thread=new Thread(this,threadName); thread.setDaemon(true); thread.start(); }
Start the background thread that will periodically check for changes to compile time included files in a JSP.
protected static String translateFileName(String fileName){ fileName=fileName.replace('\\','/'); if (fileName.startsWith("file:")) { fileName=fileName.substring("file:".length()); } return expandUserHomeDirectory(fileName); }
Translate the file name to the native format. This will replace '\' with '/' and expand the home directory ('~').
public void parse(final InputStream input,final CompressedXmlParserListener listener) throws IOException { if (listener == null) { throw new IllegalArgumentException("CompressedXmlParser Listener can' be null"); } mListener=listener; mData=new byte[input.available()]; input.read(mData); input.close(); parseCompressedXml(); }
Parses the xml data in the given file,
@Override public int read() throws IOException { return Streams.readSingleByte(this); }
Reads a byte from the compressed input stream. The result will be a byte of compressed data corresponding to an uncompressed byte or bytes read from the underlying stream.
private void updateDisplayOfUr92Count(){ Object[] messageArguments={numUr92,numUr92}; java.text.MessageFormat formatter=new java.text.MessageFormat(""); try { formatter.applyPattern(rb.getString("LabelDeviceCountUR92")); double[] pluralLimits={0,1,2}; String[] devicePlurals={rb.getString("LabelDeviceCountUR92Plural0"),rb.getString("LabelDeviceCountUR92Plural1"),rb.getString("LabelDeviceCountUR92Plural2")}; java.text.ChoiceFormat pluralForm=new java.text.ChoiceFormat(pluralLimits,devicePlurals); java.text.Format[] messageFormats={java.text.NumberFormat.getInstance(),pluralForm}; formatter.setFormats(messageFormats); String ur92CountString=formatter.format(messageArguments); swingNumUr92Label.setText(ur92CountString); } catch ( java.lang.Exception e) { String s="Found " + numUr92 + " UR92(s)"; swingNumUr92Label.setText(s); } swingNumUr92Label.repaint(); }
update the GUI label showing the number of UR92 devices
private void unscheduleInvalidTapNotification(){ mRunnableHandler.removeCallbacks(mHandleInvalidTapRunnable); mIsWaitingForInvalidTapDetection=true; }
Un-schedules all pending notifications to check if a tap was invalid.
public CF10(){ this(10); }
Constructs a CF10 test problem with 10 decision variables.
static long first(long binAddr,GridUnsafeMemory mem){ return mem.readLong(binAddr); }
Reads first entry address.
public SimpleColorMap(Color[] colorTable,double minLevel,double maxLevel,Color minColor,Color maxColor){ setColorTable(colorTable); setLevels(minLevel,maxLevel,minColor,maxColor); }
Given an array of size n, constructs a ColorMap that maps integers from 0 to n-1 to the colors in the array, and gradiates from minLevel -> minColor to maxLevel -> maxColor for certain other values. Any real-valued number x, for 0 <= x < n, is converted into an integer (with floor()) and then mapped to an array color. Outside this range, gradiation occurs for minLevel <= x <= maxLevel. For any other value of x, values higher than maxLevel are mapped to maxColor, and values less than minLevel are mapped to minColor. Values from x through n, not including n, and additionally values from minLevel through maxLevel, are considered valid levels by validLevel(...) The default value is 0 (for defaultValue() ).
public void testConstructorBytesException(){ byte aBytes[]={}; try { new BigInteger(aBytes); fail("NumberFormatException has not been caught"); } catch ( NumberFormatException e) { } }
Create a number from an array of bytes. Verify an exception thrown if an array is zero bytes long
public String insertDocumentoVital(InfoBDocumentoVitalExtVO documentoVital){ documentoVital.setId(getGuid(documentoVital.getId())); insertVO(TABLE_NAME,COL_DEFS,documentoVital); return documentoVital.getId(); }
Inserta un de documento vital.
public PTQuery_Partial HappenedBeforeJoin(String x,Tracepoint tracepoint) throws PTQueryException { return AddHappenedBefore(this,x,PTQuery.From(tracepoint)); }
Happened-before join with the other tracepoint. This is: ... (query so far) ... Join x In tracepoint ON x -> (this)
public boolean add(E e){ if (offer(e)) return true; else throw new IllegalStateException("Queue full"); }
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning <tt>true</tt> upon success and throwing an <tt>IllegalStateException</tt> if no space is currently available. <p>This implementation returns <tt>true</tt> if <tt>offer</tt> succeeds, else throws an <tt>IllegalStateException</tt>.
public int costInline(int thresh,Environment env,Context ctx){ int cost=2; if (init != null) { cost+=init.costInline(thresh,env,ctx); } if (cond != null) { cost+=cond.costInline(thresh,env,ctx); } if (body != null) { cost+=body.costInline(thresh,env,ctx); } if (inc != null) { cost+=inc.costInline(thresh,env,ctx); } return cost; }
The cost of inlining this statement
static ScenarioForEvalData createPlanfallMixed(ScenarioForEvalData nullfall){ ScenarioForEvalData planfall=nullfall.createDeepCopy(); Values planfallForOD=planfall.getByODRelation("BC"); { ValuesForAMode railValues=planfallForOD.getByMode(Mode.rail); railValues.getByDemandSegment(DemandSegment.PV_NON_COMMERCIAL).incByEntry(Attribute.hrs,-4.); double delta=90.; railValues.getByDemandSegment(DemandSegment.PV_NON_COMMERCIAL).incByEntry(Attribute.XX,delta); planfall.getByODRelation("BC").getByMode(Mode.road).getByDemandSegment(DemandSegment.PV_NON_COMMERCIAL).incByEntry(Attribute.XX,-delta / 2); } return planfall; }
"Mixed" means that half of the new demand comes from another mode, and the other half comes out of nowhere
public static String nextCode(){ return nextCode(new Date()); }
Returns next main cycle IMM code from the reference date
public long arg_start(){ return Long.parseLong(fields[47]); }
(since Linux 3.5) Address above which program command-line arguments (argv) are placed.
public void pause(){ thread.suspend(); }
pause getting sensors data
public static Output buildOutput(){ Output output; output=new Output(true); output.addLog(ec.util.Log.D_STDOUT,false); output.addLog(ec.util.Log.D_STDERR,true); return output; }
Constructs and sets up an Output object.
public void prepare(FIXMessage message,CharSequence msgType){ message.reset(); message.addField(MsgType).setString(msgType); prepare(message); }
<p>Prepare a message.</p>
public final int lastIndexOf(java.lang.CharSequence csq){ return lastIndexOf(csq,0); }
Returns the index within this character sequence of the last occurrence of the specified characters sequence searching backwards.
protected void init() throws ConfigurationException, LoggingException { this.sqlEncoder=new SQLEncoder(logger); }
Creates the sql encoder.
private static Instance createInstanceTemplate(String userEmail,String projectId,String zoneId,List<String> scopes){ Instance instance=new Instance(); instance.setMachineType(String.format(ENUMERATION_TEST_MACHINE_TYPE,projectId,zoneId)); NetworkInterface ifc=new NetworkInterface(); ifc.setNetwork(String.format(NETWORK_INTERFACE,projectId)); List<AccessConfig> configs=new ArrayList<>(); AccessConfig config=new AccessConfig(); config.setType(NETWORK_INTERFACE_CONFIG); config.setName(NETWORK_ACCESS_CONFIG); configs.add(config); ifc.setAccessConfigs(configs); instance.setNetworkInterfaces(Collections.singletonList(ifc)); AttachedDisk disk=new AttachedDisk(); disk.setBoot(true); disk.setAutoDelete(true); disk.setType(DISK_TYPE_PERSISTENT); AttachedDiskInitializeParams params=new AttachedDiskInitializeParams(); params.setSourceImage(SOURCE_IMAGE); params.setDiskType(String.format(DISK_TYPE,projectId,zoneId)); disk.setInitializeParams(params); instance.setDisks(Collections.singletonList(disk)); ServiceAccount account=new ServiceAccount(); account.setEmail(userEmail); account.setScopes(scopes); instance.setServiceAccounts(Collections.singletonList(account)); return instance; }
Create an instance template for later provisioning.
private Cursor makePeopleCursor(CharSequence email) throws SQLException { if (email == null) { email=""; } String[] pieces=TextUtils.split(email.toString(),","); String piece; if (pieces.length == 0) { piece=""; } else { piece=pieces[pieces.length - 1].trim(); } return ((AndroidDatabaseResults)app.getDao(Person.class).queryRaw("SELECT rowid _id, * FROM people WHERE " + Person.ISBOT_FIELD + " = 0 AND "+ Person.ISACTIVE_FIELD+ " = 1 AND "+ Person.EMAIL_FIELD+ " LIKE ? ESCAPE '\\' ORDER BY "+ Person.NAME_FIELD+ " COLLATE NOCASE",DatabaseHelper.likeEscape(piece) + "%").closeableIterator().getRawResults()).getRawCursor(); }
Creates a cursor to get the E-Mails stored in the database
public static boolean isParentOf(Node node,Node parentNode){ if (node == null || parentNode == null || node.getParentNode() != parentNode) { return false; } return true; }
Tests whether the given node is a child of the given parent node.
public void whisper(String user,String message){ checkSocket(); this.socket.sendTextMessage("whisper:" + user + ": "+ message); }
Send a private message to a user. This call is asynchronous, any error or success with be sent as a separate message to the listener.
private void addTestPackage(List<TestPackage> testList,ITestPackageDef testPkgDef){ IRemoteTest testForPackage=testPkgDef.createTest(mCtsBuild.getTestCasesDir()); if (testForPackage != null) { Collection<TestIdentifier> knownTests=testPkgDef.getTests(); testList.add(new TestPackage(testPkgDef,testForPackage,knownTests)); } }
Adds a test package to the list of packages to test
protected void handleNodeAttributes(Object node,Map attributes){ if (node == null) { return; } for ( Closure attrDelegate : getProxyBuilder().getAttributeDelegates()) { FactoryBuilderSupport builder=this; if (attrDelegate.getOwner() instanceof FactoryBuilderSupport) { builder=(FactoryBuilderSupport)attrDelegate.getOwner(); } else if (attrDelegate.getDelegate() instanceof FactoryBuilderSupport) { builder=(FactoryBuilderSupport)attrDelegate.getDelegate(); } attrDelegate.call(new Object[]{builder,node,attributes}); } if (getProxyBuilder().getCurrentFactory().onHandleNodeAttributes(getProxyBuilder().getChildBuilder(),node,attributes)) { getProxyBuilder().setNodeAttributes(node,attributes); } }
Assigns any existing properties to the node.<br> It will call attributeDelegates before passing control to the factory that built the node.
private boolean gpsPreferenceEnabled(){ SharedPreferences sharedPref=PreferenceManager.getDefaultSharedPreferences(context); boolean gpsPref=sharedPref.getBoolean("allowGps",false); Log.d(TAG,"Gps pref set to: " + gpsPref); return gpsPref; }
Check if user enabled retrieval of their current location in Settings
@Override protected EClass eStaticClass(){ return DomPackage.Literals.TAG_TITLE; }
<!-- begin-user-doc --> <!-- end-user-doc -->
private static synchronized void initKeychainAuthenticatedVault(Context context) throws GeneralSecurityException { if (SharedPreferenceVaultFactory.canUseKeychainAuthentication(context) && SharedPreferenceVaultRegistry.getInstance().getVault(KEYCHAIN_AUTHENTICATED_KEY_INDEX) == null) { SharedPreferenceVault sharedPreferenceVault=SharedPreferenceVaultFactory.getKeychainAuthenticatedAes256Vault(context,KEYCHAIN_AUTHENTICATED_PREF_FILE_NAME,KEYCHAIN_AUTHENTICATED_KEY_ALIAS,KEYCHAIN_AUTHENTICATED_AUTH_DURATION); SharedPreferenceVaultRegistry.getInstance().addVault(KEYCHAIN_AUTHENTICATED_KEY_INDEX,KEYCHAIN_AUTHENTICATED_PREF_FILE_NAME,KEYCHAIN_AUTHENTICATED_KEY_ALIAS,sharedPreferenceVault); } }
Create a vault that requires recent user authentication.
@Override public void translate(final ITranslationEnvironment environment,final IInstruction instruction,final List<ReilInstruction> instructions) throws InternalTranslationException { TranslationHelpers.checkTranslationArguments(environment,instruction,instructions,"CPS"); long baseOffset=ReilHelpers.nextReilAddress(instruction,instructions); instructions.add(ReilHelpers.createUnknown(baseOffset)); }
CPS<effect> <iflags> {, #<mode>}
public Java2DRenderer(String url,int width,int height){ this(url,url,width,height); }
Renderer for a given URL and a specified width; height is calculated automatically.
public static AISMerge newForModifyTable(AISCloner aisCloner,NameGenerator generator,AkibanInformationSchema sourceAIS,Collection<ChangedTableDescription> alteredTables){ List<JoinChange> changedJoins=new ArrayList<>(); Map<IndexName,IndexInfo> indexesToFix=new HashMap<>(); List<IdentityInfo> identityToFix=new ArrayList<>(); Set<TableName> groupsToClear=new HashSet<>(); AkibanInformationSchema targetAIS=copyAISForModify(aisCloner,sourceAIS,indexesToFix,changedJoins,identityToFix,alteredTables,groupsToClear); return new AISMerge(aisCloner,generator,targetAIS,null,MergeType.MODIFY_TABLE,changedJoins,indexesToFix,identityToFix,groupsToClear); }
Create a new AISMerge to be used for modifying a table.
private void beforeKey() throws JSONException { Scope context=peek(); if (context == Scope.NONEMPTY_OBJECT) { out.append(','); } else if (context != Scope.EMPTY_OBJECT) { throw new JSONException("Nesting problem"); } newline(); replaceTop(Scope.DANGLING_KEY); }
Inserts any necessary separators and whitespace before a name. Also adjusts the stack to expect the key's value.
public static long popParameterLong(){ return parametersLong.pop(); }
<p> popParameterLong </p>
private Figure readLineElement(IXMLElement elem) throws IOException { HashMap<AttributeKey,Object> a=new HashMap<AttributeKey,Object>(); readCoreAttributes(elem,a); readTransformAttribute(elem,a); readOpacityAttribute(elem,a); readLineAttributes(elem,a); if (FILL_COLOR.get(a) != null && STROKE_COLOR.get(a) == null) { STROKE_COLOR.put(a,FILL_COLOR.get(a)); } if (FILL_GRADIENT.get(a) != null && STROKE_GRADIENT.get(a) == null) { STROKE_GRADIENT.put(a,FILL_GRADIENT.get(a)); } FILL_COLOR.put(a,null); FILL_GRADIENT.put(a,null); double x1=toNumber(elem,readAttribute(elem,"x1","0")); double y1=toNumber(elem,readAttribute(elem,"y1","0")); double x2=toNumber(elem,readAttribute(elem,"x2","0")); double y2=toNumber(elem,readAttribute(elem,"y2","0")); Figure figure=factory.createLine(x1,y1,x2,y2,a); elementObjects.put(elem,figure); return figure; }
Reads an SVG "line" element.
@Override public String toString(){ if (eIsProxy()) return super.toString(); StringBuffer result=new StringBuffer(super.toString()); result.append(" (flaggedUsageMarkingFinished: "); result.append(flaggedUsageMarkingFinished); result.append(')'); return result.toString(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
@Override public byte[] srandmember(final byte[] key){ checkIsInMultiOrPipeline(); client.srandmember(key); return client.getBinaryBulkReply(); }
Return a random element from a Set, without removing the element. If the Set is empty or the key does not exist, a nil object is returned. <p> The SPOP command does a similar work but the returned element is popped (removed) from the Set. <p> Time complexity O(1)
public void requestRedraw(){ this.firePropertyChange(AVKey.REPAINT,null,null); }
Request any scene containing this KML document be repainted.
protected Element addElement(Element parent,String name,String classname,boolean primitive,int array,boolean isnull){ Element result; if (parent == null) { result=m_Document.getDocument().getDocumentElement(); } else { result=(Element)parent.appendChild(m_Document.getDocument().createElement(TAG_OBJECT)); } result.setAttribute(ATT_NAME,name); result.setAttribute(ATT_CLASS,classname); if (!booleanToString(primitive).equals(ATT_PRIMITIVE_DEFAULT)) { result.setAttribute(ATT_PRIMITIVE,booleanToString(primitive)); } if (array > 1) { result.setAttribute(ATT_ARRAY,Integer.toString(array)); } else { if (!booleanToString(array == 1).equals(ATT_ARRAY_DEFAULT)) { result.setAttribute(ATT_ARRAY,booleanToString(array == 1)); } } if (!booleanToString(isnull).equals(ATT_NULL_DEFAULT)) { result.setAttribute(ATT_NULL,booleanToString(isnull)); } return result; }
appends a new node to the parent with the given parameters
public static boolean isGenerateFileSameAsCatalogFile(String filename){ CachedFile generateFile=CachedFileManager.addCachedFile(CatalogManager.getGenerateFolder().getAbsolutePath() + File.separator + filename); CachedFile catalogFile=CachedFileManager.addCachedFile(CatalogManager.getCatalogFolder().getAbsolutePath() + File.separator + filename); assert generateFile != null; assert catalogFile != null; return isSourceFileSameAsTargetFile(generateFile,catalogFile); }
Check if specified file different in generate and catalog folders. The filename rovided should be the path relative to the folders in question and not include the path itself. Uses isGenerateFileSameAsTargetFile() supplying catalog folder as target.
public final int _exptype2Type(int exptype){ if (NULL != exptype) return m_extendedTypes[exptype].getNodeType(); else return NULL; }
Return the node type from the expanded type
public InvalidStaticWriteAccessDescription(IEObjectDescription delegate,String memberDefiningTypeName,String aliasOfMemberDefiningType){ super(delegate); this.memberDefTypeName=memberDefiningTypeName; this.aliasOfMemberDefiningType=aliasOfMemberDefiningType; }
Creates a new instance of this wrapping description.
public void closeCajaExecuteLogic(ActionMapping mappings,ActionForm form,HttpServletRequest request,HttpServletResponse response){ removeInTemporalSession(request,TransferenciasConstants.CAJA_MAINTAIN_VISITADOS_KEY); removeInTemporalSession(request,TransferenciasConstants.CAJA_VISITADOS_KEY); goBackExecuteLogic(mappings,form,request,response); }
Cierra la caja.
public boolean contains(final AbstractInsnNode insn){ AbstractInsnNode i=first; while (i != null && i != insn) { i=i.next; } return i != null; }
Returns <tt>true</tt> if the given instruction belongs to this list. This method always scans the instructions of this list until it finds the given instruction or reaches the end of the list.
private void writeAttribute(java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (namespace.equals("")) { xmlWriter.writeAttribute(attName,attValue); } else { registerPrefix(xmlWriter,namespace); xmlWriter.writeAttribute(namespace,attName,attValue); } }
Util method to write an attribute without the ns prefix
public boolean startsWith(String string){ if (string == null) return false; int strlen=string.length(); if (_length < strlen) return false; char[] buffer=_buffer; int offset=_offset; while (--strlen >= 0) { if (buffer[offset + strlen] != string.charAt(strlen)) return false; } return true; }
Returns true if the CharSegment starts with the string.
public RegularTimePeriod previous(){ return new CandlePeriod(this.getStart().minusSeconds(secondsLength),secondsLength); }
Returns the second preceding this one.
private static Capitalization containsAt(String s,int index,String... substrings){ for ( String substring : substrings) { if (index + substring.length() <= s.length()) { boolean found=true; Boolean up1=null; Boolean up2=null; for (int i=0; i < substring.length(); i++) { char c1=s.charAt(index + i); char c2=substring.charAt(i); if (c1 != c2 && Character.toUpperCase(c1) != Character.toUpperCase(c2)) { found=false; break; } else if (Character.isLetter(c1)) { if (up1 == null) { up1=Character.isUpperCase(c1); } else if (up2 == null) { up2=Character.isUpperCase(c1); } } } if (found) { return Capitalization.toCapitalization(up1,up2); } } } return null; }
Returns a capitalization strategy if the specified string contains any of the specified substrings at the specified index. The capitalization strategy indicates the casing of the substring that was found. If none of the specified substrings are found, this method returns <code>null</code> .
private void initializePopulationND(int populationSize){ int N=50; int numberOfObjectives=problem.getNumberOfObjectives(); List<double[]> weights=new ArrayList<double[]>(populationSize * N); for (int i=0; i < populationSize * N; i++) { double[] weight=new double[numberOfObjectives]; for (int j=0; j < numberOfObjectives; j++) { weight[j]=PRNG.nextDouble(); } double sum=StatUtils.sum(weight); for (int j=0; j < numberOfObjectives; j++) { weight[j]/=sum; } weights.add(weight); } population=new ArrayList<Individual>(populationSize); for (int i=0; i < numberOfObjectives; i++) { double[] weight=new double[numberOfObjectives]; weight[i]=1.0; population.add(new Individual(weight)); } while (population.size() < populationSize) { double[] weight=null; double distance=Double.NEGATIVE_INFINITY; for (int i=0; i < weights.size(); i++) { double d=Double.POSITIVE_INFINITY; for (int j=0; j < population.size(); j++) { d=Math.min(d,MathArrays.distance(weights.get(i),population.get(j).getWeights())); } if (d > distance) { weight=weights.get(i); distance=d; } } population.add(new Individual(weight)); weights.remove(weight); } }
Initializes the population for problems of arbitrary dimension.
public final void length(int newLength){ if (newLength < 0) throw new IndexOutOfBoundsException("illegal argument"); ensureCapacity(newLength); super.length(newLength); }
Set the length of the buffer.
public void add(String category,String[] titles,double[] values){ mCategories.add(category); mTitles.add(titles); mValues.add(values); }
Adds a new value to the series.
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value="FE_FLOATING_POINT_EQUALITY",justification="equality is specifically 'Unchanged' here") public void changeLocoSpeed(DccThrottle t,Block blk,float speed){ if (blk == referenced && speed == desiredSpeedStep) { return; } float blockLength=blk.getLengthMm(); if (blk == referenced) { distanceRemaining=distanceRemaining - getDistanceTravelled(_throttle.getIsForward(),_throttle.getSpeedSetting(),((float)(System.nanoTime() - lastTimeTimerStarted) / 1000000000)); blockLength=distanceRemaining; log.debug("Block passed is the same as we are currently processing"); } else { referenced=blk; } changeLocoSpeed(t,blockLength,speed); }
Set speed of a throttle to a speeed set by a float, using the block for the length details
public static void registerMetadata(MetadataRegistry registry){ if (registry.isRegistered(KEY)) { return; } Person.registerMetadata(registry); registry.build(KEY); }
Registers the metadata for this element.
@Override protected MBeanNotificationInfo[] createMBeanNotificationInfo(){ MBeanNotificationInfo[] notificationsInfo=new MBeanNotificationInfo[MAX_NOTIFICATIONS_COUNT]; String[] notificationTypes=new String[]{AdminDistributedSystemJmxImpl.NOTIF_MEMBER_JOINED}; notificationsInfo[0]=new MBeanNotificationInfo(notificationTypes,Notification.class.getName(),"A GemFire manager, cache, or other member has joined this distributed system."); notificationTypes=new String[]{AdminDistributedSystemJmxImpl.NOTIF_MEMBER_LEFT}; notificationsInfo[1]=new MBeanNotificationInfo(notificationTypes,Notification.class.getName(),"A GemFire manager, cache, or other member has left the distributed system."); notificationTypes=new String[]{AdminDistributedSystemJmxImpl.NOTIF_MEMBER_CRASHED}; notificationsInfo[2]=new MBeanNotificationInfo(notificationTypes,Notification.class.getName(),"A member of this distributed system has crashed instead of leaving cleanly."); notificationTypes=new String[]{AdminDistributedSystemJmxImpl.NOTIF_ALERT}; notificationsInfo[3]=new MBeanNotificationInfo(notificationTypes,Notification.class.getName(),"A member of this distributed system has generated an alert."); notificationTypes=new String[]{AdminDistributedSystemJmxImpl.NOTIF_ADMIN_SYSTEM_DISCONNECT}; notificationsInfo[4]=new MBeanNotificationInfo(notificationTypes,Notification.class.getName(),"A GemFire manager, cache, or other member has joined this distributed system."); notificationTypes=new String[]{SystemMemberJmx.NOTIF_CACHE_CREATED}; notificationsInfo[5]=new MBeanNotificationInfo(notificationTypes,Notification.class.getName(),"A cache got created on a member of this distributed system."); notificationTypes=new String[]{SystemMemberJmx.NOTIF_CACHE_CLOSED}; notificationsInfo[6]=new MBeanNotificationInfo(notificationTypes,Notification.class.getName(),"A cache is closed on a member of this distributed system."); notificationTypes=new String[]{SystemMemberJmx.NOTIF_REGION_CREATED}; notificationsInfo[7]=new MBeanNotificationInfo(notificationTypes,Notification.class.getName(),"A region is created in a cache on a member of this distributed system."); notificationTypes=new String[]{SystemMemberJmx.NOTIF_REGION_LOST}; notificationsInfo[8]=new MBeanNotificationInfo(notificationTypes,Notification.class.getName(),"A region was removed from a cache on a member of this distributed system."); return notificationsInfo; }
Returns notifications defined for this MBean as an array of MBeanNotificationInfo objects.
static public void dumpManifest(String fileName){ Manifest mf=getManifest(fileName); if (mf == null) { System.out.println("No Jar file: " + fileName); return; } System.out.println(mf.getEntries()); }
Dump Manifest to
public void endCompose(StylesheetRoot sroot) throws TransformerException { StylesheetRoot.ComposeState cstate=sroot.getComposeState(); cstate.popStackMark(); }
This after the template's children have been composed.
public RequestScope(String path,JsonApiDocument jsonApiDocument,DataStoreTransaction transaction,User user,EntityDictionary dictionary,JsonApiMapper mapper,AuditLogger auditLogger,MultivaluedMap<String,String> queryParams,SecurityMode securityMode,Function<RequestScope,PermissionExecutor> permissionExecutorGenerator,MultipleFilterDialect filterDialect,boolean useFilterExpressions){ this.path=path; this.jsonApiDocument=jsonApiDocument; this.transaction=transaction; this.user=user; this.dictionary=dictionary; this.mapper=mapper; this.auditLogger=auditLogger; this.securityMode=securityMode; this.filterDialect=filterDialect; this.useFilterExpressions=useFilterExpressions; this.globalFilterExpression=null; this.expressionsByType=new HashMap<>(); this.objectEntityCache=new ObjectEntityCache(); this.newPersistentResources=new LinkedHashSet<>(); this.dirtyResources=new LinkedHashSet<>(); this.commitTriggers=new LinkedHashSet<>(); this.permissionExecutor=(permissionExecutorGenerator == null) ? new ActivePermissionExecutor(this) : permissionExecutorGenerator.apply(this); this.queryParams=(queryParams == null || queryParams.size() == 0) ? Optional.empty() : Optional.of(queryParams); if (this.queryParams.isPresent()) { MultivaluedMap filterParams=getFilterParams(queryParams); String errorMessage=""; if (!filterParams.isEmpty()) { try { globalFilterExpression=filterDialect.parseGlobalExpression(path,filterParams); } catch ( ParseException e) { errorMessage=e.getMessage(); } try { expressionsByType.putAll(filterDialect.parseTypedExpression(path,filterParams)); } catch ( ParseException e) { if (globalFilterExpression == null) { if (errorMessage.isEmpty()) { errorMessage=e.getMessage(); } else if (!errorMessage.equals(e.getMessage())) { errorMessage=errorMessage + "\n" + e.getMessage(); } throw new InvalidPredicateException(errorMessage); } } } this.sparseFields=parseSparseFields(queryParams); this.sorting=Sorting.parseQueryParams(queryParams); this.pagination=Pagination.parseQueryParams(queryParams); } else { this.sparseFields=Collections.emptyMap(); this.sorting=Sorting.getDefaultEmptyInstance(); this.pagination=Pagination.getDefaultPagination(); } if (transaction instanceof RequestScopedTransaction) { ((RequestScopedTransaction)transaction).setRequestScope(this); } }
Create a new RequestScope.
@Override public boolean accept(final IScope scope,final IShape source,final IShape a){ final IAgent agent=a.getAgent(); if (agent == null) { return false; } if (agent.getPopulation() != this) { return false; } if (agent.dead()) { return false; } final IAgent as=source.getAgent(); if (agent == as) { return false; } return true; }
Method accept()
public static boolean isNoCacheEqual(Set<Feature> feats_1,Set<Feature> feats_2){ ArrayList<Feature> feats_long; ArrayList<Feature> feats_short; if (feats_1.size() > feats_2.size()) { feats_long=new ArrayList(feats_1); feats_short=new ArrayList(feats_2); } else if (feats_1.size() < feats_2.size()) { feats_long=new ArrayList(feats_2); feats_short=new ArrayList(feats_1); } else return isEqual(feats_1,feats_2); boolean hold=false; ArrayList<String> splited_long; ArrayList<String> splited_short=null; for (int i=0, j=0; i < feats_short.size(); ) { if ((feats_long.size() - j - 1) < (feats_short.size() - i - 1)) return false; if (!hold) { splited_long=new ArrayList(Arrays.asList(feats_long.get(j).getName().split(":"))); splited_short=new ArrayList(Arrays.asList(feats_short.get(i).getName().split(":"))); splited_long.removeAll(Collections.singleton("")); splited_short.removeAll(Collections.singleton("")); } else { splited_long=new ArrayList(Arrays.asList(feats_long.get(j).getName().split(":"))); splited_long.removeAll(Collections.singleton("")); } for (int k=1; k < splited_short.size(); k++) { if (splited_short.get(k).equals(splited_long.get(k))) { hold=false; continue; } else if (splited_short.get(k).equals("#word#") && splited_long.get(k).equals("#wd")) { hold=false; continue; } else { hold=true; break; } } if (!hold) { i++; j++; } else { j++; } } return !hold; }
Check if two sets of SRL feature are equal, when cache does matter for feature extraction.
private void showFeedback(String message){ if (myHost != null) { myHost.showFeedback(message); } else { System.out.println(message); } }
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
public boolean next(){ this.position=this.buffer.position(); if (!buffer.hasRemaining()) { return false; } this.nextCalled=true; byte tsTypeFlag=buffer.get(); if (GTSEncoder.FLAGS_ENCRYPTED == (tsTypeFlag & GTSEncoder.FLAGS_MASK_ENCRYPTED)) { int enclen=(int)Varint.decodeUnsignedLong(buffer); if (null == wrappingKey) { buffer.position(buffer.position() + enclen); return next(); } byte[] encrypted=new byte[enclen]; buffer.get(encrypted); AESWrapEngine engine=new AESWrapEngine(); CipherParameters params=new KeyParameter(this.wrappingKey); engine.init(false,params); try { byte[] decrypted=engine.unwrap(encrypted,0,encrypted.length); PKCS7Padding padding=new PKCS7Padding(); int padcount=padding.padCount(decrypted); this.buffer.insert(decrypted,0,decrypted.length - padcount); } catch ( InvalidCipherTextException icte) { } return next(); } byte locElevFlag=0x0; if (GTSEncoder.FLAGS_CONTINUATION == (tsTypeFlag & GTSEncoder.FLAGS_CONTINUATION)) { if (!buffer.hasRemaining()) { return false; } locElevFlag=buffer.get(); } switch (tsTypeFlag & GTSEncoder.FLAGS_MASK_TIMESTAMP) { case GTSEncoder.FLAGS_TIMESTAMP_RAW_ABSOLUTE: { ByteOrder order=buffer.order(); buffer.order(ByteOrder.BIG_ENDIAN); previousLastTimestamp=lastTimestamp; lastTimestamp=buffer.getLong(); buffer.order(order); } break; case GTSEncoder.FLAGS_TIMESTAMP_EQUALS_BASE: previousLastTimestamp=lastTimestamp; lastTimestamp=baseTimestamp; break; case GTSEncoder.FLAGS_TIMESTAMP_ZIGZAG_DELTA_BASE: { long delta=Varint.decodeSignedLong(buffer); previousLastTimestamp=lastTimestamp; lastTimestamp=baseTimestamp + delta; } break; case GTSEncoder.FLAGS_TIMESTAMP_ZIGZAG_DELTA_PREVIOUS: { long delta=Varint.decodeSignedLong(buffer); previousLastTimestamp=lastTimestamp; lastTimestamp=lastTimestamp + delta; } break; default : throw new RuntimeException("Invalid timestamp format."); } if (GTSEncoder.FLAGS_LOCATION == (locElevFlag & GTSEncoder.FLAGS_LOCATION)) { if (GTSEncoder.FLAGS_LOCATION_IDENTICAL != (locElevFlag & GTSEncoder.FLAGS_LOCATION_IDENTICAL)) { if (GTSEncoder.FLAGS_LOCATION_GEOXPPOINT_ZIGZAG_DELTA == (locElevFlag & GTSEncoder.FLAGS_LOCATION_GEOXPPOINT_ZIGZAG_DELTA)) { long delta=Varint.decodeSignedLong(buffer); previousLastGeoXPPoint=lastGeoXPPoint; lastGeoXPPoint=lastGeoXPPoint + delta; } else { ByteOrder order=buffer.order(); buffer.order(ByteOrder.BIG_ENDIAN); previousLastGeoXPPoint=lastGeoXPPoint; lastGeoXPPoint=buffer.getLong(); buffer.order(order); } } } else { previousLastGeoXPPoint=lastGeoXPPoint; lastGeoXPPoint=GeoTimeSerie.NO_LOCATION; } if (GTSEncoder.FLAGS_ELEVATION == (locElevFlag & GTSEncoder.FLAGS_ELEVATION)) { if (GTSEncoder.FLAGS_ELEVATION_IDENTICAL != (locElevFlag & GTSEncoder.FLAGS_ELEVATION_IDENTICAL)) { boolean zigzag=GTSEncoder.FLAGS_ELEVATION_ZIGZAG == (locElevFlag & GTSEncoder.FLAGS_ELEVATION_ZIGZAG); long encoded; if (zigzag) { encoded=Varint.decodeSignedLong(buffer); } else { ByteOrder order=buffer.order(); buffer.order(ByteOrder.BIG_ENDIAN); encoded=buffer.getLong(); buffer.order(order); } if (GTSEncoder.FLAGS_ELEVATION_DELTA_PREVIOUS == (locElevFlag & GTSEncoder.FLAGS_ELEVATION_DELTA_PREVIOUS)) { previousLastElevation=lastElevation; lastElevation=lastElevation + encoded; } else { previousLastElevation=lastElevation; lastElevation=encoded; } } } else { previousLastElevation=lastElevation; lastElevation=GeoTimeSerie.NO_ELEVATION; } switch (tsTypeFlag & GTSEncoder.FLAGS_MASK_TYPE) { case GTSEncoder.FLAGS_TYPE_LONG: lastType=TYPE.LONG; if (GTSEncoder.FLAGS_VALUE_IDENTICAL != (tsTypeFlag & GTSEncoder.FLAGS_VALUE_IDENTICAL)) { long encoded; if (GTSEncoder.FLAGS_LONG_ZIGZAG == (tsTypeFlag & GTSEncoder.FLAGS_LONG_ZIGZAG)) { encoded=Varint.decodeSignedLong(buffer); } else { ByteOrder order=buffer.order(); buffer.order(ByteOrder.BIG_ENDIAN); encoded=buffer.getLong(); buffer.order(order); } if (GTSEncoder.FLAGS_LONG_DELTA_PREVIOUS == (tsTypeFlag & GTSEncoder.FLAGS_LONG_DELTA_PREVIOUS)) { previousLastLongValue=lastLongValue; lastLongValue=lastLongValue + encoded; } else { previousLastLongValue=lastLongValue; lastLongValue=encoded; } } break; case GTSEncoder.FLAGS_TYPE_DOUBLE: lastType=TYPE.DOUBLE; if (GTSEncoder.FLAGS_VALUE_IDENTICAL != (tsTypeFlag & GTSEncoder.FLAGS_VALUE_IDENTICAL)) { if (GTSEncoder.FLAGS_DOUBLE_IEEE754 == (tsTypeFlag & GTSEncoder.FLAGS_DOUBLE_IEEE754)) { ByteOrder order=buffer.order(); buffer.order(ByteOrder.BIG_ENDIAN); previousLastDoubleValue=lastDoubleValue; lastDoubleValue=buffer.getDouble(); previousLastBDValue=lastBDValue; lastBDValue=null; buffer.order(order); } else { int scale=buffer.get(); long unscaled=Varint.decodeSignedLong(buffer); previousLastBDValue=lastBDValue; lastBDValue=new BigDecimal(new BigInteger(Long.toString(unscaled)),scale); } } break; case GTSEncoder.FLAGS_TYPE_STRING: lastType=TYPE.STRING; if (GTSEncoder.FLAGS_VALUE_IDENTICAL != (tsTypeFlag & GTSEncoder.FLAGS_VALUE_IDENTICAL)) { long len=Varint.decodeUnsignedLong(buffer); if (len > buffer.remaining()) { throw new RuntimeException("Invalid string length."); } byte[] utf8=new byte[(int)len]; buffer.get(utf8); previousLastStringValue=lastStringValue; lastStringValue=new String(utf8,Charsets.UTF_8); } break; case GTSEncoder.FLAGS_TYPE_BOOLEAN: if (GTSEncoder.FLAGS_DELETE_MARKER == (tsTypeFlag & GTSEncoder.FLAGS_MASK_TYPE_FLAGS)) { lastType=TYPE.UNDEFINED; } else { lastType=TYPE.BOOLEAN; if (GTSEncoder.FLAGS_BOOLEAN_VALUE_TRUE == (tsTypeFlag & GTSEncoder.FLAGS_MASK_TYPE_FLAGS)) { lastBooleanValue=true; } else if (GTSEncoder.FLAGS_BOOLEAN_VALUE_FALSE == (tsTypeFlag & GTSEncoder.FLAGS_MASK_TYPE_FLAGS)) { lastBooleanValue=false; } else { throw new RuntimeException("Invalid boolean value."); } } break; default : throw new RuntimeException("Invalid type encountered!"); } return true; }
Attempt to read the next measurement and associated metadata (timestamp, location, elevation)
protected void fireValueChanged(int firstIndex,int lastIndex){ fireValueChanged(firstIndex,lastIndex,getValueIsAdjusting()); }
Notify ListSelectionListeners that the value of the selection, in the closed interval firstIndex,lastIndex, has changed.
public static File selectPath(Iterable<? extends File> paths,String file){ file=absoluteFile(new File(file)).getPath(); int srcDirLength=0; File srcDirFile=null; for ( File prefixFile : paths) { String absPrefix=absoluteFile(prefixFile).getPath() + File.separatorChar; if (file.startsWith(absPrefix) && absPrefix.length() > srcDirLength) { srcDirLength=absPrefix.length(); srcDirFile=prefixFile; } } return srcDirFile; }
Given a path to a file and a list of "search paths" returns the search path that matched the path of the file
public LogisticRegression2(DataSet dataSet){ setRows(new int[dataSet.getNumRows()]); for (int i=0; i < getRows().length; i++) getRows()[i]=i; }
A mixed data set. The targets of regresson must be binary. Regressors must be continuous or binary. Other variables don't matter.
private void openContextMenu(MouseEvent e){ if (e.isPopupTrigger()) { User user=getUser(e); if (user != null) { UserContextMenu m=new UserContextMenu(user,contextMenuListener); m.show(this,e.getX(),e.getY()); } } }
Open context menu for this user, if the event points at one.
public boolean hasAttribute(String name){ return (node.getAttributes().getNamedItem(name) != null); }
Returns whether an attribute exists.
public void scheduleUpdate(double simTime){ scheduledUpdates.addUpdate(simTime); }
Schedules an update request to all nodes to happen at the specified simulation time.
public GeneratorEntry createGeneratorEntry(){ GeneratorEntryImpl generatorEntry=new GeneratorEntryImpl(); return generatorEntry; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void reset(){ if (text != null) { text.reset(); NormalizerBase.Mode mode=CollatorUtilities.toNormalizerMode(owner.getDecomposition()); text.setMode(mode); } buffer=null; expIndex=0; swapOrder=0; }
Resets the cursor to the beginning of the string. The next call to next() will return the first collation element in the string.
public Object remove(Object key){ key=convertKey(key); int hashCode=hash(key); int index=hashIndex(hashCode,data.length); HashEntry entry=data[index]; HashEntry previous=null; while (entry != null) { if (entry.hashCode == hashCode && isEqualKey(key,entry.key)) { Object oldValue=entry.getValue(); removeMapping(entry,index,previous); return oldValue; } previous=entry; entry=entry.next; } return null; }
Removes the specified mapping from this map.
private static int checkIdentifier(final String signature,int pos){ if (!Character.isJavaIdentifierStart(getChar(signature,pos))) { throw new IllegalArgumentException(signature + ": identifier expected at index " + pos); } ++pos; while (Character.isJavaIdentifierPart(getChar(signature,pos))) { ++pos; } return pos; }
Checks an identifier.
public void saveToXmlFile() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { FileOutputStream writeStream=new FileOutputStream(this._keyStoreFilePath); try { _keyStore.store(writeStream,this._keyStorePwd.toCharArray()); } finally { writeStream.close(); } }
Save the changed keystore to its keystore file.
@Override public void onCreate(){ super.onCreate(); if (BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build()); StrictMode.ThreadPolicy.Builder threadPolicyBuilder=new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { threadPolicyBuilder.penaltyDeathOnNetwork(); } StrictMode.setThreadPolicy(threadPolicyBuilder.build()); } }
Init timber and strict mode in debug mode.
@Override public boolean adjustEntry(MkMaxEntry entry,DBID routingObjectID,double parentDistance,AbstractMTree<O,MkMaxTreeNode<O>,MkMaxEntry,?> mTree){ super.adjustEntry(entry,routingObjectID,parentDistance,mTree); entry.setKnnDistance(kNNDistance()); return true; }
Calls the super method and adjust additionally the k-nearest neighbor distance of this node as the maximum of the k-nearest neighbor distances of all its entries.
public static List<ISetting<?>> createSettingListFromFields(final Class<?> settingCollectionClass){ final List<ISetting<?>> settingList=new ArrayList<>(); for ( final Field field : settingCollectionClass.getDeclaredFields()) { if (!ISetting.class.isAssignableFrom(field.getType())) continue; final ISetting<?> setting; try { setting=(ISetting<?>)field.get(settingCollectionClass); } catch ( final IllegalArgumentException|IllegalAccessException e) { LEnv.LOGGER.error("Failed to get setting field!",e); continue; } if (setting instanceof INodeSetting) continue; settingList.add(setting); } return settingList; }
Utility method which creates a list of settings from the fields of the specified class which stores a collection of settings as public static class fields.
@Override public boolean eIsSet(int featureID){ switch (featureID) { case N4JSPackage.TEMPLATE_SEGMENT__RAW_VALUE: return RAW_VALUE_EDEFAULT == null ? rawValue != null : !RAW_VALUE_EDEFAULT.equals(rawValue); } return super.eIsSet(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public String toString(){ try { Iterator keys=keys(); StringBuffer sb=new StringBuffer("{"); while (keys.hasNext()) { if (sb.length() > 1) { sb.append(','); } Object o=keys.next(); sb.append(quote(o.toString())); sb.append(':'); sb.append(valueToString(this.map.get(o))); } sb.append('}'); return sb.toString(); } catch ( Exception e) { return null; } }
Make a JSON text of this JSONObject. For compactness, no whitespace is added. If this would not result in a syntactically correct JSON text, then null will be returned instead. <p> Warning: This method assumes that the data structure is acyclical.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:47.290 -0500",hash_original_method="C25B69CBC1412EAEFB170FBF9B530EF5",hash_generated_method="AD0F03654918E48BE3984210F2815FEB") public SIPHeader parse() throws ParseException { if (debug) dbg_enter("ContentDispositionParser.parse"); try { headerName(TokenTypes.CONTENT_DISPOSITION); ContentDisposition cd=new ContentDisposition(); cd.setHeaderName(SIPHeaderNames.CONTENT_DISPOSITION); this.lexer.SPorHT(); this.lexer.match(TokenTypes.ID); Token token=lexer.getNextToken(); cd.setDispositionType(token.getTokenValue()); this.lexer.SPorHT(); super.parse(cd); this.lexer.SPorHT(); this.lexer.match('\n'); return cd; } catch ( ParseException ex) { throw createParseException(ex.getMessage()); } finally { if (debug) dbg_leave("ContentDispositionParser.parse"); } }
parse the ContentDispositionHeader String header
public boolean isValidName(){ String _name=this.getName(); boolean _equals=Objects.equal("prototype",_name); if (_equals) { return false; } return true; }
<!-- begin-user-doc --> <!-- end-user-doc -->
private void _writeInt(final int value) throws IOException { this.outStream.writeInt(value,this.byteOrder); }
Inside auxiliary method to write an integer value into the session stream without extra checking.
public HasParentQueryBuilder scoreMode(String scoreMode){ this.scoreMode=scoreMode; return this; }
Defines how the parent score is mapped into the child documents.
private void resetBlockletProcessingCount(){ blockletProcessingCount.set(0); }
This method will reset the block processing count
private void initializeTable(int capacity){ this.table=new Object[capacity * 2]; this.mask=table.length - 1; this.clean=0; this.maximumLoad=capacity * 2 / 3; }
Creates a new, empty table with the given capacity.
@OnMessage public void onMessage(final String message){ }
Called when a message received from the browser.
public final void printQuotedSymbol(CharSequence text) throws IOException { if (text == null) { appendAscii("null.symbol"); } else if (text.length() == 0) { throw new EmptySymbolException(); } else { appendAscii('\''); printCodePoints(text,SYMBOL_ESCAPE_CODES); appendAscii('\''); } }
Print single-quoted Ion Symbol type
@Override public String isValid(String newText){ int len=newText.length(); return null; }
Validates the String. Returns null for no error, or an error message
public final void print(char[] buffer) throws IOException { print(buffer,0,buffer.length); }
Prints the character buffer to the stream.
private void log(String message){ if (mDebug) { Log.d(TAG,message); } }
Log in LogCat when debug mode is enable.
public static BufferedInputStream newInputStream(URL url) throws MalformedURLException, IOException { return new BufferedInputStream(configuredInputStream(null,url)); }
Creates a buffered input stream for this URL.
public boolean render(InternalContextAdapter context,Writer writer,Node node) throws IOException, MethodInvocationException, ResourceNotFoundException, ParseErrorException { Object listObject=node.jjtGetChild(2).value(context); if (listObject == null) return false; Iterator i=null; try { i=rsvc.getUberspect().getIterator(listObject,uberInfo); } catch ( Exception ee) { System.out.println(ee); } if (i == null) { return false; } int counter=counterInitialValue; Object o=context.get(elementKey); Object ctr=context.get(counterName); while (i.hasNext()) { context.put(counterName,new Integer(counter)); context.put(elementKey,i.next()); node.jjtGetChild(3).render(context,writer); counter++; } if (ctr != null) { context.put(counterName,ctr); } else { context.remove(counterName); } if (o != null) { context.put(elementKey,o); } else { context.remove(elementKey); } return true; }
renders the #foreach() block
public void countTilesOfSegments(){ for ( String fileName : allFiles) { TiledMap map; TmxMapLoader mapLoader; mapLoader=new TmxMapLoader(); map=mapLoader.load(fileName); totalTiles+=map.getProperties().get("width",Integer.class); } }
TODO: rewrite this, it is slow!
public Presence(Type type,String status,int priority,Mode mode){ setType(type); setStatus(status); setPriority(priority); setMode(mode); }
Creates a new presence update with a specified status, priority, and mode.
public static DimensionConstrain createMaxDimensionNoOrientation(int length1,int length2){ return createMaxDimensionNoOrientation(length1,length2,false); }
Forces the image to keep radio and be keeped within the width and height. Width and height are defined (length1 x length2) or (length2 x length1). This is usefull is the scaling allow a certain format (such as 16x9") but allow the dimension to be rotated 90 degrees (so also 9x16" is allowed).
public int read(byte b[]) throws IOException { int nr=in.read(b); if (nr > 0) monitor.setProgress(nread+=nr); if (monitor.isCanceled()) { InterruptedIOException exc=new InterruptedIOException("progress"); exc.bytesTransferred=nread; throw exc; } return nr; }
Overrides <code>FilterInputStream.read</code> to update the progress monitor after the read.
@Ignore("Disabling due to bug #52347") @Test public void testConcurrentEventsOnEmptyRegion(){ versionTestConcurrentEventsOnEmptyRegion(); }
This tests the concurrency versioning system to ensure that event conflation happens correctly and that the statistic is being updated properly
public void executeReset(){ if (mDecoEventManager != null) { mDecoEventManager.resetEvents(); } if (mChartSeries != null) { for ( ChartSeries chartSeries : mChartSeries) { chartSeries.reset(); } } }
Reset all arcs back to the start positions and remove all queued events
public Capabilities(CapabilitiesHandler owner){ super(); setOwner(owner); m_Capabilities=new HashSet<Capability>(); m_Dependencies=new HashSet<Capability>(); if (doNotCheckCapabilities()) { return; } if (PROPERTIES == null) { try { PROPERTIES=Utils.readProperties(PROPERTIES_FILE); } catch ( Exception e) { e.printStackTrace(); PROPERTIES=new Properties(); } } m_Test=Boolean.parseBoolean(PROPERTIES.getProperty("Test","true")); m_InstancesTest=Boolean.parseBoolean(PROPERTIES.getProperty("InstancesTest","true")) && m_Test; m_AttributeTest=Boolean.parseBoolean(PROPERTIES.getProperty("AttributeTest","true")) && m_Test; m_MissingValuesTest=Boolean.parseBoolean(PROPERTIES.getProperty("MissingValuesTest","true")) && m_Test; m_MissingClassValuesTest=Boolean.parseBoolean(PROPERTIES.getProperty("MissingClassValuesTest","true")) && m_Test; m_MinimumNumberInstancesTest=Boolean.parseBoolean(PROPERTIES.getProperty("MinimumNumberInstancesTest","true")) && m_Test; if (owner instanceof weka.classifiers.UpdateableClassifier || owner instanceof weka.clusterers.UpdateableClusterer) { setMinimumNumberInstances(0); } }
initializes the capabilities for the given owner