code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public BlobOutputStream(RowCursor cursor,ColumnBlob column){
_table=cursor.table();
_cursor=cursor;
_column=column;
init();
}
| Creates a blob output stream. |
public void testGetCertificateIssuer(){
assertNull("The default implementation should return null.",tbt_crlentry.getCertificateIssuer());
}
| getCertificateIssuer() method testing. Tests if the method throws appropriate exception. |
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 SingleLogoutService(String location,String binding){
this.location=location;
this.binding=binding;
}
| SingleLogoutService object. This object correspond to samlm:EndPointType |
public void printFunction(Vertex function,Writer writer,String indent,Set<Vertex> elements,Network network) throws IOException {
if (function.getData() instanceof BinaryData) {
Vertex detached=parseFunctionByteCode(function,(BinaryData)function.getData(),network);
elements.add(detached);
printFunction(det... | Print the function and any functions it references that have not been printed. |
private void resetOptionStatus(){
boolean isUpgrade=true;
if (m_modeTransfer.isSelected()) isUpgrade=false;
m_upgradeModeOld=isUpgrade;
if (isUpgrade) {
m_optionAttemptTranslations.setEnabled(false);
m_optionPreserveTableIDs.setEnabled(true);
m_optionDropSource.setEnabled(true);
}
else {
m_... | enables or disables option fields depending on migration mode |
private long reconcileState(){
final Phaser root=this.root;
long s=state;
if (root != this) {
int phase, p;
while ((phase=(int)(root.state >>> PHASE_SHIFT)) != (int)(s >>> PHASE_SHIFT) && !UNSAFE.compareAndSwapLong(this,stateOffset,s,s=(((long)phase << PHASE_SHIFT) | ((phase < 0) ? (s & COUNTS_MASK) : (((... | Resolves lagged phase propagation from root if necessary. Reconciliation normally occurs when root has advanced but subphasers have not yet done so, in which case they must finish their own advance by setting unarrived to parties (or if parties is zero, resetting to unregistered EMPTY state). |
public long lookupId(BytesRef idBytes) throws IOException {
String field=schema.getUniqueKeyField().getName();
for (int i=0, c=leafContexts.size(); i < c; i++) {
final AtomicReaderContext leaf=leafContexts.get(i);
final AtomicReader reader=leaf.reader();
final Terms terms=reader.terms(field);
if (te... | lookup the docid by the unique key field, and return the id *within* the leaf reader in the low 32 bits, and the index of the leaf reader in the high 32 bits. -1 is returned if not found. |
@Override public void onSearchHint(SearchCustomActionBar searchview,CharSequence constraint){
}
| This method is called when the user press the search button on the keyboard |
public static void updateTypeMember(final Connection connection,final TypeMember member,final String newName,final BaseType newBaseType,final Optional<Integer> offset,final Optional<Integer> newNumberOfElements,final Optional<Integer> newArgumentIndex,final INaviModule module) throws CouldntSaveDataException {
Precon... | Updates the member belonging to the given base type in the database. |
public ASN1InputStream(byte[] input,boolean lazyEvaluate){
this(new ByteArrayInputStream(input),input.length,lazyEvaluate);
}
| Create an ASN1InputStream based on the input byte array. The length of DER objects in the stream is automatically limited to the length of the input array. |
private void saveDebugger(){
if (m_addressSpace == null) {
try {
m_module.getConfiguration().setDebuggerTemplate(m_debuggerPanel.getSelectedDebugger());
}
catch ( final CouldntSaveDataException e) {
CUtilityFunctions.logException(e);
final String message="E00179: " + "Could not change th... | Saves the module debugger to the database. |
public KeybindSet(JButton button,String commandName,KeyModifier modifier,int key){
this.button=button;
this.commandName=commandName;
this.modifier=modifier;
this.key=key;
}
| Creates a new KeybindSet object to store associated keybindings and their command values. |
public boolean isFinal(){
return false;
}
| Always returns 'false' since this state machine can never become final. |
public static Test suite(){
return (new TestSuite(Issue2194ITCase.class));
}
| Return the tests included in this test suite. |
public AllowHeader createAllowHeader(String method) throws ParseException {
if (method == null) throw new NullPointerException("null arg method");
Allow allow=new Allow();
allow.setMethod(method);
return allow;
}
| Creates a new AllowHeader based on the newly supplied method value. |
public void characters(char[] ch,int start,int length) throws SAXException {
try {
stopTerminator();
if (w == null) return;
int end=start + length;
for (int i=start; i < end; i++) {
char c=ch[i];
switch (c) {
case '&':
w.write("&");
break;
case '<':
w.write("<");
b... | Inserts a string of characters into the document. |
public static DoubleFunction div(final double b){
return mult(1 / b);
}
| Constructs a function that returns <tt>a / b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. |
public static long multiplyWith7(long n){
return (n << 3) - n;
}
| 3 left shifts gives us 8n but we want 7n, so we subtract 1n from it. Similarly we can do any multiplication by shifting and then adding/subtracting. |
private void validate(){
onComplete(true);
}
| Put more complete/validation logic here. |
public static double convertMillisToMinutes(double millis){
return millis / MINUTE_TO_MILLIS;
}
| Converts time in milliseconds to time in minutes. |
private double[][] createInitialSimplex(double[] initial){
double[][] points=new double[initial.length + 1][];
for (int i=0; i < points.length; i++) {
points[i]=new double[initial.length];
}
System.arraycopy(initial,0,points[0],0,initial.length);
for (int i=1; i < points.length; i++) {
System.arraycop... | Create initial n+1 simplex points using given initial point for point[0] and setting all other points to point[0] + lambda+unit_vector_(i-1] |
private static Stats computeOverDivide(ArrayList<Integer> ngram,References references,int boundary){
HashMap<String,Integer> boundaryNgrams=new HashMap<>();
for (int width=1; width <= Math.min(maxOrder,ngram.size()); width++) {
for (int i=0; i < ngram.size() - width + 1; i++) {
int j=i + width;
fina... | When computing BLEU statistics over a rule, we need to avoid adding in ngrams that are exclusively contained inside tail nodes. This function accumulates all the eligible ngrams from a string respective of an optional boundary point, and then calls computeNgramMatches(). |
public int[] readTurnOverflowAbsolute() throws IOException {
String line=br.readLine();
while (line != null) {
if (line.matches(".*Turn duration overflow by.*")) {
return splitLine(line);
}
line=br.readLine();
}
return null;
}
| reads the absolute times from the file. |
public final double correct(){
return m_delegate.correct();
}
| Gets the number of instances correctly classified (that is, for which a correct prediction was made). (Actually the sum of the weights of these instances) |
public JCTypeCast TypeCast(Type type,JCExpression expr){
return (JCTypeCast)TypeCast(Type(type),expr).setType(type);
}
| Make an attributed type cast expression. |
public static String format(int id){
final char[] r=new char[8];
for (int p=7; 0 <= p; p--) {
final int h=id & 0xf;
r[p]=h < 10 ? (char)('0' + h) : (char)('a' + (h - 10));
id>>=4;
}
return new String(r);
}
| Format an id created by this class as a hex string. |
public static void deleteCachedCover(Uri uri){
sImageCache.remove(ContentUris.parseId(uri));
}
| Deletes the specified drawable from the cache. |
public static String escape(String input,Characters[] characters){
String result;
TCharArrayList chars;
List<String> escaped;
chars=new TCharArrayList();
escaped=new ArrayList<>();
for ( Characters ch : characters) {
switch (ch) {
case AMPERSAND:
chars.add('&');
escaped.add("\\&");
break;
case ... | Ensures that the string is LaTeX compliant. |
public boolean addPath(OPath path){
Block block=path.getBlock();
if (block == null) {
log.error("Path \"" + path.getName() + "\" has no block.");
return false;
}
if (!this.equals(path.getFromPortal()) && !this.equals(path.getToPortal())) {
return false;
}
if (_fromBlock != null && _fromBlock.equ... | Determine which list the Path belongs to and add it to the list |
@DatabindingMethod public void onTitleClick(View v,Integer position,ImageInfo item,AdapterManager<?> am){
mToaster.show("[ this is called on item2-> 'item_txt' ] on title click: position = " + position + " ,item = "+ item);
}
| this is bind in item: item_txt |
public void newLine() throws IOException {
super.write(StringUtils.LS);
}
| Output a platform specific new line. |
public IdentifiedLanguage(final String language,final Double confidence){
super(language);
this.confidence=confidence;
}
| Instantiates a new language. |
public void testMultipleConnectionStops() throws Exception {
testStoppedConsumerHoldsMessagesTillStarted();
stoppedConnection.stop();
testStoppedConsumerHoldsMessagesTillStarted();
stoppedConnection.stop();
testStoppedConsumerHoldsMessagesTillStarted();
}
| Tests if the consumer is able to receive messages eveb when the connecction restarts multiple times. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
protected void moveSelectionToLastPosition(){
if (selectionTable.getSelectionCount() == 0) {
return;
}
final int numberOfSelectedElements=selectionTable.getSelectionCount();
for ( final TableItem tableItem : selectionTable.getSelection()) {
final DLItem item=(DLItem)tableItem.getData();
selection.r... | Move the selected item to the last position |
protected void updateButtonDayDate(Button dayButton,int year,int currentMonth,int day){
updateButtonDayDate(dayButton,currentMonth,day);
}
| This method updates the Button day. |
public static String toString(InputStream input) throws IOException {
return toString(input,Charset.defaultCharset());
}
| Get the contents of an <code>InputStream</code> as a String using the default character encoding of the platform. <p> This method buffers the input internally, so there is no need to use a <code>BufferedInputStream</code>. |
public static boolean isNameMatching(String startingWith,Declaration d){
return isNameMatching(startingWith,d.getName());
}
| Match the name of the given declaration to the given pattern. A name matches if: - it starts with the pattern, ignoring case, or - the pattern consists of all uppercase after the first character, and its uppercase "humps" match the pattern. |
@SuppressForbidden(reason="We need to access private fields of measured objects.") private static ClassCache createCacheEntry(final Class<?> clazz){
return AccessController.doPrivileged((PrivilegedAction<ClassCache>)null);
}
| Create a cached information about shallow size and reference fields for a given class. |
public RaftParameters withElectionTimeoutUpper(int electionTimeoutUpper){
this.electionTimeoutUpperBound=electionTimeoutUpper;
return this;
}
| Election timeout upper bound in milliseconds |
public void registerProjectType(ProjectTypeDef projectType) throws ProjectTypeConstraintException {
if (isNameValid(projectType) && isParentValid(projectType,validatedData)) {
validatedData.put(projectType.getId(),projectType);
init(projectType);
}
}
| Registers single projectType May be deprecated in future |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:27:48.591 -0500",hash_original_method="BC041D78EED5B299AE554E075ADF39D8",hash_generated_method="C4605B4B9EFC12A82E9A03E0D3B83614") @Deprecated public void onSignalStrengthChanged(int asu){
}
| Callback invoked when network signal strength changes. |
@Override public void run(){
amIActive=true;
String streamsHeader=null;
String pointerHeader=null;
String outputHeader=null;
int row, col, x, y;
float progress=0;
double z;
int i, c;
int[] dX=new int[]{1,1,1,0,-1,-1,-1,0};
int[] dY=new int[]{-1,0,1,1,1,0,-1,-1};
double[] inflowingVals=new double[]... | Used to execute this plugin tool. |
public void removeListener(T listener){
listeners.remove(listener);
}
| Unregisters a listener to receive events. |
protected void fillTable(JComboBox cb){
ValueNamePair select=null;
String sql="SELECT AD_Table_ID, TableName FROM AD_Table t " + "WHERE EXISTS (SELECT * FROM AD_Column c" + " WHERE t.AD_Table_ID=c.AD_Table_ID AND c.ColumnName='Posted')"+ " AND IsView='N'";
try {
PreparedStatement pstmt=DB.prepareStatement(sql... | Fill Table with ValueNamePair (TableName, translatedKeyColumnName) and tableInfo with (TableName, AD_Table_ID) and select the entry for AD_Table_ID |
public CipherParameters generateDerivedParameters(int keySize,int ivSize){
keySize=keySize / 8;
ivSize=ivSize / 8;
byte[] dKey=generateDerivedKey(keySize + ivSize);
return new ParametersWithIV(new KeyParameter(dKey,0,keySize),dKey,keySize,ivSize);
}
| Generate a key with initialisation vector parameter derived from the password, salt, and iteration count we are currently initialised with. |
public boolean remove(INode n){
INode state=contains(n);
if (state == null) {
return false;
}
return queue.remove(state);
}
| Remove actual value from the set. <p> An existing INode in the set that .equals(n) is selected for removal. |
public final boolean hasContended(){
return head != null;
}
| Queries whether any threads have ever contended to acquire this synchronizer; that is if an acquire method has ever blocked. <p>In this implementation, this operation returns in constant time. |
public boolean isSet(_Fields field){
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case NODE_ID:
return isSetNodeId();
case VERSION:
return isSetVersion();
}
throw new IllegalStateException();
}
| Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise |
protected boolean containsObjectInstance(T instance){
Collection<T> collection=__getCollection();
if (collection != null) {
for ( T item : collection) {
if (instance == item) return true;
}
}
return false;
}
| Search the collection using object identity. |
private void incEdgeCounter(GPR counters,GPR scratch,GPR scratchForXER,int counterIdx){
asm.emitLInt(scratch,counterIdx << 2,counters);
emitEdgeCounterIncrease(scratch,scratchForXER);
asm.emitSTW(scratch,counterIdx << 2,counters);
}
| increment an edge counter. |
final synchronized void writeToStream(DataOutputStream dos) throws IOException {
tree.writeToStream(dos);
timeController.writeToStream(dos);
}
| Serialize to output stream. |
public static void attributes(TagData data,TagLibTag tag,Tag parent) throws TemplateException {
int type=tag.getAttributeType();
int start=data.srcCode.getPos();
if (type != TagLibTag.ATTRIBUTE_TYPE_NONAME) {
try {
int min=tag.getMin();
int max=tag.getMax();
int count=0;
ArrayList<Stri... | Liest die Attribute eines Tags ein, dies Abhaengig von der Definition innerhalb der Tag-Lib. Hierbei unterscheiden wir vier verschiedene Arten von Attributen:<br> <ul> <li>FIX: Definierte Attribute Fix, fuer jedes Attribut ist definiert ob es required ist oder nicht (gleich wie JSP). </li> <li>DYNAMIC: Die Attribute de... |
protected RangeConstraintImpl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
@Override public void mouseMoved(MouseEvent e){
synchronized (mouseLock) {
mouseX=userX(e.getX());
mouseY=userY(e.getY());
}
}
| This method cannot be called directly. |
public Bitmap decodeFileDescriptor(FileDescriptor fd,BitmapFactory.Options options){
if (options.mCancel) {
return null;
}
Thread thread=Thread.currentThread();
if (!canThreadDecoding(thread)) {
Log.d(TAG,"Thread " + thread + " is not allowed to decode.");
return null;
}
setDecodingOptions(threa... | The real place to delegate bitmap decoding to BitmapFactory. |
@Override public Cursor swapCursor(Cursor newCursor){
Cursor old=super.swapCursor(newCursor);
resetMappings();
return old;
}
| Swaps Cursor and clears list-Cursor mapping. |
static String add_escapes(String str){
StringBuffer retval=new StringBuffer();
char ch;
for (int i=0; i < str.length(); i++) {
switch (str.charAt(i)) {
case 0:
continue;
case '\b':
retval.append("\\b");
continue;
case '\t':
retval.append("\\t");
continue;
case '\n':
retval.append("\\n");
continue;
cas... | Used to convert raw characters to their escaped version when these raw version cannot be used as part of an ASCII string literal. |
public static short adviceId(ByteString bagId){
return bagId.asReadOnlyByteBuffer().getShort(2);
}
| Decode the advice ID from a bag id |
public Graphics create(){
DebugGraphics debugGraphics;
debugGraphics=new DebugGraphics();
debugGraphics.graphics=graphics.create();
debugGraphics.debugOptions=debugOptions;
debugGraphics.buffer=buffer;
return debugGraphics;
}
| Overrides <code>Graphics.create</code> to return a DebugGraphics object. |
static double f(double[] coefs,double x){
double y=0;
for (int i=0; i < coefs.length; i++) {
y+=coefs[i] * pow(x,coefs.length - 1 - i);
}
return y;
}
| Calculate the value of polynomial. |
public void add(final Match<T> match){
m_matches.add(match);
}
| Add a match. |
public Slack icon(String imageOrIcon){
this.icon=imageOrIcon;
return this;
}
| Change the bot icon |
public void fireWalletBusyChange(boolean newWalletIsBusy){
for (Iterator<WalletBusyListener> it=walletBusyListeners.iterator(); it.hasNext(); ) {
WalletBusyListener walletBusyListener=it.next();
walletBusyListener.walletBusyChange(newWalletIsBusy);
}
}
| Fire that a wallet has changed its busy state. |
public static void createSupportEMail(Dialog owner,String subject,String message){
log.config("ADialog.createSupportEMail");
String to=Adempiere.getSupportEMail();
MUser from=MUser.get(Env.getCtx(),Env.getAD_User_ID(Env.getCtx()));
StringBuffer myMessage=new StringBuffer(message);
myMessage.append("\n");
CL... | / Create Support EMail |
public CSVParser(char separator){
this(separator,DEFAULT_QUOTE_CHARACTER,DEFAULT_ESCAPE_CHARACTER);
}
| Constructs CSVParser with supplied separator. |
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 |
void handleBlockChange(java.beans.PropertyChangeEvent e){
if ((getMemory() != null) && (block != null) && !suppressNameUpdate) {
Object val=block.getValue();
if (val != null) {
if (!(val instanceof jmri.jmrit.roster.RosterEntry)) {
val=val.toString();
}
}
getMemory().setValue(val);... | Handle tasks when block changes |
protected void addReferencePropertyDescriptor(Object object){
itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),getResourceLocator(),getString("_UI_ElementReferenceExpression_reference_feature"),getString("_UI_PropertyDescriptor_description","... | This adds a property descriptor for the Reference feature. <!-- begin-user-doc --> <!-- end-user-doc --> |
protected void onFirstListItem(){
if (swipeListViewListener != null) {
swipeListViewListener.onFirstListItem();
}
}
| User is in first item of list |
private void writeQNameAttribute(java.lang.String namespace,java.lang.String attName,javax.xml.namespace.QName qname,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
java.lang.String attributeNamespace=qname.getNamespaceURI();
java.lang.String attributePrefix=xmlWriter.getPre... | Util method to write an attribute without the ns prefix |
public static boolean checkLineBox(PLVector3[] ray,PLVector3 startBound,PLVector3 endBound,PLVector3[] hitPoint){
if ((ray[1].x < startBound.x && ray[0].x < startBound.x) || (ray[1].x > endBound.x && ray[0].x > endBound.x) || (ray[1].y < startBound.y && ray[0].y < startBound.y)|| (ray[1].y > endBound.y && ray[0].y > ... | check methods |
protected void paintChildren(Graphics g){
super.paintChildren(g);
SplitPaneUI ui=getUI();
if (ui != null) {
Graphics tempG=g.create();
ui.finishedPaintingChildren(this,tempG);
tempG.dispose();
}
}
| Subclassed to message the UI with <code>finishedPaintingChildren</code> after super has been messaged, as well as painting the border. |
public void connect() throws IOException {
if (m_state != PseudoTcpState.TCP_LISTEN) {
throw new IOException("Invalid socket state: " + m_state);
}
m_state=PseudoTcpState.TCP_SYN_SENT;
logger.log(Level.FINE,"State: TCP_SYN_SENT","");
queueConnectMessage();
attemptSend(SendFlags.sfNone);
}
| Enqueues connect message and starts connection procedure |
public GlobPattern(String globPattern){
set(globPattern);
}
| Construct the glob pattern object with a glob pattern string |
public String xPrintTargetError(Throwable t){
String getTarget="import java.lang.reflect.UndeclaredThrowableException;" + "String result=\"\";" + "while ( target instanceof UndeclaredThrowableException ) {"+ " target=target.getUndeclaredThrowable(); "+ " result+=\"Nested: \"+target.toString();"+ "}"+ "return result;"... | Extended form of print target error. This indirection is used to print UndeclaredThrowableExceptions which are possible when the proxy mechanism is available. We are shielded from compile problems by using a bsh script. This is acceptable here because we're not in a critical path... Otherwise we'd need yet another dyn... |
public static double calculateDepartureTime(Activity act,double now,PlansConfigGroup.ActivityDurationInterpretation activityDurationInterpretation){
if (act.getMaximumDuration() == Time.UNDEFINED_TIME && (act.getEndTime() == Time.UNDEFINED_TIME)) {
return Double.POSITIVE_INFINITY;
}
else {
double departure... | Contains rules about when to leave an Activity, considering the current time and the properties of the Activity. Specifically, determines how maximum duration and specific end time are played against each other. |
public void paintBackground(Graphics g){
super.paintBackground(g);
}
| Exposing the background painting for the benefit of animations |
public static String removeTagsHTML(String text){
if (text == null) {
String msg=Logging.getMessage("nullValue.StringIsNull");
Logging.logger().severe(msg);
throw new IllegalArgumentException(msg);
}
return text.replaceAll("<[^\\s].*?>","");
}
| Remove all HTML tags from a text string. |
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
protected double[] rhumbProjectDouble(Point2D from,Point2D to,boolean include_last,int nsegs){
if (nsegs < 1) {
nsegs=DrawUtil.pixel_distance((int)from.getX(),(int)from.getY(),(int)to.getX(),(int)to.getY()) >> 3;
if (nsegs == 0) nsegs=1;
else if (nsegs > MAX_RHUMB_SEGS) nsegs=MAX_RHUMB_SEGS;
}
... | Calculates the points along a rhumbline between two XY points. <p> Loxodromes are straight in the Mercator projection. Calculate a bunch of extra points between the two points, inverse project back into LatLons and return all the vertices. |
public boolean equals(Object obj){
return obj != null && obj instanceof DocFlavor && getStringValue().equals(((DocFlavor)obj).getStringValue());
}
| Determines if this doc flavor object is equal to the given object. The two are equal if the given object is not null, is an instance of <code>DocFlavor</code>, has a MIME type equivalent to this doc flavor object's MIME type (that is, the MIME types have the same media type, media subtype, and parameters), and has the ... |
@PreAuthorize("hasRole('ROLE_USER_MANAGER')") @Transactional(readOnly=false,propagation=Propagation.REQUIRED) @Caching(evict={@CacheEvict(value="user",key="#user?.id"),@CacheEvict(value="user",key="#user?.username")}) public void updateUser(User user) throws RootNotModifiableException, RequiredFieldMissingException {
... | Update given User, after checking required fields. |
String readNumber(String source,int ofs,String token,boolean adjacent){
if (adjacent) {
return source.substring(ofs,ofs + token.length());
}
int len=source.length();
for (int i=ofs; i < len; i++) {
char ch=source.charAt(i);
if (isNumeric(ch) == false) {
if (i == 0) {
return null;
... | Read the number. Does not attempt to parse. |
@Override public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
String str;
TextView tv=new TextView(this);
tv.setText(test());
setContentView(tv);
}
| Called when the activity is first created. |
public void addNewFontWizard(){
AddResourceDialog addResource=new AddResourceDialog(loadedResources,AddResourceDialog.FONT);
if (JOptionPane.OK_OPTION == JOptionPane.showConfirmDialog(mainPanel,addResource,"Add Font",JOptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE)) {
if (addResource.checkName(loadedReso... | Invoked by the "..." button in the add theme entry dialog, allows us to add a font on the fly while working on a theme |
public dt addElement(String element){
addElementToRegistry(element);
return (this);
}
| Adds an Element to the element. |
private void createAccount(){
createAccount(dataTable);
if (listCreated.length() > 0) ADialog.info(m_WindowNo,panel,"ChargeCreated",listCreated.toString());
if (listRejected.length() > 0) ADialog.error(m_WindowNo,panel,"ChargeNotCreated",listRejected.toString());
}
| Create Charges from Accounts |
public static void fill(short[] a,short val){
for (int i=0, len=a.length; i < len; i++) a[i]=val;
}
| Assigns the specified short value to each element of the specified array of shorts. |
@Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case GamlPackage.PRAGMA__NAME:
setName((String)newValue);
return;
}
super.eSet(featureID,newValue);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
protected String[] tokenize(String text) throws IOException {
Collection<String> result=new LinkedList<>();
for ( String textFieldName : textFieldNames) {
try (TokenStream tokenStream=analyzer.tokenStream(textFieldName,text)){
CharTermAttribute charTermAttribute=tokenStream.addAttribute(CharTermAttribute... | tokenize a <code>String</code> on this classifier's text fields and analyzer |
public boolean hasFormat(){
return format != null;
}
| True if the output has received a format. False otherwise. |
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
| Used to communicate a progress update between a plugin tool and the main Whitebox user interface. |
private Automaton verifyTopoSort(Automaton a){
int[] sorted=Operations.topoSortStates(a);
assertTrue(sorted.length <= a.getNumStates());
Automaton a2=new Automaton();
int[] stateMap=new int[a.getNumStates()];
Arrays.fill(stateMap,-1);
Transition transition=new Transition();
for ( int state : sorted) {
... | Runs topo sort, verifies transitions then only "go forwards", and builds and returns new automaton with those remapped toposorted states. |
private void createToken(){
Intent intent=new Intent(this,TokenAdd.class);
startActivityForResult(intent,ACTIVITY_ADD_TOKEN);
}
| Starts the process of creating a new token in the application |
public ToHitData(int value,String desc){
this(value,desc,HIT_NORMAL,SIDE_FRONT);
}
| Construct with value and desc. Other values default. |
public UnsupportedQueryResultFormatException(String msg,Throwable cause){
super(msg,cause);
}
| Creates a new UnsupportedRDFormatException wrapping another exception. |
public static HostInitiatorInfo parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception {
HostInitiatorInfo object=new HostInitiatorInfo();
int event;
java.lang.String nillableValue=null;
java.lang.String prefix="";
java.lang.String namespaceuri="";
try {
while (!reader.isStartElement(... | 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... |
public static float[] append(float buffer[],float newElement){
float[] t=resize(buffer,buffer.length + 1);
t[buffer.length]=newElement;
return t;
}
| Appends an element to <code>float</code> array. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.