code
stringlengths
10
174k
nl
stringlengths
3
129k
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 15:00:47.302 -0400",hash_original_method="3CFB904866B3259764C1179843D2440E",hash_generated_method="B0184391B61883391B71DEB8F787FC1E") private static boolean isDirectory(URL url){ String file=url.getFile(); return (file.length() > 0 && file.charAt(file.length() - 1) == '/'); }
Determines if the URL is pointing to a directory.
private String indent(int index){ if (indent > 0) { String text=cache.get(index); if (text == null) { text=create(); cache.set(index,text); } if (cache.size() > 0) { return text; } } return ""; }
This is used to acquire the indent at the specified index. If the indent does not exist at the specified index then on is created using the current value of the indent. The very first indent taken from this will be an empty string value.
private void generateMethodInfos(IType type,IBinaryType typeInfo,HashMap newElements,ArrayList childrenHandles,ArrayList typeParameterHandles){ IBinaryMethod[] methods=typeInfo.getMethods(); if (methods == null) { return; } for (int i=0, methodCount=methods.length; i < methodCount; i++) { IBinaryMethod methodInfo=methods[i]; final boolean isConstructor=methodInfo.isConstructor(); boolean isEnum=false; try { isEnum=type.isEnum(); } catch ( JavaModelException e) { } boolean useGenericSignature=true; char[] signature=methodInfo.getGenericSignature(); String[] pNames=null; if (signature == null) { useGenericSignature=false; signature=methodInfo.getMethodDescriptor(); if (isEnum && isConstructor) { pNames=Signature.getParameterTypes(new String(signature)); int length=pNames.length - 2; if (length >= 0) System.arraycopy(pNames,2,pNames=new String[length],0,length); } } String selector=new String(methodInfo.getSelector()); if (isConstructor) { selector=type.getElementName(); } try { if (!(isEnum && isConstructor && !useGenericSignature)) { pNames=Signature.getParameterTypes(new String(signature)); } if (isConstructor && useGenericSignature && type.isMember()&& !Flags.isStatic(type.getFlags())) { int length=pNames.length; System.arraycopy(pNames,0,(pNames=new String[length + 1]),1,length); char[] descriptor=methodInfo.getMethodDescriptor(); final String[] parameterTypes=Signature.getParameterTypes(new String(descriptor)); pNames[0]=parameterTypes[0]; } } catch ( IllegalArgumentException e) { signature=methodInfo.getMethodDescriptor(); pNames=Signature.getParameterTypes(new String(signature)); } catch ( JavaModelException e) { signature=methodInfo.getMethodDescriptor(); pNames=Signature.getParameterTypes(new String(signature)); } char[][] paramNames=new char[pNames.length][]; for (int j=0; j < pNames.length; j++) { paramNames[j]=pNames[j].toCharArray(); } char[][] parameterTypes=ClassFile.translatedNames(paramNames); JavaModelManager manager=((JavaElement)type).manager; selector=manager.intern(selector); for (int j=0; j < pNames.length; j++) { pNames[j]=manager.intern(new String(parameterTypes[j])); } BinaryMethod method=new BinaryMethod((JavaElement)type,manager,selector,pNames); childrenHandles.add(method); while (newElements.containsKey(method)) method.occurrenceCount++; newElements.put(method,methodInfo); int max=pNames.length; char[][] argumentNames=methodInfo.getArgumentNames(); if (argumentNames == null || argumentNames.length < max) { argumentNames=new char[max][]; for (int j=0; j < max; j++) { argumentNames[j]=("arg" + j).toCharArray(); } } int startIndex=0; try { if (isConstructor) { if (isEnum) { startIndex=2; } else if (type.isMember() && !Flags.isStatic(type.getFlags())) { startIndex=1; } } } catch ( JavaModelException e) { } generateTypeParameterInfos(method,signature,newElements,typeParameterHandles); generateAnnotationsInfos(method,methodInfo.getAnnotations(),methodInfo.getTagBits(),newElements); Object defaultValue=methodInfo.getDefaultValue(); if (defaultValue instanceof IBinaryAnnotation) { generateAnnotationInfo(method,newElements,(IBinaryAnnotation)defaultValue,new String(methodInfo.getSelector())); } } }
Creates the handles and infos for the methods of the given binary type. Adds new handles to the given vector.
public SmsDcs(byte dcs){ dcs_=dcs; }
Creates a specific DCS.
public boolean removeThread(Thread thread){ synchronized (this) { return this.participatingThreads.remove(thread); } }
Returns true if the thread was removed from participating threads.
public boolean completeWrite(){ int digest=(int)_crc.getValue(); byte[] headerBuffer=_headerBuffer; BitsUtil.writeInt16(headerBuffer,0,0); BitsUtil.writeInt(headerBuffer,2,digest); writeImpl(headerBuffer,0,6); return true; }
Completes a journal entry started by a write() call.
@Override public void onUpdate(final ItemStack stack,final World worldIn,final Entity entity,final int itemSlot,final boolean isSelected){ if (!worldIn.isRemote && entity instanceof EntityLivingBase && hasReplacedArmour(stack)) { final EntityInventoryType successfulInventoryType=InventoryUtils.forEachEntityInventory(entity,null,EntityInventoryType.MAIN,EntityInventoryType.HAND); if (successfulInventoryType != null) { Logger.info("Restored saved armour for slot %d of %s's %s inventory",itemSlot,entity.getName(),successfulInventoryType); } } }
Called every tick while the item is in a player's inventory (including while worn).
public static void writeConfigFile(String fileName) throws SQLException, IOException { List<Class<?>> classList=new ArrayList<Class<?>>(); findAnnotatedClasses(classList,new File("."),0); writeConfigFile(fileName,classList.toArray(new Class[classList.size()])); }
Finds the annotated classes in the current directory or below and writes a configuration file to the file-name in the raw folder.
public String toStringCR(){ StringBuffer retStr=new StringBuffer(); if (isAddressLinesReverse()) { retStr.append(parseCRP(getCountry())); if (getAddress4() != null && getAddress4().length() > 0) retStr.append("\n").append(getAddress4()); if (getAddress3() != null && getAddress3().length() > 0) retStr.append("\n").append(getAddress3()); if (getAddress2() != null && getAddress2().length() > 0) retStr.append("\n").append(getAddress2()); if (getAddress1() != null) retStr.append("\n").append(getAddress1()); } else { if (getAddress1() != null) retStr.append(getAddress1()); if (getAddress2() != null && getAddress2().length() > 0) retStr.append("\n").append(getAddress2()); if (getAddress3() != null && getAddress3().length() > 0) retStr.append("\n").append(getAddress3()); if (getAddress4() != null && getAddress4().length() > 0) retStr.append("\n").append(getAddress4()); retStr.append("\n").append(parseCRP(getCountry())); } return retStr.toString(); }
Return String representation with CR at line end
public void execute(T context){ if (context == null) { throw new IllegalArgumentException("context is null"); } activityRef=new WeakReference<>(context); permissiveHandler.enqueueAction(this); }
Executes this Action with a given context. <p>Keep in mind, that if the context disappears (for example when an Activity is finished), then the Action will not be executed.</p>
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 static int[] sort(double[] array){ int[] index=initialIndex(array.length); if (array.length > 1) { array=array.clone(); replaceMissingWithMAX_VALUE(array); quickSort(array,index,0,array.length - 1); } return index; }
Sorts a given array of doubles in ascending order and returns an array of integers with the positions of the elements of the original array in the sorted array. NOTE THESE CHANGES: the sort is no longer stable and it doesn't use safe floating-point comparisons anymore. Occurrences of Double.NaN are treated as Double.MAX_VALUE.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:30:47.389 -0500",hash_original_method="B22A6A9FCAC23A7432F783A7943584BE",hash_generated_method="1C3883CD016118ED827CE462FA5E440B") public static void remove(Activity activity){ FragmentManager manager=activity.getFragmentManager(); Fragment fragment=manager.findFragmentByTag(FRAGMENT_TAG); if (fragment != null) { manager.beginTransaction().remove(fragment).commitAllowingStateLoss(); } }
Remove NfcFragment from activity.
@Override protected void doPost(SlingHttpServletRequest request,SlingHttpServletResponse response) throws ServletException, IOException { ResourceResolver resolver=request.getResourceResolver(); Session session=resolver.adaptTo(Session.class); final String title=request.getParameter("title"); final String description=request.getParameter("description"); final String content=request.getParameter("content"); final String url=request.getParameter("url"); final boolean visible=Boolean.parseBoolean(request.getParameter("visible")); final String[] keywords=request.getParameterValues("keywords"); final long month=Long.parseLong(request.getParameter("month")); final long year=Long.parseLong(request.getParameter("year")); final String path=String.format(BLOG_PATH,year,month); final String blogPath=PublickConstants.BLOG_PATH + path + "/"+ url; String image=fileUploadService.uploadFile(request,PublickConstants.IMAGE_PATH); Resource existingNode=resolver.getResource(blogPath); if (image == null && existingNode != null) { image=existingNode.adaptTo(ValueMap.class).get("image",String.class); } Map<String,Object> properties=new HashMap<String,Object>(); properties.put(JcrConstants.JCR_PRIMARYTYPE,PublickConstants.NODE_TYPE_PAGE); properties.put(JcrResourceConstants.SLING_RESOURCE_TYPE_PROPERTY,PublickConstants.PAGE_TYPE_BLOG); properties.put("title",title); properties.put("visible",visible); properties.put("content",content); properties.put("description",description); properties.put("month",month); properties.put("year",year); if (image != null) { properties.put("image",image); } if (keywords != null) { properties.put("keywords",keywords); } try { UserManager userManager=((JackrabbitSession)session).getUserManager(); Authorizable auth=userManager.getAuthorizable(session.getUserID()); properties.put("author",auth.getID()); } catch ( RepositoryException e) { LOGGER.error("Could not get user.",e); } try { if (existingNode != null) { ModifiableValueMap existingProperties=existingNode.adaptTo(ModifiableValueMap.class); existingProperties.putAll(properties); } else { Node node=JcrResourceUtil.createPath(resolver.getResource(PublickConstants.CONTENT_PATH).adaptTo(Node.class),BLOG_ROOT + path,NodeType.NT_UNSTRUCTURED,NodeType.NT_UNSTRUCTURED,true); Resource blog=resolver.create(resolver.getResource(node.getPath()),url,properties); Node blogNode=blog.adaptTo(Node.class); blogNode.addMixin(NodeType.MIX_CREATED); } resolver.commit(); resolver.close(); response.sendRedirect(PublickConstants.ADMIN_LIST_PATH + ".html"); } catch ( RepositoryException e) { LOGGER.error("Could not save blog to repository.",e); response.sendRedirect(request.getHeader("referer")); } catch ( PersistenceException e) { LOGGER.error("Could not save blog to repository.",e); response.sendRedirect(request.getHeader("referer")); } finally { if (resolver != null && resolver.isLive()) { resolver.close(); resolver=null; } } }
Create and save blog resource. Creates blog path and saves properties. If blog resource already exists, the resource is updated with new properties. Saves file to the assets folder using the FileUploadService.
public void createSubUsageScenario07() throws Exception { long usageStartTime=DateTimeHandling.calculateMillis("2012-12-01 00:00:00") - DateTimeHandling.daysToMillis(15); BillingIntegrationTestBase.setDateFactoryInstance(usageStartTime); VOServiceDetails serviceDetails=serviceSetup.createPublishAndActivateMarketableService(basicSetup.getSupplierAdminKey(),"SCENARIO07_PERUNIT_MONTH",TestService.EXAMPLE,TestPriceModel.EXAMPLE_PERUNIT_MONTH_ROLES,technicalService,supplierMarketplace); setCutOffDay(basicSetup.getSupplierAdminKey(),1); VORoleDefinition role=VOServiceFactory.getRole(serviceDetails,"ADMIN"); container.login(basicSetup.getCustomerAdminKey(),ROLE_ORGANIZATION_ADMIN); VOSubscriptionDetails subDetails=subscrSetup.subscribeToService("SCENARIO07_PERUNIT_MONTH",serviceDetails,basicSetup.getCustomerUser2(),role); long usageModificationTime=DateTimeHandling.calculateMillis("2012-12-01 00:00:00") - DateTimeHandling.daysToMillis(9); subDetails=subscrSetup.modifyParameterForSubscription(subDetails,usageModificationTime,"MAX_FOLDER_NUMBER","13"); usageModificationTime=DateTimeHandling.calculateMillis("2012-12-01 00:00:00") + DateTimeHandling.daysToMillis(3); subDetails=subscrSetup.modifyParameterForSubscription(subDetails,usageModificationTime,"MAX_FOLDER_NUMBER","23"); usageModificationTime=DateTimeHandling.calculateMillis("2012-12-01 00:00:00") + DateTimeHandling.daysToMillis(5); subDetails=subscrSetup.modifyParameterForSubscription(subDetails,usageModificationTime,"MAX_FOLDER_NUMBER","33"); long usageEndTime=DateTimeHandling.calculateMillis("2013-01-01 00:00:00") - DateTimeHandling.daysToMillis(3); BillingIntegrationTestBase.setDateFactoryInstance(usageEndTime); subscrSetup.terminateSubscription(basicSetup.getSupplierAdminKey(),subDetails,""); resetCutOffDay(basicSetup.getSupplierAdminKey()); BillingIntegrationTestBase.updateSubscriptionListForTests("SCENARIO07_PERUNIT_MONTH",subDetails); }
Creates and terminates the subscription test data for the usage scenario 7. </br> The subscription is started before the billing period start time and is terminated before the billing period end time. The billing period is as follows: <ul> <li>billing period start: 1354316400000 Sat Dec 01 2012 00:00:00 GMT+1 <li>billing period end: 1356994800000 Tue Jan 01 2013 00:00:00 GMT+1 <li>termination: 1356208560000 Sat Dec 22 2012 21:36:00 GMT+1 </ul> The subscription is based on the following <b>price model</b>: <ul> <li>one time fee: 25.00, not billed <li>price per period: 85.00 <li>price per user assignment: 150.00 <li>BOOLEAN_PARAMETER parameter, price per subscription: 3.00 <li>BOOLEAN_PARAMETER parameter, price per user: 30.00 <li>MAX_FOLDER_NUMBER, price per subscription: 2.00 <li>MAX_FOLDER_NUMBER, price per user: 20.00 </ul> Stepped prices are not used!</br></br> Furthermore, the subscription is based on the following <b>technical service</b>:</br> PARAMETERS: <ul> <li>MAX_FILE_NUMBER (integer), not configurable by user <li>FOLDER_NEW (integer), not configurable by user <li>STRING_PARAMETER (string), not configurable by user <li>HAS_OPTIONS (enumeration), configurable by user <li>MAX_FOLDER_NUMBER (integer), configurable by user <li>BOOLEAN_PARAMETER (boolean), configurable by user </ul> </br>EVENTS: <ul> <li>FILE_DOWNLOAD, not used <li>FILE_UPLOAD, not used <li>FOLDER_NEW, not used </ul> </br>ROLES: <ul> <li>ADMIN <li>USER <li>GUEST </ul> </br> </br> <b>Subscription Changes:</b> </br>User assignments: <ul> <li>one user assignment for the whole period (GreenPeaceSecondCustomerUser2) </ul> </br> Parameter changes: <ul> <li>BOOLEAN_PARAMETER: same value for the whole period <li>HAS_OPTIONS: same option for the whole period <li>MAX_FOLDER_NUMBER: 3 relevant value changes for the period </ul>
public Duration withMillis(long duration){ if (duration == getMillis()) { return this; } return new Duration(duration); }
Creates a new Duration instance with a different milisecond length.
@Deprecated public AsyncNoteStoreClient createNoteStoreClient() throws TTransportException { if (EvernoteSession.getInstance() == null || EvernoteSession.getInstance().getAuthenticationResult() == null) { throw new IllegalStateException(); } TEvernoteHttpClient transport=new TEvernoteHttpClient(EvernoteSession.getInstance().getAuthenticationResult().getNoteStoreUrl(),mUserAgent,mTempDir); TBinaryProtocol protocol=new TBinaryProtocol(transport); return new AsyncNoteStoreClient(protocol,protocol,EvernoteSession.getInstance().getAuthenticationResult().getAuthToken()); }
Create a new NoteStore client. Each call to this method will return a new NoteStore.Client instance. The returned client can be used for any number of API calls, but is NOT thread safe.
public synchronized void removeSeries(int index){ mSeries.remove(index); }
Removes the XY series from the list.
public void disableUsbMassStorage(){ try { mMountService.setUsbMassStorageEnabled(false); } catch ( Exception ex) { Log.e(TAG,"Failed to disable UMS",ex); } }
Disables USB Mass Storage (UMS) on the device.
public BatchSentenceResource(Session s,String resscript){ super(s); m_sResScript=resscript; }
Creates a new instance of BatchSentenceResource
protected final void toString(StringBuffer buf,boolean unseen){ if (this.getVisited() == unseen) { this.flipVisited(); buf.append("(" + this.stateFP + ","+ this.getIndex()+ ") --> "); int size=this.nextSize(); if (size != 0) { BTGraphNode node=(BTGraphNode)this.nextAt(0); buf.append("(" + node.stateFP + ","+ node.getIndex()+ ")"); } for (int i=1; i < size; i++) { buf.append(", "); BTGraphNode node=(BTGraphNode)this.nextAt(i); buf.append("(" + node.stateFP + ","+ node.getIndex()+ ")"); } buf.append("\n"); for (int i=0; i < size; i++) { this.nextAt(i).toString(buf,unseen); } } }
This method assumes that the visited field of all the nodes is set to the same value. It flips the visited field. We use the high-order bit of this.number as the visited bit.
public boolean areRomFilesAvailable(Set<File> romPaths){ return this.getMissingRomFiles(romPaths).size() == 0; }
Determines whether the required rom files for this system are present on the given rompaths
public void put(CharSequence key,Object value){ getOrCreateNode(key).data=value; }
Stores a value in the trie. The value may be retrieved using the key.
public InvalidDeltaException(){ }
Creates a new <code>InvalidDeltaException</code>.
private boolean handShake(ChannelHandlerContext ctx,Object msg){ ByteBuf buf=((ByteBuf)msg); if (buf.readableBytes() < 2) { buf.release(); return false; } byte v=buf.readByte(); if (v != 5) { buf.release(); return false; } byte nmethod=buf.readByte(); byte[] methods=new byte[nmethod]; buf.readBytes(methods); buf.release(); ByteBuf responose=ctx.alloc().buffer(2); responose.writeByte(5); responose.writeByte(0); ctx.writeAndFlush(responose); return true; }
Request +----+----------+----------+ |VER | NMETHODS | METHODS | +----+----------+----------+ | 1 | 1 | 1 to 255 | +----+----------+----------+ Resonpse +----+--------+ |VER | METHOD | +----+--------+ | 1 | 1 | +----+--------+
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-02-25 10:38:08.467 -0500",hash_original_method="11B1E697782FA8E30A6D0D1E236AB9C8",hash_generated_method="660D7457B8BE490BE462C73899E90B4C") public void addHeaderField(String name,String val){ header.append(name); header.append(": "); header.append(val); header.append('\n'); }
Adds an arbitrary header key and value to this message's header.
public static String md5Hash(byte[] data,int length) throws NoSuchAlgorithmException { MessageDigest messageDigest=MessageDigest.getInstance("MD5"); messageDigest.update(data,0,length); return BaseEncoding.base64().encode(messageDigest.digest()); }
Returns MD5 hash of given byte array and it's length.
public static Byte[][] toByteArray(final byte[][] array){ if (array == null) { return null; } final Byte[][] byteArray=new Byte[array.length][]; for (int i=0; i < array.length; i++) { byteArray[i]=new Byte[array[i].length]; for (int j=0; j < array[i].length; j++) { byteArray[i][j]=array[i][j]; } } return byteArray; }
Converts a double byte array into a double Byte array.
protected void writePrimaryKeyStmt(Table table,Column[] primaryKeyColumns,StringBuilder ddl){ ddl.append("PRIMARY KEY ("); for (int idx=0; idx < primaryKeyColumns.length; idx++) { printIdentifier(getColumnName(primaryKeyColumns[idx]),ddl); if (idx < primaryKeyColumns.length - 1) { ddl.append(", "); } } ddl.append(")"); }
Writes a primary key statement for the given columns.
private static void appendDefaultValueIfSet(Document htmldoc,Parameter<?> par,Element optdd){ if (par.hasDefaultValue()) { Element p=htmldoc.createElement(HTMLUtil.HTML_P_TAG); p.appendChild(htmldoc.createTextNode(HEADER_DEFAULT_VALUE)); if (par instanceof ClassParameter<?>) { appendDefaultClassLink(htmldoc,par,p); } else if (par instanceof RandomParameter && par.getDefaultValue() == RandomFactory.DEFAULT) { p.appendChild(htmldoc.createTextNode("use global random seed")); } else { p.appendChild(htmldoc.createTextNode(par.getDefaultValueAsString())); } optdd.appendChild(p); } }
Append string containing the default value.
@Override public TagAttachObject copy(){ return new TagAttachObject(this); }
This method was generated by MyBatis Generator. This method corresponds to the database table tag_attach
public boolean drawShadows(){ return drawShadows; }
Determine whether shadows are drawn
public static CCPropertyAction action(float aDuration,String key,float from,float to){ return new CCPropertyAction(aDuration,key,from,to); }
creates an initializes the action with the property name (key), and the from and to parameters.
public void testDurableTopicRecoverMarksMessageRedelivered() throws JMSException { connection.setClientID(getName()); connection.start(); Session session=connection.createSession(false,Session.CLIENT_ACKNOWLEDGE); Topic topic=session.createTopic("topic-" + getName()); MessageConsumer consumer=session.createDurableSubscriber(topic,"sub1"); MessageProducer producer=createProducer(session,topic); producer.send(createTextMessage(session)); Message msg=consumer.receive(1000); assertNotNull(msg); assertFalse("Message should not be redelivered.",msg.getJMSRedelivered()); session.recover(); msg=consumer.receive(2000); assertNotNull(msg); assertTrue("Message should be redelivered.",msg.getJMSRedelivered()); msg.acknowledge(); session.close(); }
Tests session recovery and that the redelivered message is marked as such. Session uses client acknowledgement, the destination is a topic and the consumer is a durable suscriber.
@Override public int hashCode(){ long val=value.toLongZeroExtend(); int high=(int)(val >>> 32); int low=(int)(val & 0xFFFFFFFFL); return high ^ (low >>> 2); }
Object hashCode
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:28:02.246 -0500",hash_original_method="7FDDE82DCC606FA9E5D06171C4D7A283",hash_generated_method="2DCD092639F2BFD0DFB3E894AE55E7E2") public static boolean onTouchEvent(TextView widget,Spannable buffer,MotionEvent event){ DragState[] ds; switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: ds=buffer.getSpans(0,buffer.length(),DragState.class); for (int i=0; i < ds.length; i++) { buffer.removeSpan(ds[i]); } buffer.setSpan(new DragState(event.getX(),event.getY(),widget.getScrollX(),widget.getScrollY()),0,0,Spannable.SPAN_MARK_MARK); return true; case MotionEvent.ACTION_UP: ds=buffer.getSpans(0,buffer.length(),DragState.class); for (int i=0; i < ds.length; i++) { buffer.removeSpan(ds[i]); } if (ds.length > 0 && ds[0].mUsed) { return true; } else { return false; } case MotionEvent.ACTION_MOVE: ds=buffer.getSpans(0,buffer.length(),DragState.class); if (ds.length > 0) { if (ds[0].mFarEnough == false) { int slop=ViewConfiguration.get(widget.getContext()).getScaledTouchSlop(); if (Math.abs(event.getX() - ds[0].mX) >= slop || Math.abs(event.getY() - ds[0].mY) >= slop) { ds[0].mFarEnough=true; } } if (ds[0].mFarEnough) { ds[0].mUsed=true; boolean cap=(event.getMetaState() & KeyEvent.META_SHIFT_ON) != 0 || MetaKeyKeyListener.getMetaState(buffer,MetaKeyKeyListener.META_SHIFT_ON) == 1 || MetaKeyKeyListener.getMetaState(buffer,MetaKeyKeyListener.META_SELECTING) != 0; float dx; float dy; if (cap) { dx=event.getX() - ds[0].mX; dy=event.getY() - ds[0].mY; } else { dx=ds[0].mX - event.getX(); dy=ds[0].mY - event.getY(); } ds[0].mX=event.getX(); ds[0].mY=event.getY(); int nx=widget.getScrollX() + (int)dx; int ny=widget.getScrollY() + (int)dy; int padding=widget.getTotalPaddingTop() + widget.getTotalPaddingBottom(); Layout layout=widget.getLayout(); ny=Math.min(ny,layout.getHeight() - (widget.getHeight() - padding)); ny=Math.max(ny,0); int oldX=widget.getScrollX(); int oldY=widget.getScrollY(); scrollTo(widget,layout,nx,ny); if (oldX != widget.getScrollX() || oldY != widget.getScrollY()) { widget.cancelLongPress(); } return true; } } } return false; }
Handles touch events for dragging. You may want to do other actions like moving the cursor on touch as well.
private void createFilesForOldBackupFormat(BackupConfig spyBackupConfig) throws IOException { doReturn(Paths.get(TMP_CODENVY)).when(spyBackupConfig).obtainArtifactTempDirectory(); Files.createDirectory(Paths.get(TMP_CODENVY).resolve(BackupConfig.Component.FS.getRelativeBackupPath())); Files.createDirectory(Paths.get(TMP_CODENVY).resolve(BackupConfig.Component.MONGO.getRelativeBackupPath())); FileUtils.write(Paths.get(TMP_CODENVY).resolve(BackupConfig.Component.LDAP.getRelativeBackupPath()).toFile(),""); FileUtils.write(Paths.get(TMP_CODENVY).resolve(BackupConfig.Component.LDAP_ADMIN.getRelativeBackupPath()).toFile(),""); }
Create files for backup format of Codenvy on-prem 3.x and 4.x prior to 5.0.0-M3.
public long runtime(TimeUnit unit){ return unit.convert(getNanos(),TimeUnit.NANOSECONDS); }
Gets the runtime for the test.
public String randomNumeric(int length){ return randomString(JexlStringFunctions.numeric,length); }
Get a random string of numerals
public Object remove(int key){ Entry[] table=this.table; int bucket=Math.abs(key) % table.length; for (Entry e=table[bucket], prev=null; e != null; prev=e, e=e.next) { if (key == e.key) { if (prev != null) prev.next=e.next; else table[bucket]=e.next; count--; Object oldValue=e.value; e.value=null; return oldValue; } } return null; }
Removes the mapping for the given key. Returns the object to which the key was mapped, or <code>null</code> otherwise.
public double secondsSinceLast(){ return (timeSinceLast()) / 1000.0; }
Returns the number of seconds since the last time timerString was called
public static void clear(EntityPlayer player){ NotificationCoord at=new NotificationCoord(player.worldObj,new BlockPos(player)); NotifyImplementation.instance.doSend(player,at,player.worldObj,EnumSet.of(Style.CLEAR),null,"",emptyStringArray); }
Erases all Notifications a player has.
private JPanel createSearchButtonPanel(){ JPanel b=new JPanel(new GridBagLayout()); GridBagConstraints c=new GridBagConstraints(); c.anchor=GridBagConstraints.LINE_START; c.fill=GridBagConstraints.NONE; c.gridx=0; c.gridy=0; c.insets=new Insets(0,10,10,0); JPanel filterLabelIconPanel=new JPanel(new GridBagLayout()); c=new GridBagConstraints(); c.gridx=0; c.gridy=0; c.anchor=GridBagConstraints.WEST; c.fill=GridBagConstraints.NONE; c.insets=new Insets(0,10,0,0); c=new GridBagConstraints(); c.gridx=1; c.gridy=0; c.fill=GridBagConstraints.HORIZONTAL; c.anchor=GridBagConstraints.WEST; c.weightx=1.0; c.insets=new Insets(0,3,0,0); c=new GridBagConstraints(); c.anchor=GridBagConstraints.WEST; c.fill=GridBagConstraints.NONE; c.gridy=0; c.gridy=1; c.weightx=1.0; c.insets=new Insets(10,0,10,0); b.add(filterLabelIconPanel,c); return b; }
Creates the search button & inserts it in a panel.
public String toString(){ if (maps == null) return ""; String s=super.toString() + "PolicyMappings [\n" + maps.toString()+ "]\n"; return (s); }
Returns a printable representation of the policy map.
public CallSpec<Void,HttpError> sendContactRequest(String userId){ return Resource.<Void,HttpError>newPostSpec(api,"/v1/users/{user_id}/contact_requests",false).pathParam("user_id",userId).responseAs(Void.class).build(); }
Initiate a contact request. Initiates a contact request between the current user (sender) and the specified user (recipient). <table> <h4>Possible OPTIONAL parameters</h4> <tr> <th>Paramter Name</th> <th><b>Description</b></th> </tr> <tr> <td><b>message</b></td> <td>Message attached to the contact request</td> </tr> </table>
private <T>void assertCompressedToUncompressedImage(String fileName,String unCompfileName,Class<T> clazz,IHDUAsserter<T> reader) throws Exception { Fits f=null; try { f=new Fits(fileName); Fits unFits=new Fits(unCompfileName); ImageHDU hdu=readHDU(unFits,ImageHDU.class); unFits.deleteHDU(0); CompressedImageHDU uncompHdu=readHDU(f,CompressedImageHDU.class); f.deleteHDU(0); while (hdu != null && uncompHdu != null) { T compressedData=(T)uncompHdu.asImageHDU().getData().getData(); T orgData=(T)hdu.getData().getData(); System.out.println("Asserting image data! " + (assertionCounter++)); reader.assertData(orgData,compressedData); hdu=readHDU(unFits,ImageHDU.class); if (hdu != null) { unFits.deleteHDU(0); } uncompHdu=readHDU(f,CompressedImageHDU.class); if (uncompHdu != null) { f.deleteHDU(0); } } Assert.assertFalse(hdu != null || uncompHdu != null); } finally { SafeClose.close(f); } }
Assert two files files (one compressed and one uncompressed and use as few memory as possible.
public InfoBDocumentoVitalExtVO validarDocumentoVital(InfoBDocumentoVitalExtVO documentoVital){ checkPermission(DocumentosVitalesSecurityManager.EDICION_DOCUMENTOS_VITALES_ACTION); if ((documentoVital != null) && (documentoVital.getEstadoDocVit() == EstadoDocumentoVital.PENDIENTE_VALIDACION)) { iniciarTransaccion(); documentoVitalDBEntity.pasaAHistoricoDocsVigentes(documentoVital.getIdBdTerceros()); documentoVital.setEstadoDocVit(EstadoDocumentoVital.VIGENTE); documentoVital.setIdUsuarioVig(getServiceClient().getId()); documentoVital.setFechaVig(new Date()); documentoVitalDBEntity.updateDocumentoVital(documentoVital); Locale locale=getServiceClient().getLocale(); AuditoriaDocumentosVitales.auditaValidacionDocumentoVital(locale,this,documentoVital); commit(); } return documentoVital; }
Valida un documento vital.
@Override public boolean isActive(){ return amIActive; }
Used by the Whitebox GUI to tell if this plugin is still running.
public void publish(Record record,Handler<AsyncResult<Record>> resultHandler){ delegate.publish(record,resultHandler); }
Publishes a record.
public static boolean validSystemNameFormat(String systemName,char type,String prefix){ if (!(systemName.startsWith(prefix)) || (systemName.charAt(prefix.length()) != type)) { log.error("illegal character in header field of system name: " + systemName); return (false); } int num; try { num=Integer.valueOf(systemName.substring(prefix.length() + 1)).intValue(); } catch ( Exception e) { log.error("illegal character in number field of system name: " + systemName); return (false); } if (num >= 0) { } else { log.error("invalid Acela system name: " + systemName); return (false); } return true; }
Public static method to validate system name format returns 'true' if system name has a valid format, else returns 'false'
@Override public boolean equals(Object obj){ if (obj == this) { return true; } if (!(obj instanceof CategoryDataset)) { return false; } CategoryDataset that=(CategoryDataset)obj; if (!getRowKeys().equals(that.getRowKeys())) { return false; } if (!getColumnKeys().equals(that.getColumnKeys())) { return false; } int rowCount=getRowCount(); int colCount=getColumnCount(); for (int r=0; r < rowCount; r++) { for (int c=0; c < colCount; c++) { Number v1=getValue(r,c); Number v2=that.getValue(r,c); if (v1 == null) { if (v2 != null) { return false; } } else if (!v1.equals(v2)) { return false; } } } return true; }
Tests this dataset for equality with an arbitrary object.
public Matrix fitScreen(){ mMinScaleX=1f; mMinScaleY=1f; Matrix save=new Matrix(); save.set(mMatrixTouch); float[] vals=new float[9]; save.getValues(vals); vals[Matrix.MTRANS_X]=0f; vals[Matrix.MTRANS_Y]=0f; vals[Matrix.MSCALE_X]=1f; vals[Matrix.MSCALE_Y]=1f; save.setValues(vals); return save; }
Resets all zooming and dragging and makes the chart fit exactly it's bounds.
public Map<String,List<String>> parameters(){ if (params == null) { if (hasPath) { int pathLength=path().length(); if (uri.length() == pathLength) { return Collections.emptyMap(); } decodeParams(uri.substring(pathLength + 1)); } else { if (uri.isEmpty()) { return Collections.emptyMap(); } decodeParams(uri); } } return params; }
Returns the decoded key-value parameter pairs of the URI.
private void showMessageDialog(String title,String message){ dialogFactory.createMessageDialog(title,message,null).show(); }
Displays dialog using title and message.
public void parse(){ try { SAXParser parser=SAXParserFactory.newInstance().newSAXParser(); parser.parse(xml.getAbsolutePath(),this); } catch ( Exception ex) { DelphiUtils.LOG.error(ex.getMessage()); } }
Parse provided .groupproj XML file
protected POInfo initPO(Properties ctx){ POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName()); return poi; }
Load Meta Data
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:36:29.557 -0500",hash_original_method="9EAE3F24E2C650B2D541A86A9F9A7795",hash_generated_method="28DA8E137822FE176B67AF43B0F4F4B9") public boolean isInCall(){ try { return mSession.isInCall(); } catch ( RemoteException e) { Log.e(TAG,"isInCall(): " + e); return false; } }
Checks if the session is in a call.
@Override void decode(final byte[] in,int inPos,final int inAvail,final Context context){ if (context.eof) { return; } if (inAvail < 0) { context.eof=true; } for (int i=0; i < inAvail; i++) { final byte[] buffer=ensureBufferSize(decodeSize,context); final byte b=in[inPos++]; if (b == pad) { context.eof=true; break; } else { if (b >= 0 && b < DECODE_TABLE.length) { final int result=DECODE_TABLE[b]; if (result >= 0) { context.modulus=(context.modulus + 1) % BYTES_PER_ENCODED_BLOCK; context.ibitWorkArea=(context.ibitWorkArea << BITS_PER_ENCODED_BYTE) + result; if (context.modulus == 0) { buffer[context.pos++]=(byte)((context.ibitWorkArea >> 16) & MASK_8BITS); buffer[context.pos++]=(byte)((context.ibitWorkArea >> 8) & MASK_8BITS); buffer[context.pos++]=(byte)(context.ibitWorkArea & MASK_8BITS); } } } } } if (context.eof && context.modulus != 0) { final byte[] buffer=ensureBufferSize(decodeSize,context); switch (context.modulus) { case 1: break; case 2: context.ibitWorkArea=context.ibitWorkArea >> 4; buffer[context.pos++]=(byte)((context.ibitWorkArea) & MASK_8BITS); break; case 3: context.ibitWorkArea=context.ibitWorkArea >> 2; buffer[context.pos++]=(byte)((context.ibitWorkArea >> 8) & MASK_8BITS); buffer[context.pos++]=(byte)((context.ibitWorkArea) & MASK_8BITS); break; default : throw new IllegalStateException("Impossible modulus " + context.modulus); } } }
<p> Decodes all of the provided data, starting at inPos, for inAvail bytes. Should be called at least twice: once with the data to decode, and once with inAvail set to "-1" to alert decoder that EOF has been reached. The "-1" call is not necessary when decoding, but it doesn't hurt, either. </p> <p> Ignores all non-base64 characters. This is how chunked (e.g. 76 character) data is handled, since CR and LF are silently ignored, but has implications for other bytes, too. This method subscribes to the garbage-in, garbage-out philosophy: it will not check the provided data for validity. </p> <p> Thanks to "commons" project in ws.apache.org for the bitwise operations, and general approach. http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/ </p>
private void printProgress(long row,long rowFrom,long rowTill){ long rowsProcessed=row + chunkSize - rowFrom; if (rowsProcessed > (rowTill - rowFrom)) rowsProcessed=(rowTill - rowFrom); print(String.format("%d%%",(int)(((double)(rowsProcessed) / (double)(rowTill - rowFrom)) * 100.0f))); }
Render (print) progress bar.
@Override protected EClass eStaticClass(){ return N4JSPackage.Literals.N4_METHOD_DECLARATION; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void addAll(List<Offer> offers){ this.offers=offers; notifyBinderDataSetChanged(); }
Add all accepted offers for data/talk/text to the binder dataset
public static final void sort(double[] a,int[] b,int begin,int end){ mergesort(a,b,begin,end - 1); }
Sort two arrays simultaneously, using the sort order of the values in the first array to determine the sort order for both arrays.
public String toString(){ return Utils.arrayToString(m_Keys); }
Returns the keys as string.
public void addAll(int... values){ for ( int value : values) { add(value); } }
Adds the given values to the dataset.
protected synchronized void completedClassifier(int iteration,boolean success){ if (!success) { m_failed++; if (m_Debug) { System.err.println("Iteration " + iteration + " failed!"); } } else { m_completed++; } if (m_completed + m_failed == m_Classifiers.length) { if (m_failed > 0) { if (m_Debug) { System.err.println("Problem building classifiers - some iterations failed."); } } m_executorPool.shutdown(); block(false); } }
Records the completion of the training of a single classifier. Unblocks if all classifiers have been trained.
public void zoomIn(){ if (canZoomIn()) { zoomLevel++; updatePaths(); invalidate(); } }
Zooms in one level.
public static Integer createServerCache() throws Exception { Bug37210DUnitTest test=new Bug37210DUnitTest(); Properties props=new Properties(); cache=test.createCache(props); AttributesFactory factory=new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setDataPolicy(DataPolicy.REPLICATE); RegionAttributes attrs=factory.create(); cache.createRegion(REGION_NAME,attrs); CacheServer server=cache.addCacheServer(); int port=AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET); server.setPort(port); server.setNotifyBySubscription(false); server.setSocketBufferSize(32768); server.setMaximumTimeBetweenPings(1000000); server.start(); LogWriterUtils.getLogWriter().info("Server started at PORT = " + port); return new Integer(server.getPort()); }
Creates and starts the cache-server
public static String bin2str(final byte[] values,final JBBPBitOrder bitOrder,final boolean separateBytes){ if (values == null) { return null; } final StringBuilder result=new StringBuilder(values.length * (separateBytes ? 9 : 8)); boolean nofirst=false; for ( final byte b : values) { if (separateBytes) { if (nofirst) { result.append(' '); } else { nofirst=true; } } int a=b; if (bitOrder == JBBPBitOrder.MSB0) { for (int i=0; i < 8; i++) { result.append((a & 0x1) == 0 ? '0' : '1'); a>>=1; } } else { for (int i=0; i < 8; i++) { result.append((a & 0x80) == 0 ? '0' : '1'); a<<=1; } } } return result.toString(); }
Convert a byte array into string binary representation with defined bit order and possibility to separate bytes.
protected AbstractMatrix3D vSliceFlip(){ if (slices > 0) { sliceZero+=(slices - 1) * sliceStride; sliceStride=-sliceStride; this.isNoView=false; } return this; }
Self modifying version of viewSliceFlip().
public boolean load(Element shared,Element perNode) throws Exception { return true; }
Usual configurexml method, this one doesn't do anything because the content is explicitly loaded from the file
@NonNull @SuppressWarnings({"unused","MissingPermission"}) protected Account createOrGetAccount(@NonNull String accountName){ Account[] accountList=accountManager.getAccountsByType(accountType); for ( Account account : accountList) { if (account.name.equals(accountName)) return account; } Account account=new Account(accountName,accountType); accountManager.addAccountExplicitly(account,null,null); return account; }
Tries finding an existing account with the given name. It creates a new Account if it couldn't find it
public int length(int line){ int offsetStart=lineStarts[line]; int offsetEnd=lineStarts[line + 1]; return offsetEnd - offsetStart; }
What is the length of the given line?
public void enableImageTransforms(boolean enable){ if (mPhotoView != null) { mPhotoView.enableImageTransforms(enable); } }
Enable or disable image transformations. When transformations are enabled, this view consumes all touch events.
public SetConfig(CoordinatorStreamMessage message){ super(message.getKeyArray(),message.getMessageMap()); }
The SetConfig message is used to store a specific configuration.
public boolean add(int index,C controller){ return addAll(index,Collections.singleton(controller)); }
Adds the Node from this controller to the specified index in the observable list.
public void paint(Graphics2D g){ g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); origAlpha=1.0f; Composite origComposite=g.getComposite(); if (origComposite instanceof AlphaComposite) { AlphaComposite origAlphaComposite=(AlphaComposite)origComposite; if (origAlphaComposite.getRule() == AlphaComposite.SRC_OVER) { origAlpha=origAlphaComposite.getAlpha(); } } AffineTransform trans_0=g.getTransform(); paintRootGraphicsNode_0(g); g.setTransform(trans_0); }
Paints the transcoded SVG image on the specified graphics context. You can install a custom transformation on the graphics context to scale the image.
public void addScriptingListeners(Node node){ if (node.getNodeType() == Node.ELEMENT_NODE) { addScriptingListenersOn((Element)node); } for (Node n=node.getFirstChild(); n != null; n=n.getNextSibling()) { addScriptingListeners(n); } }
Adds the scripting listeners to the given element and all of its descendants.
public static void println(int priority,String tag,String msg,Throwable tr){ if (mLogNode != null) { mLogNode.println(priority,tag,msg,tr); } }
Instructs the LogNode to print the log data provided. Other LogNodes can be chained to the end of the LogNode as desired.
public ImageIcon loadImage(String imageName){ try { ClassLoader classloader=getClass().getClassLoader(); java.net.URL url=classloader.getResource(imageName); if (url != null) { ImageIcon icon=new ImageIcon(url); return icon; } } catch ( Exception e) { e.printStackTrace(); } throw new IllegalArgumentException("Unable to load image: " + imageName); }
Helper method to load an image file from the CLASSPATH
public void hspan(double start,double end,Paint color){ hspan(start,end,color,null); }
Draws a horizontal span into the graph.
public Criteria or(){ Criteria criteria=createCriteriaInternal(); oredCriteria.add(criteria); return criteria; }
This method was generated by MyBatis Generator. This method corresponds to the database table dependency
public static String[] tokenizeUnquoted(String s){ List tokens=new LinkedList(); int first=0; while (first < s.length()) { first=skipWhitespace(s,first); int last=scanToken(s,first); if (first < last) { tokens.add(s.substring(first,last)); } first=last; } return (String[])tokens.toArray(new String[tokens.size()]); }
This method tokenizes a string by space characters, but ignores spaces in quoted parts,that are parts in '' or "". The method does allows the usage of "" in '' and '' in "". The space character between tokens is not returned.
public static ECKey fromPrivateAndPrecalculatedPublic(BigInteger priv,ECPoint pub){ return new ECKey(priv,pub); }
Creates an ECKey that simply trusts the caller to ensure that point is really the result of multiplying the generator point by the private key. This is used to speed things up when you know you have the right values already. The compression state of pub will be preserved.
public void test_Constructor$CII() throws IOException { try { cr=new CharArrayReader(null,0,0); fail("Test 1: NullPointerException expected."); } catch ( NullPointerException e) { } try { cr=new CharArrayReader(hw,-1,0); fail("Test 2: IllegalArgumentException expected."); } catch ( IllegalArgumentException e) { } try { cr=new CharArrayReader(hw,0,-1); fail("Test 3: IllegalArgumentException expected."); } catch ( IllegalArgumentException e) { } try { cr=new CharArrayReader(hw,hw.length + 1,1); fail("Test 4: IllegalArgumentException expected."); } catch ( IllegalArgumentException e) { } cr=new CharArrayReader(hw,5,5); assertTrue("Test 5: Failed to create reader",cr.ready()); assertEquals("Test 6: Incorrect character read;",'W',cr.read()); }
java.io.CharArrayReader#CharArrayReader(char[], int, int)
public static double[][] multiplyMatrix(double[][] a,double[][] b){ double[][] c=new double[3][3]; for (int i=0; i < c.length; i++) { for (int j=0; j < c[i].length; j++) { for (int h=0; h < c.length; h++) { c[i][j]+=a[i][h] * b[h][j]; } } } return c; }
multiplyMatrix multiplies two matrices and returns the result
public static String newEditorLabel(String baseLabel){ Integer count=labelCounts.get(baseLabel); if (null == count) { count=1; labelCounts.put(baseLabel,count); return baseLabel; } String result=baseLabel + " " + count; labelCounts.put(baseLabel,count + 1); return result; }
Generate a temporary label for a new instance of an editor. This value should never be used to persist the editor data; a different mechanism should be used to generate good persistent named. <p> This implementation gives the first label without a number. Successive label get a number appended. <p> In a rich interface, it would be tempting to add formatting options.
private JVMCheck(){ }
no instantiation
public Credentials toCredentials(Element el,String attributeUser,String attributePassword){ String user=el.getAttribute(attributeUser); String pass=el.getAttribute(attributePassword); if (user == null) return null; if (pass == null) pass=""; return CredentialsImpl.toCredentials(user,pass); }
reads 2 XML Element Attribute ans cast it to a Credential
protected void fireStateChanged(){ Object[] listeners=listenerList.getListenerList(); for (int i=listeners.length - 2; i >= 0; i-=2) { if (listeners[i] == ChangeListener.class) { if (changeEvent == null) { changeEvent=new ChangeEvent(this); } ((ChangeListener)listeners[i + 1]).stateChanged(changeEvent); } } }
Sends a <code>ChangeEvent</code>, whose source is this <code>JSpinner</code>, to each <code>ChangeListener</code>. When a <code>ChangeListener</code> has been added to the spinner, this method method is called each time a <code>ChangeEvent</code> is received from the model.
protected void checkCapacity(){ if (size >= threshold) { int newCapacity=data.length * 2; if (newCapacity <= MAXIMUM_CAPACITY) { ensureCapacity(newCapacity); } } }
Checks the capacity of the map and enlarges it if necessary. <p/> This implementation uses the threshold to check if the map needs enlarging
public static boolean isFinal(int mod){ return (mod & FINAL) != 0; }
Returns true if the modifiers include the <tt>final</tt> modifier.
@Override public void close(){ panel.dispose(); }
Close this view
protected void generateCopyValueToWidgetMethod(SourcePrinter srcWriter){ srcWriter.println("public void copyValueToWidget(HasValue<?> valueContainer, String columnKey, DataSourceRecord<?> dataSourceRecord) {"); String elseStm=""; JField[] fields=JClassUtils.getDeclaredFields(dtoType); for (int i=0; i < fields.length; i++) { JField field=fields[i]; String name=field.getName(); JType type=field.getType(); String typeName=type.getQualifiedSourceName(); if (type.isPrimitive() != null) { JPrimitiveType jPrimitiveType=type.isPrimitive(); typeName=jPrimitiveType.getQualifiedBoxedSourceName(); } srcWriter.println(); if (JClassUtils.getGetterMethod(name,dtoType) != null) { srcWriter.println(elseStm + "if(" + EscapeUtils.quote(name)+ ".equals(columnKey)){"); srcWriter.println("((HasValue<" + typeName + ">)valueContainer).setValue(("+ typeName+ ") getValue(columnKey, dataSourceRecord));"); srcWriter.print("}"); srcWriter.println(); elseStm="else "; } } srcWriter.println(); srcWriter.println("bindToWidget(valueContainer, columnKey, dataSourceRecord);"); srcWriter.println("}"); }
Generates the copyValueToWidget method
@SuppressWarnings("unchecked") private void notifyRulesListeners(BatchAssociationRulesEvent are){ Vector<BatchAssociationRulesListener> l; synchronized (this) { l=(Vector<BatchAssociationRulesListener>)m_rulesListeners.clone(); for (int i=0; i < l.size(); i++) { l.get(i).acceptAssociationRules(are); } } }
Notify all batch association rules listeners of a rules event.
public FofcSearchEditor(FofcRunner runner){ this(runner,"Result MAG"); }
Allows the user to pop up an editor for a MimBuildRunner.
boolean isValid(){ return issuerX509PrincipalMatches && signatureIntact && crlSignKeyUsage&& !unknownCriticalExtension; }
This method indicates if the CRL is valid. To be valid the CRL must full fill the following requirements: - its signature must be valid, - the issuer of the certificate for which the CRL is used must match the CRL signing certificate and - the mandatory key usage must be present.
private void reset(Component newOwner,Component newContents,int newX,int newY,Popup newPopup){ this.owner=newOwner; this.contents=newContents; this.popup=newPopup; this.x=newX; this.y=newY; if (newOwner instanceof JComboBox) { return; } final Dimension contentsPrefSize=newContents.getPreferredSize(); if (contentsPrefSize.width <= 0 || contentsPrefSize.height <= 0) { return; } for (Container p=newContents.getParent(); p != null; p=p.getParent()) { if (p instanceof JWindow || p instanceof Panel) { p.setBackground(newContents.getBackground()); heavyWeightContainer=p; break; } } final JComponent parent=(JComponent)newContents.getParent(); oldOpaque=parent.isOpaque(); oldBorder=parent.getBorder(); parent.setOpaque(false); parent.setBorder(SHADOW_BORDER); if (heavyWeightContainer != null) { heavyWeightContainer.setSize(heavyWeightContainer.getPreferredSize()); } else { parent.setSize(parent.getPreferredSize()); } }
Reinitializes this ShadowPopup using the given parameters.
public static final SnapshotException rethrow(Throwable e){ if (e instanceof RuntimeException) { if (((RuntimeException)e).getCause() instanceof SnapshotException) return (SnapshotException)((RuntimeException)e).getCause(); throw (RuntimeException)e; } else if (e instanceof SnapshotException) return (SnapshotException)e; else return new SnapshotException(e); }
Wrap, if necessary, and return a SnapshotException.
public BufferReader(int capacity,InputStream is){ this.capacity=capacity; this.is=is; Log.d(LOG,"init(): capacity=" + capacity); buffers=new Buffer[3]; for (int i=0; i < buffers.length; i++) { buffers[i]=new Buffer(capacity); } indexMine=0; indexBlocked=buffers.length - 1; }
Creates a new buffer.
public void reset() throws IOException { m_structure=null; m_Buffer=null; setRetrieval(NONE); if (m_File != null) { setFile(new File(m_File)); } else if ((m_URL != null) && !m_URL.equals("http://")) { setURL(m_URL); } }
Resets the Loader ready to read a new data set.