code
stringlengths
10
174k
nl
stringlengths
3
129k
public boolean validatePassword(String password,String goodHash){ return validatePassword(password.toCharArray(),goodHash); }
Validates a password using a hash.
private void initializeDuration(Date date){ mDuration=new Duration(date.getTime()); final DurationFieldType[] durationFields=new DurationFieldType[]{DurationFieldType.weeks(),DurationFieldType.days(),DurationFieldType.hours(),DurationFieldType.minutes()}; mPeriod=mDuration.toPeriod(PeriodType.forFields(durationFi...
Creates a Joda duration/period object
@SuppressWarnings("unchecked") @Override public void eSet(int featureID,Object newValue){ switch (featureID) { case UmplePackage.INTERFACE_BODY___INTERFACE_MEMBER_DECLARATION_1: getInterfaceMemberDeclaration_1().clear(); getInterfaceMemberDeclaration_1().addAll((Collection<? extends InterfaceMemberDeclaration_>)n...
<!-- begin-user-doc --> <!-- end-user-doc -->
public static UserResult parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { UserResult object=new UserResult(); int event; java.lang.String nillableValue=null; java.lang.String prefix=""; java.lang.String namespaceuri=""; try { while (!reader.isStartElement() && !reader.isEndEle...
static method to create the object Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable If this object is not an element, it is a complex type and the reader is at the event just after the outer start element Postcondition: If t...
AStarNodeWrapper findMin(ArrayList<AStarNodeWrapper> set){ double min=100000; AStarNodeWrapper minNode=null; for ( AStarNodeWrapper n : set) { if (n.fx < min) { min=n.fx; minNode=n; } } return minNode; }
Considers the list of Nodes open for consideration and returns the node with minimum fx value
private void deleteData(){ try { Aspects candles=tradePersistentModel.findAspectsByClassName(Candle.class.getName()); for ( Aspect item : candles.getAspect()) { tradePersistentModel.removeAspect(item); } Aspects tradestrategies=tradePersistentModel.findAspectsByClassName(Tradestrategy.class.g...
Method deleteData. Clean the test data added.
public void addActionListener(ActionListener listener){ if (trayIcon != null) { trayIcon.addActionListener(listener); popup.addActionListener(listener); } }
Adds an ActionListener to the tray icon and the tray popoup menu. Does nothing if the tray is not available.
public java.lang.String toString(){ return DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG).format(this); }
Converts this Date object to a String of the form: dow mon dd hh:mm:ss zzz yyyy where: dow is the day of the week (Sun, Mon, Tue, Wed, Thu, Fri, Sat). mon is the month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec). dd is the day of the month (01 through 31), as two decimal digits. hh is the hour of the d...
@POST @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("/{id}/protection/full-copies") @CheckPermission(roles={Role.TENANT_ADMIN},acls={ACL.OWN,ACL.ALL}) public TaskList createFullCopy(@PathParam("id") URI id,VolumeFullCopyCreatePa...
Create a full copy of the specified volume.
public static <A,B>DecomposableMatchBuilder0<Tuple2<A,B>> tuple2(MatchesExact<A> a,MatchesExact<B> b){ List<Matcher<Object>> matchers=Lists.of(ArgumentMatchers.eq(a.t),ArgumentMatchers.eq(b.t)); return new DecomposableMatchBuilder0<Tuple2<A,B>>(matchers,new Tuple2FieldExtractor<>()); }
Matches a tuple of 2 elements.
public static void verifyNoDisallowedStatuses(EppResource resource,ImmutableSet<StatusValue> disallowedStatuses) throws EppException { Set<StatusValue> problems=Sets.intersection(resource.getStatusValues(),disallowedStatuses); if (!problems.isEmpty()) { throw new ResourceStatusProhibitsOperationException(proble...
Check that the resource does not have any disallowed status values.
public static void main(String[] args){ In in; String urlName="http://introcs.cs.princeton.edu/stdlib/InTest.txt"; System.out.println("readAll() from URL " + urlName); System.out.println("---------------------------------------------------------------------------"); try { in=new In(urlName); System.ou...
Test client.
public void actionPerformed(java.awt.event.ActionEvent e){ if (mouseDelegator == null) { return; } else { mouseDelegator.setActiveMouseModeWithID(e.getActionCommand()); } }
actionPerformed - Handle the mouse clicks on the button(s)
public TMultiplexedProtocol(TProtocol protocol,String serviceName){ super(protocol); SERVICE_NAME=serviceName; }
Wrap the specified protocol, allowing it to be used to communicate with a multiplexing server. The <code>serviceName</code> is required as it is prepended to the message header so that the multiplexing server can broker the function call to the proper service.
public static Vector<Element> readFeatureNodes(String templateFile){ Vector<Element> feaTypes=new Vector<Element>(); try { DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance(); DocumentBuilder builder=factory.newDocumentBuilder(); InputStream feaTplStream=new FileInputStream(templateFile)...
Read feature nodes.
public Matrix4f mulAffineR(Matrix4x3fc right){ return mulAffineR(right,this); }
Multiply this matrix by the supplied <code>right</code> matrix and store the result in <code>this</code>. <p> The last row of the <code>right</code> matrix is assumed to be <tt>(0, 0, 0, 1)</tt>. <p> If <code>M</code> is <code>this</code> matrix and <code>R</code> the <code>right</code> matrix, then the new matrix will...
public boolean isEmpty(){ return buffer == EOF; }
Returns true if this binary input stream is empty.
protected boolean scrollTop(TextView widget,Spannable buffer){ final Layout layout=widget.getLayout(); if (getTopLine(widget) >= 0) { Touch.scrollTo(widget,layout,widget.getScrollX(),layout.getLineTop(0)); return true; } return false; }
Performs a scroll to top action. Scrolls to the top of the document.
public DateMidnight roundHalfFloorCopy(){ return iInstant.withMillis(iField.roundHalfFloor(iInstant.getMillis())); }
Rounds to the nearest whole unit of this field on a copy of this DateMidnight, favoring the floor if halfway.
public SwedishAnalyzer(CharArraySet stopwords){ this(stopwords,CharArraySet.EMPTY_SET); }
Builds an analyzer with the given stop words.
private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter,java.lang.String namespace) throws javax.xml.stream.XMLStreamException { java.lang.String prefix=xmlWriter.getPrefix(namespace); if (prefix == null) { prefix=generatePrefix(namespace); while (xmlWriter.getNamespaceContext().g...
Register a namespace prefix
TimerImpl(String name,boolean isDaemon){ this.setName(name); this.setDaemon(isDaemon); this.start(); }
Starts a new timer.
private static boolean doSelfValidation(){ char lastChar=UNIHANS[0]; String lastString=Character.toString(lastChar); for ( char c : UNIHANS) { if (lastChar == c) { continue; } final String curString=Character.toString(c); int cmp=COLLATOR.compare(lastString,curString); if (cmp >= 0) { ...
Validate if our internal table has some wrong value.
public ImportException(){ super(); }
Constructs a new exception with <code>null</code> as its detail message. The cause is not initialized.
public ArrayList<Instance> dataset(Instance inst){ for (int i=0; i < m_Datasets.size(); i++) { if (m_Datasets.get(i).matchesTemplate(inst)) { return m_Datasets.get(i).contents(); } } return null; }
Returns a vector containing all instances belonging to one dataset.
public void distribute(MAccount acct,BigDecimal Amt,BigDecimal Qty,int C_Currency_ID){ log.info("distribute - Amt=" + Amt + " - Qty="+ Qty+ " - "+ acct); getLines(false); int precision=MCurrency.getStdPrecision(getCtx(),C_Currency_ID); BigDecimal total=Env.ZERO; BigDecimal totalQty=Env.ZERO; int indexBigges...
Distribute Amount to Lines
public static int removeDup(int[] A){ int i=0; int j=0; int pos=i + 1; while (i < A.length) { j=i + 1; while (j < A.length && A[i] == A[j]) { j++; } if (j >= A.length) break; A[pos]=A[j]; pos++; i=j; } return pos; }
use two pointers, one in the front, one for the dups
public static <K,V>Map<K,V> putAll(Map<K,V> self,Collection<? extends Map.Entry<? extends K,? extends V>> entries){ for ( Map.Entry<? extends K,? extends V> entry : entries) { self.put(entry.getKey(),entry.getValue()); } return self; }
Provides an easy way to append multiple Map.Entry values to a Map.
public ST createStringTemplateInternally(CompiledST impl){ ST st=createStringTemplate(impl); if (trackCreationEvents && st.debugState != null) { st.debugState.newSTEvent=null; } return st; }
Differentiate so we can avoid having creation events for regions, map operations, and other implicit "new ST" events during rendering.
public void delete(ScriptFilterGroup group){ if (!security.hasRight(AccessRight.DELETE_FILTER) && !security.isOwner(group)) { messages.warn("You don't have permission to delete this filter group."); } else { new ScriptFilterGroupDao().delete(group); refresh(); } }
Code for deleting a filter group goes here.
public int deliverMessage(Object message,int deliveryCount) throws Exception { if (closed) { System.err.println("Message can't be delivered as it's closed"); return 0; } if (!creditsSemaphore.tryAcquire()) { try { creditsSemaphore.acquire(); } catch ( InterruptedException e) { Thre...
handle an out going message from ActiveMQ Artemis, send via the Proton Sender
public final void blinkCaret(){ if (caretBlinks) { blink=!blink; painter.invalidateSelectedLines(); } else { blink=true; } }
Blinks the caret.
private VisorIgfsProfilerParsedLine(long ts,int entryType,String path,IgfsMode mode,long streamId,long dataLen,boolean overwrite,long pos,long userTime,long sysTime,long totalBytes){ this.ts=ts; this.entryType=entryType; this.path=path; this.mode=mode; this.streamId=streamId; this.dataLen=dataLen; this.ov...
Create holder for log line.
public static float[] stringToFloatArray(String str){ if (str == null) { return (null); } String[] array=str.split(","); if (array.length == 0) { array=new String[]{str.trim()}; } float[] nArray=new float[array.length]; for (int i=0; i < nArray.length; ++i) { nArray[i]=Float.parseFloat(array[i...
Convert a string to a float array
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:53.804 -0400",hash_original_method="BDC602CCB29EA618773E287B406AEBFF",hash_generated_method="9E9A911B8C6008DBD7F6E616825BD9D1") protected CanReadFileFilter(){ }
Restrictive consructor.
public void testDecoder4(){ boolean res; int originalAppIdValue=mAppIdValue; int originalContentTypeValue=mContentTypeValue; Random rd=new Random(); for (int i=0; i < 100; i++) { mAppIdValue=rd.nextInt(0x0FFFFFFF); mContentTypeValue=rd.nextInt(0x0FFF); byte[] pdu=createPDU(4); WspTypeDecoder p...
WspTypeDecoder test, no appid test
public AbbaLockingDetector startCollecting(){ thread=new Thread(this,"AbbaLockingDetector"); thread.setDaemon(true); thread.start(); return this; }
Start collecting locking data.
@DSComment("Perference UI, only change preference is spec") @DSSafe(DSCat.GUI) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:32:23.297 -0500",hash_original_method="4E596FDEE64331A25D2B8DFD1BC8797E",hash_generated_method="AB7808B7EE20CA1E95E83FE48A0F1C7F") public int findIndexOfVal...
Returns the index of the given value (in the entry values array).
public static boolean eqv(Object left,Object right) throws PageException { return eqv(Caster.toBooleanValue(left),Caster.toBooleanValue(right)); }
Equivalence: Return True if both operands are True or both are False. The EQV operator is the opposite of the XOR operator. For example, True EQV True is True, but True EQV False is False.
private static void qsufsort(int[] I,int[] V,byte[] oldBuf){ int oldsize=oldBuf.length; int[] buckets=new int[256]; int i, h, len; for (i=0; i < 256; i++) { buckets[i]=0; } for (i=0; i < oldsize; i++) { buckets[(int)oldBuf[i] & 0xff]++; } for (i=1; i < 256; i++) { buckets[i]+=buckets[i - 1];...
Fast suffix sporting. Larsson and Sadakane's qsufsort algorithm. See http://www.cs.lth.se/Research/Algorithms/Papers/jesper5.ps
@Override public void add(int location,E object){ insertElementAt(object,location); }
Adds the specified object into this vector at the specified location. The object is inserted before any element with the same or a higher index increasing their index by 1. If the location is equal to the size of this vector, the object is added at the end.
private void initializeLiveAttributes(){ externalResourcesRequired=createLiveAnimatedBoolean(null,SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE,false); preserveAspectRatio=createLiveAnimatedPreserveAspectRatio(); }
Initializes the live attribute values of this element.
public String charAsString(int nchars){ return buffer.substring(ptr,ptr + nchars); }
Lookahead in the inputBuffer for n chars and return as a string. Do not consume the input.
private void refreshTree() throws ValueTypeException { DefaultMutableTreeNode treeNodeSelected=(DefaultMutableTreeNode)m_tree.getLastSelectedPathComponent(); strategyTreeModel.setData(this.strategies); for (int i=0; i < m_tree.getRowCount(); i++) { m_tree.expandRow(i); } if (null == treeNodeSelected) re...
Method refreshTree.
public String classnamestub(){ String s=getClass().getName(); return s.substring(Math.max(s.lastIndexOf('.'),s.lastIndexOf('$')) + 1); }
Return the last part of the class name, to be used as a function name in tojstring and elsewhere.
private void checkEmptySelection(int columnIndex){ if (columnMetaData.get(columnIndex).isRemoved()) { selectedColumns.remove(columnIndex); } else { selectedColumns.add(columnIndex); } if (selectedColumns.isEmpty()) { columnErrorList.add(new ColumnError(Collections.<Integer>emptyList(),null,I18N.get...
Checks if all columns are removed.
public String numValuesTipText(){ return "The number of values to retain."; }
Returns the tip text for this property
public Resource[] scanForResources(ScriptsLocation location,String prefix,String suffix){ try { if (location.isFileSystem()) { return new FileSystemScanner().scanForResources(location.getPath(),prefix,suffix); } return new ClassPathScanner(classLoader).scanForResources(location.getPath(),prefix,suff...
Scans this location for resources, starting with the specified prefix and ending with the specified suffix.
protected void subAppend(LoggingEvent event){ if (event.getLevel().toInt() == AuditLevel.AUDIT.toInt()) { currentLevel=AuditLevel.AUDIT.toInt(); super.subAppend(event); } }
g Call RollingFileAppender method to append the log...
private static String buildMessage(String format,Object... args){ String msg=(args == null) ? format : String.format(Locale.US,format,args); StackTraceElement[] trace=new Throwable().fillInStackTrace().getStackTrace(); String caller="<unknown>"; for (int i=2; i < trace.length; i++) { Class<?> clazz=trace[i]...
Formats the caller's provided message and prepends useful info like calling thread ID and method name.
public static void load(){ try { HDFS_BLOCK_SIZE=FileSystem.get(new Configuration()).getDefaultBlockSize(new Path("/")); } catch ( IOException e) { logger.error("Error getting FS Block Size!",e); } logger.info("HDFS BLock size: " + HDFS_BLOCK_SIZE); }
Captures the HDFS Block Size
public static void onEventBegin(final Context context,final String event_id){ log.onEventBegin(context,event_id); }
Begin to log the duration of event
public void addActionListener(ActionListener listener){ m_text.addActionListener(listener); }
Action Listener Interface
public boolean isClosed(){ synchronized (closeLock) { return closed; } }
Returns the closed state of the ServerSocket.
public static String[] toStrings(SymbolToken[] symbols,int count){ if (count == 0) return PrivateUtils.EMPTY_STRING_ARRAY; String[] annotations=new String[count]; for (int i=0; i < count; i++) { SymbolToken tok=symbols[i]; String text=tok.getText(); if (text == null) { throw new UnknownSymbolE...
Extracts the non-null text from a list of symbol tokens.
private void createAndDestroy(){ try { region.create(new Integer(1),new Integer(1)); } catch ( Exception e) { logWriter.error("Exception occurred",e); throw new AssertionError("failed in trying to create",e); } try { region.destroy(new Integer(1)); } catch ( Exception e) { logWriter.er...
do a create and then a destroy
private void shareImage(final Bitmap bitmap,String original){ File image; final File imagesDir=new File(this.getCacheDir().toString() + File.separator + "shared_image"); if (!imagesDir.exists()) { imagesDir.mkdir(); } else { deleteFilesInDir(imagesDir); } try { image=File.createTempFile("img","...
Converts an image to a PNG, stores it to the cache, then shares it. Saves the image to /cache/shared_image for easy deletion. If the /cache/shared_image folder already exists, we clear it's contents as to avoid increasing the cache size unnecessarily.
public void abortCycle(){ lock.lock(); if (contextsParked < contexts.length) { aborted=true; } lock.unlock(); }
Signal that you would like the threads to park abruptly. Has no effect if no cycle is active.
private void onSearchEnd(int nbrMessages){ Log.d(LOG_TAG,"## onSearchEnd() nbrMsg=" + nbrMessages); mWaitWhileSearchInProgressView.setVisibility(View.GONE); mBackgroundImageView.setVisibility((0 == nbrMessages) && TextUtils.isEmpty(mPatternToSearchEditText.getText().toString()) ? View.VISIBLE : View.GONE); mNoR...
The search is done.
public XYDataImageAnnotation(Image image,double x,double y,double w,double h){ this(image,x,y,w,h,false); }
Creates a new annotation to be displayed within the specified rectangle.
public String replace(final CharSequence source){ if (source == null) { return null; } return replace(source,0,source.length()); }
Replaces all the occurrences of variables with their matching values from the resolver using the given source as a template. The source is not altered by this method.
@Override public synchronized int available(){ return count - pos; }
Returns the number of remaining bytes.
public boolean checkMaxDegree(int value){ if (value >= ROLE_CARDINALITY_INFINITY && (maxDegree == ROLE_CARDINALITY_INFINITY || (value != ROLE_CARDINALITY_INFINITY && value <= maxDegree))) { return true; } else { return false; } }
Returns true if the <tt>value</tt> parameter is lower than or equal to the expected maximum degree, false otherwise.
public synchronized List<Vertex> findAllInstances(Vertex type,Vertex relationship,Calendar start){ return new ArrayList<Vertex>(); }
Find all relationships related to the vertex or of the vertex type.
public static final Cache<String,BlockReader> createCache(int concurrencyLevel,int initialCapacity,float heapMemPercentage){ CacheBuilder builder=CacheBuilder.newBuilder().concurrencyLevel(concurrencyLevel).initialCapacity(initialCapacity).maximumWeight((long)(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()....
(Re)Create the cache by limiting percentage of the total heap memory
public static void announceText(String text,View view,AccessibilityManager manager){ if (!manager.isEnabled()) { return; } AccessibilityEvent event=AccessibilityEvent.obtain(AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUSED); event.getText().add(text); event.setEnabled(true); event.setClassName(v...
Announce text through the AccessibilityManager for a view.
@Override public synchronized void minus(int value){ this.value-=value; }
operation minus
public CGraphWindowMenuBar(final CGraphModel model,final IViewSwitcher viewSwitcher){ Preconditions.checkNotNull(model,"IE01626: Model argument can not be null"); m_model=model; m_actionSave=new CActionSave(model.getParent(),model.getGraph()); final JCheckBoxMenuItem autoLayoutMenu=new JCheckBoxMenuItem(new CAc...
Creates a new menu bar for a given graph.
public static Matrix forwardSub(Matrix L,Matrix b){ if (b.rows() != L.rows()) throw new ArithmeticException("Vector and matrix sizes do not agree"); Matrix y=new DenseMatrix(b.rows(),b.cols()); double[] y_col_k=new double[b.rows()]; for (int k=0; k < b.cols(); k++) { for (int i=0; i < b.rows(); i++) { ...
Solves for the matrix x such that L x = b
private static EpisodeMatchingResult combineResults(EpisodeMatchingResult result,EpisodeMatchingResult resultFromParser){ if (result.season < 0 && resultFromParser.season >= 0) { result.season=resultFromParser.season; } if (result.episodes.size() == 0 && resultFromParser.episodes.size() > 0) { for ( in...
Combine results.
public String executeAndReturnString(String javaScript){ return Display.impl.browserExecuteAndReturnString(internal,javaScript); }
Executes the given JavaScript and returns a result string from the underlying platform where applicable
public void transformValues(TFloatFunction function){ byte[] states=_states; float[] values=_values; for (int i=values.length; i-- > 0; ) { if (states[i] == FULL) { values[i]=function.execute(values[i]); } } }
Transform the values in this map using <tt>function</tt>.
private boolean alreadyWrapped(final ServletRequest request){ if (request instanceof RequestWrapper) { return true; } if (!(request instanceof ServletRequestWrapper)) { return false; } final ServletRequest nestedRequest=((ServletRequestWrapper)request).getRequest(); if (nestedRequest == request) { ...
Test if a request has been wrapped with RequestWrapper somewhere in the chain of wrapped requests.
private boolean compare(List<String> remoteModules,List<String> expectedModules){ Collections.sort(remoteModules); Collections.sort(expectedModules); return remoteModules.equals(expectedModules); }
return true if the both lists contain the same content (order doesn't matter)
public ClientHttpRequest(String urlString) throws IOException { this(new URL(urlString)); }
Creates a new multipart POST HTTP request for a specified URL string
@Override public boolean isNamespace(){ return eventType == XMLStreamConstants.NAMESPACE; }
If this event a NAMESPACE?
public RepositoryLocation(String absoluteLocation) throws MalformedRepositoryLocationException { if (isAbsolute(absoluteLocation)) { initializeFromAbsoluteLocation(absoluteLocation); } else { repositoryName=null; initializeAbsolutePath(absoluteLocation); } }
Constructs a RepositoryLocation from a string of the form //Repository/path/to/object.
private static boolean isSupportedSyntax(Statement stat,String sql){ try { stat.execute(sql); return true; } catch ( SQLException ex) { return false; } }
Return if the syntax is supported otherwise false
@Override public void onMessagesDeleted(ContactId contact,List<String> msgIds) throws RemoteException { mListener.onMessagesDeleted(contact,new HashSet<>(msgIds)); }
This feature to be implemented in CR005
private void updateProgress(int progress){ if (myHost != null && progress != previousProgress) { myHost.updateProgress(progress); } previousProgress=progress; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
@SuppressWarnings("unchecked") public synchronized <K>Collection<K> failedKeys(){ return new LinkedHashSet<>((Collection<K>)failedKeys); }
Gets collection of failed keys.
public Coordinate(int x,int y){ this.x=x; this.y=y; }
Instantiates an object which calculates the position of an image, using the given coordinates.
public void makePrivateWindow(){ synchronized (list) { list.remove(this); } }
Remove this window from e.g. the Windows Menu by removing it from the list of active JmriJFrames
public boolean isEdge(){ return isEdge; }
Tests whether the user is using Edge.
private static <T>T cast(Class<T> clazz,Object o){ if (!clazz.isInstance(o)) throw new IllegalArgumentException(o.toString()); return clazz.cast(o); }
Returns an object cast to the specified type.
public BluetoothLEPeerNetwork(){ }
Create a BluetoothLEPeerNetwork with no remote network devices to talk to.
private static boolean isProcessDirectory(File file){ try { Integer.parseInt(file.getName()); return file.isDirectory(); } catch ( NumberFormatException e) { return false; } }
Returns true if the given file represents a process directory.
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:18.149 -0500",hash_original_method="098653D6B0F25929404FF528DA5234A0",hash_generated_method="41813C68DF13445F7AE1E7B77D1F256D") public synchronized StringBuffer reverse(){ ...
Reverses the order of characters in this buffer.
public PacketCopy(String text){ this.text=text; }
Create a copy of a packet with the text to send. The passed text must be a valid text to send to the server, no validation will be done on the passed text.
public static void drawInRound(Bitmap src,Bitmap dest){ drawInRound(src,dest,CLEAR_COLOR); }
Drawing src bitmap to dest bitmap with round mask. Dest might be squared, src is recommended to be square
public JSONException(String message){ super(message); }
Constructs a JSONException with an explanatory message.
private void adjustViewsUpOrDown(){ final int childCount=getChildCount(); if (childCount > 0) { int delta; View child; if (!mStackFromBottom) { child=getChildAt(0); delta=child.getTop() - mListPadding.top; if (mFirstPosition != 0) { delta-=mVerticalSpacing; } if (de...
Make sure views are touching the top or bottom edge, as appropriate for our gravity
public UniformGenerator(int dimensions,double scale){ this.dimensions=dimensions; this.scale=scale; }
Construct generator given desired number of dimensions and scale.
private MethodSpec createWriteMethod(ClassName elementClassName,GsonObject rootElements,boolean serializeNulls) throws ProcessingException { MethodSpec.Builder writeMethod=MethodSpec.methodBuilder("write").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC).addParameter(JsonWriter.class,"out").addParameter(el...
public void write(JsonWriter out, ImageSizes value) throws IOException {
private void appendFaces(PrintWriter out){ Collections.sort(exportFaces); String last_mtl=null; Long last_obj_idx=Long.valueOf(-1); for ( OBJFace f : exportFaces) { if (!f.mtl.equals(last_mtl) && print_usemtl) { out.println(); out.println("usemtl " + f.mtl); last_mtl=f.mtl; } if (...
This method prints faces from the current buffer to an OBJ format.
public AStarSearch(IScore sf){ this.scoringFunction=sf; }
Prepare an A* search using the given scoring function.
public void finishAffinity(){ if (mParent != null) { throw new IllegalStateException("Can not be called from an embedded activity"); } if (mResultCode != RESULT_CANCELED || mResultData != null) { throw new IllegalStateException("Can not be called to deliver a result"); } try { if (ActivityManagerN...
Finish this activity as well as all activities immediately below it in the current task that have the same affinity. This is typically used when an application can be launched on to another task (such as from an ACTION_VIEW of a content type it understands) and the user has used the up navigation to switch out of the ...
public static long sizeOf(Object obj,ClassLoader cl){ Instruments instruments=new Instruments(); instruments.classLoader=cl; return instruments.internalSizeOf(obj); }
Size of.
public String generatePaySelect(IMiniTable miniTable,ValueNamePair paymentRule,Timestamp payDate,BankInfo bi){ log.info(""); String trxName=null; trx=null; String PaymentRule=paymentRule.getValue(); m_ps=new MPaySelection(Env.getCtx(),0,trxName); m_ps.setName(Msg.getMsg(Env.getCtx(),"VPaySelect") + " - " + ...
Generate PaySelection
private Segment attributeSegment(Attribute attribute){ final Element owner=attribute.getElement(); final byte[] name=attribute.getName().getBytes(); final byte[] value=attribute.getValue().getBytes(); final int attrLeft=indexOfAttributeName(xml,name,owner.start.left + owner.getName().length()); final int valu...
Retrieves attribute segment