code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
private void initialize(){
this.setSize(396,325);
this.setTitle("Add a new user...");
this.setContentPane(getJContentPane());
}
| This method initializes this |
protected void checkType(Object object){
if (object == null) {
throw new NullPointerException("Sequences cannot contain null, use a List instead");
}
if (type != null) {
if (!type.isInstance(object)) {
throw new IllegalArgumentException("Invalid type of argument for sequence of type: " + type.getNam... | Checks that the given object instance is of the correct type otherwise a runtime exception is thrown |
public void loadTableLocal(byte[] tableKey,Result<TableKraken> result){
if (tableKey == null) {
result.ok(null);
return;
}
TableKraken table=_tableManager.getTable(tableKey);
if (table != null) {
result.ok(table);
return;
}
RowCursor cursor=_metaTable.cursor();
cursor.setBytes(1,tableKey,0... | Loads and creates a table from the local meta-table. |
public Z21ReporterManager(Z21SystemConnectionMemo memo){
_memo=memo;
if (InstanceManager.getDefault(RailComManager.class) == null) {
InstanceManager.setDefault(RailComManager.class,new jmri.managers.DefaultRailComManager());
}
}
| Create a new Z21ReporterManager |
public synchronized Enumeration<V> elements(){
return this.<V>getEnumeration(VALUES);
}
| Returns an enumeration of the values in this hashtable. Use the Enumeration methods on the returned object to fetch the elements sequentially. |
private void generatePatternBitmap(){
if (getBounds().width() <= 0 || getBounds().height() <= 0) {
return;
}
mBitmap=Bitmap.createBitmap(getBounds().width(),getBounds().height(),Config.ARGB_8888);
Canvas canvas=new Canvas(mBitmap);
Rect r=new Rect();
boolean verticalStartWhite=true;
for (int i=0; i <=... | This will generate a bitmap with the pattern as big as the rectangle we were allow to draw on. We do this to chache the bitmap so we don't need to recreate it each time draw() is called since it takes a few milliseconds. |
public void deployContext(String path,URL config,boolean update,String tag) throws TomcatManagerException, IOException {
deployContext(path,config,null,update,tag);
}
| Deploys the specified context XML configuration to the specified context path, optionally undeploying the webapp if it already exists and using the specified tag name. |
public Set<A> plus(A a){
if (isEmpty()) {
return new Set<>(a.hashCode(),List.of(a),Set.empty(),Set.empty());
}
int ahc=a.hashCode();
switch (Ordering.compare(ahc,hc)) {
case EQ:
return bucket.contains(a) ? this : withBucket(bucket.plus(a));
case LT:
return withLeft(left.plus(a));
case GT:
return withRig... | Contructs a new set which contains all elements of the current set, as well as the given value. If the value is already there, a reference of the current set will be returned. |
private void checkSuicideUnits(final IDelegateBridge bridge){
if (isDefendingSuicideAndMunitionUnitsDoNotFire()) {
final List<Unit> deadUnits=Match.getMatches(m_attackingUnits,Matches.UnitIsSuicide);
getDisplay(bridge).deadUnitNotification(m_battleID,m_attacker,deadUnits,m_dependentUnits);
remove(deadUnit... | Check for suicide units and kill them immediately (they get to shoot back, which is the point) |
public static IFilledList<INaviView> loadMixedgraphs(final AbstractSQLProvider provider,final CModule module,final CTagManager viewTagManager,final CTagManager nodeTagManager) throws CouldntLoadDataException {
checkArguments(provider,module,viewTagManager);
final String query="SELECT * FROM load_module_mixed_graph(... | Loads the mixed-graph views of a module. These mixed graph views are necessarily non-native because there are no native mixed graph views. The module, the view tag manager, and the node tag manager must be stored in the database connected to by the provider argument. |
public String certToString(){
StringBuilder sb=new StringBuilder();
X509CertImpl x509Cert=null;
try {
x509Cert=X509CertImpl.toImpl(cert);
}
catch ( CertificateException ce) {
if (debug != null) {
debug.println("Vertex.certToString() unexpected exception");
ce.printStackTrace();
}
r... | Return string representation of this vertex's certificate information. |
@Nullable public GdbInfoLine next() throws IOException, InterruptedException, DebuggerException {
sendCommand("next");
GdbInfoProgram gdbInfoProgram=infoProgram();
if (gdbInfoProgram.getStoppedAddress() == null) {
return null;
}
return infoLine();
}
| `next` command. |
public static String convertToTitle(int n){
if (n <= 0) return "";
StringBuilder title=new StringBuilder();
while (n > 0) {
n--;
int r=n % 26;
title.insert(0,(char)('A' + r));
n=n / 26;
}
return title.toString();
}
| Get the remainder in each loop It should be the last digit Note that the map shall have 1 offset |
@Nullable private Object[] readQueryArgs(BinaryRawReaderEx reader){
int cnt=reader.readInt();
if (cnt > 0) {
Object[] args=new Object[cnt];
for (int i=0; i < cnt; i++) args[i]=reader.readObjectDetached();
return args;
}
else return null;
}
| Read arguments for SQL query. |
private void multShiftSub(IntegerPolynomial b,int c,int k,int p){
int N=coeffs.length;
for (int i=k; i < N; i++) {
coeffs[i]=(coeffs[i] - b.coeffs[i - k] * c) % p;
}
}
| Computes <code>this-b*c*(x^k) mod p</code> and stores the result in this polynomial.<br/> See steps 4a,4b in EESS algorithm 2.2.7.1. |
public boolean isShowGridX(){
return mShowGridX;
}
| Returns if the X axis grid should be visible. |
private void maybeMovePool(Transaction tx,String context){
checkState(lock.isHeldByCurrentThread());
if (tx.isEveryOwnedOutputSpent(this)) {
if (unspent.remove(tx.getHash()) != null) {
if (log.isInfoEnabled()) {
log.info(" {} {} <-unspent ->spent",tx.getHashAsString(),context);
}
spen... | If the transactions outputs are all marked as spent, and it's in the unspent map, move it. If the owned transactions outputs are not all marked as spent, and it's in the spent map, move it. |
public void overEquals(double c){
for (int i=0; i < order + 1; i++) a[i]/=c;
}
| Divides this polynomial by a constant. This polynomial is altered to contain the result of division. |
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){
switch (featureID) {
case GamlPackage.GAML_DEFINITION__NAME:
return getName();
}
return super.eGet(featureID,resolve,coreType);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public ObjectModel(){
}
| Creates a new, empty object. |
@Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case SexecPackage.TRACE_STATE_EXITED__STATE:
setState((ExecutionState)newValue);
return;
}
super.eSet(featureID,newValue);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public long key(){
return _map._set[_index];
}
| Provides access to the key of the mapping at the iterator's position. Note that you must <tt>advance()</tt> the iterator at least once before invoking this method. |
public static boolean contains(final String key){
return getOptimusPref().contains(key);
}
| checks whether a value is stored for the given key. |
public void testFailoverReadOnly() throws Exception {
Set<String> downedHosts=new HashSet<String>();
downedHosts.add(HOST_1);
Properties props=new Properties();
props.setProperty("retriesAllDown","2");
for ( boolean foReadOnly : new boolean[]{true,false}) {
props.setProperty("failOverReadOnly",Boolean.to... | Tests the property 'failOverReadOnly' in a failover connection using three hosts and the following sequence of events: - [\HOST_1 : /HOST_2 : /HOST_3] --> HOST_2 - [\HOST_1 : \HOST_2 : /HOST_3] --> HOST_3 - [\HOST_1 : /HOST_2 : \HOST_3] --> HOST_2 - [/HOST_1 : \HOST_2 : \HOST_3] --> HOST_1 - [\HOST_1 : \HOST_2 : /HOST_... |
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 XMLElement2 createAnotherElement(){
return new XMLElement2(this.entities,this.ignoreWhitespace,false,this.ignoreCase);
}
| Creates a new similar XML element. <P> You should override this method when subclassing XMLElement. |
public void cancel(){
cancel=true;
}
| Call this method to cancel the drag reposition action |
public void addRoundRectangle(final float x,final float y,final float width,final float height,final float arcWidth,final float arcHeight){
if (this.isDisposed()) {
SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
}
this.cubicTo(x,y,x,y,x,y + arcHeight);
this.cubicTo(x,y,x,y,x + arcWidth,y);
this.cubicTo(x + width,... | Adds to the receiver the round-cornered rectangle specified by x, y, width and height. |
public void clearOverlay(){
mRelativeLayout.removeAllViews();
mOverlay.hide();
}
| Clear focus highlighting |
public final boolean sendEmptyMessage(int what){
return mExec.sendEmptyMessage(what);
}
| Sends a Message containing only the what value. |
@Override public byte[] serializeVal(final V obj){
return SerializerUtil.serialize(obj);
}
| Serializes the object as a byte[] using Java default serialization. |
public void update(final String collectionName,final Map<String,Object> query,final Map<String,Object> data){
update(collectionName,query,data,emptyMap());
}
| Insert given data into the specified collection |
private void showFeedback(String message){
if (myHost != null) {
myHost.showFeedback(message);
}
else {
System.out.println(message);
}
}
| Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface. |
public boolean equals(Object obj){
if (!super.equals(obj)) {
return false;
}
CSSAttributeCondition c=(CSSAttributeCondition)obj;
return (c.namespaceURI.equals(namespaceURI) && c.localName.equals(localName) && c.specified == specified);
}
| Indicates whether some other object is "equal to" this one. |
public BasicTreeNode(String text){
this(text,null);
}
| Create a node with text. |
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
request.getSession().setAttribute("school","hebeu");
response.sendRedirect("servlet/SchoolServlet");
return;
}
| The doGet method of the servlet. <br> This method is called when a form has its tag value method equals to get. |
public Object clone(){
BooleanArrayList clone=new BooleanArrayList((boolean[])elements.clone());
clone.setSizeRaw(size);
return clone;
}
| Returns a deep copy of the receiver. |
public ReplDBMSEvent filter(ReplDBMSEvent event) throws ReplicatorException, InterruptedException {
boolean schemaChange=false;
boolean truncate=false;
ArrayList<DBMSData> data=event.getData();
if (data == null) return event;
for (Iterator<DBMSData> iterator=data.iterator(); iterator.hasNext(); ) {
DBMS... | Checks transactions for statements that correspond to schema changes that affect tables. |
String waitForCompletion(ClientResponse asyncResponse){
return waitForCompletion(asyncResponse,maxAsyncPollingRetries);
}
| Polls for asynchronous completion using the default maximum retries. |
public static String[] appendSelectionArgs(String[] originalValues,String[] newValues){
if (originalValues == null || originalValues.length == 0) {
return newValues;
}
String[] result=new String[originalValues.length + newValues.length];
System.arraycopy(originalValues,0,result,0,originalValues.length);
S... | Appends one set of selection args to another. This is useful when adding a selection argument to a user provided set. |
public boolean reverseCorrectIt(){
log.info(toString());
m_processMsg=ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
if (m_processMsg != null) return false;
MDocType dt=MDocType.get(getCtx(),getC_DocType_ID());
MPeriod.testPeriodOpen(getCtx(),getMovementDate()... | Reverse Correction |
public void addChartOptions(final XToolBar toolBar){
}
| Adds the option components of the chart to the specified tool bar. <p> This implementation does not add any components. </p> |
static void generateAttributeMetamodel(final Tree.TypedDeclaration that,final boolean addGetter,final boolean addSetter,GenerateJsVisitor gen){
Scope _scope=that.getScope();
while (_scope != null) {
if (_scope instanceof Declaration) {
if (_scope instanceof Function) return;
else break;
}... | Generate runtime metamodel info for an attribute declaration or definition. |
public final double[] toArray(){
double[][][] field=this.field;
double[][] fieldx=null;
double[] fieldxy=null;
final int width=this.width;
final int height=this.height;
final int length=this.length;
double[] vals=new double[width * height * length];
int i=0;
for (int x=0; x < width; x++) {
fieldx=... | Flattens the grid to a one-dimensional array, storing the elements in row-major order,including duplicates and null values. Returns the grid. |
private void addFeedback(Utterance utterance,AccessibilityNodeInfoCompat announcedNode){
if (announcedNode == null) {
return;
}
final AccessibilityNodeInfoCompat scrollableNode=AccessibilityNodeInfoUtils.getSelfOrMatchingAncestor(announcedNode,AccessibilityNodeInfoUtils.FILTER_SCROLLABLE);
final boolean use... | Adds auditory and haptic feedback for a focused node. |
private void fixGetSet(HashMap<String,HashMap<Object,Object>> propertyTable) throws IntrospectionException {
if (propertyTable == null) {
return;
}
for ( Map.Entry<String,HashMap<Object,Object>> entry : propertyTable.entrySet()) {
HashMap<Object,Object> table=entry.getValue();
ArrayList<?> getters=(A... | Checks and fixs all cases when several incompatible checkers / getters were specified for single property. |
@Field(6) public __VARIANT_NAME_3_union boolVal(int boolVal){
this.io.setIntField(this,6,boolVal);
return this;
}
| VT_BOOL<br> C type : VARIANT_BOOL |
private String guessParameterName(String value){
if (VCardDataType.find(value) != null) {
return VCardParameters.VALUE;
}
if (Encoding.find(value) != null) {
return VCardParameters.ENCODING;
}
return VCardParameters.TYPE;
}
| Makes a guess as to what a parameter value's name should be. |
@Override public boolean onTouchEvent(MotionEvent event){
if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) {
cancelAllAnimations();
}
if (event.getPointerCount() > 1) {
mMidPntX=(event.getX(0) + event.getX(1)) / 2;
mMidPntY=(event.getY(0) + event.getY(1)) / 2;
}
mGestu... | If it's ACTION_DOWN event - user touches the screen and all current animation must be canceled. If it's ACTION_UP event - user removed all fingers from the screen and current image position must be corrected. If there are more than 2 fingers - update focal point coordinates. Pass the event to the gesture detectors if t... |
public K keyAt(int index){
return (K)mArray[index << 1];
}
| Return the key at the given index in the array. |
public DiscreteInterpolation(){
}
| Creates a new instance of DiscreteInterpolation |
public OMGraphic create(String classname,GraphicAttributes ga,DrawingToolRequestor requestor,boolean showGUI){
if (getCurrentEditable() != null) {
if (DEBUG) {
Debug.output("OMDrawingTool.edit(): can't create " + classname + ", drawing tool busy with another graphic.");
}
return null;
}
if (DEBU... | Create a new OMGraphic, encased in a new EditableOMGraphic that can modify it. If a loader cannot be found that can handle a graphic with the given classname, this method will return a null object. This method gives you the option of suppressing the GUI for the EditableOMGraphic. If you aren't sure of the behavior mask... |
public void print(StringBuilder sb,int indent,Verbosity verbosity){
indent(sb,indent).append("ledger[").append(ledgerId).append("] allocator: ").append(allocator.name).append("), isOwning: ").append(owningLedger == this).append(", size: ").append(size).append(", references: ").append(bufRefCnt.get()).append(", life: ... | Print the current ledger state to a the provided StringBuilder. |
private void mapOldFramesToNew(int isolateId){
ArrayList<DStackContext> previousFrames=null;
ArrayList<DStackContext> frames=null;
Map<Long,DValue> previousValues=null;
previousFrames=getIsolateState(isolateId).m_previousFrames;
frames=getIsolateState(isolateId).m_frames;
previousValues=getIsolateState(isol... | Correlates the old list of stack frames, from the last time the player was suspended, with the new list of stack frames, attempting to guess which frames correspond to each other. This is done so that Variable.hasValueChanged() can work correctly for local variables. |
public String commandId(String sensorId,String commandId){
return sensorId + "." + commandId;
}
| Compose a IotpDevice commandId for the sensor |
public String toValue(){
return value;
}
| Returns the value used in the XML. |
public void reset(){
token=null;
status=S_INIT;
handlerStatusStack=null;
}
| Reset the parser to the initial state without resetting the underlying reader. |
public OMColor(float a,float r,float g,float b){
super(r,g,b);
argb=(((int)(a * 255)) << 24) | (((int)(r * 255) & 0xFF) << 16) | (((int)(g * 255) & 0xFF) << 8)| (((int)(b * 255) & 0xFF) << 0);
}
| Create a color with the specified red, green, and blue values, where each of the values is in the range 0.0-1.0. The value 0.0 indicates no contribution from the primary color component. The value 1.0 indicates the maximum intensity of the primary color component. // |
public MaterialCamera stillShot(){
mStillShot=true;
return this;
}
| Will take a still shot instead of recording. |
private void fillDots(){
for (int fillLoop=0; fillLoop <= mCurrentPage; fillLoop++) {
((ImageView)findViewById(fillLoop)).setImageDrawable(mCircleDrawable.getCurrent());
}
for (int unFillLoop=mCurrentPage + 1; unFillLoop < mMaxPage; unFillLoop++) {
((ImageView)findViewById(unFillLoop)).setImageDrawable(mS... | Filling the canvas with the indicators |
public void insert(int index,List<Node> rootNodes){
insert(roots,index,rootNodes);
}
| Inserts the given models at the given index in the list of root nodes |
public static String toString(DBIDRef id){
return DBIDFactory.FACTORY.toString(id);
}
| Format a DBID as string. |
@Check public void checkForInLoop(ForStatement forStatement){
if (forStatement.isForIn()) {
TypeRef loopVarType=null;
EObject location=null;
RuleEnvironment G=(RuleEnvironment)getContext().get(RuleEnvironment.class);
if (G == null) return;
if (!forStatement.getVarDeclsOrBindings().isEmpty()) {... | 9.1.4 Iteration Statements, Constraints 118 (For-In-Statement Constraints) Variable declaration must be a string |
public AbstractMTreeNode(int capacity,boolean isLeaf,Class<? super E> eclass){
super(capacity,isLeaf,eclass);
}
| Creates a new MTreeNode with the specified parameters. |
public boolean allEmpty(List list){
int size=list.size();
for (int i=0; i < size; i++) {
if (list.get(i) != null && list.get(i).toString().length() > 0) {
return false;
}
}
return true;
}
| Check to see if all the string objects passed in are empty. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:57:00.677 -0500",hash_original_method="5393979ADC62E28ADD27F66A98DE94B1",hash_generated_method="E5BF9B5D16592C07021AAD713B61E5BA") public static String decode(byte[] in,char[] out,int offset,int utfSize) throws UTFDataFormatException {... | Decodes a byte array containing <i>modified UTF-8</i> bytes into a string. <p>Note that although this method decodes the (supposedly impossible) zero byte to U+0000, that's what the RI does too. |
private DeleteDocumentCommand(){
}
| This is a singleton. |
public SolrQuery addSort(SortClause sortClause){
if (sortClauses == null) sortClauses=new ArrayList<>();
sortClauses.add(sortClause);
serializeSorts();
return this;
}
| Adds a single sort clause to the end of the query. |
public IssuingDistributionPointExtension(DistributionPointName distributionPoint,ReasonFlags revocationReasons,boolean hasOnlyUserCerts,boolean hasOnlyCACerts,boolean hasOnlyAttributeCerts,boolean isIndirectCRL) throws IOException {
if ((hasOnlyUserCerts && (hasOnlyCACerts || hasOnlyAttributeCerts)) || (hasOnlyCACert... | Creates a critical IssuingDistributionPointExtension. |
@Override public void eUnset(int featureID){
switch (featureID) {
case RegularExpressionPackage.REGULAR_EXPRESSION_BODY__PATTERN:
setPattern((Pattern)null);
return;
}
super.eUnset(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static Pair<String,String> generateSaltedPassword(String password){
String salt=RandomStringUtils.randomAlphanumeric(Default_Salt_Length);
String saltedPassword=new Sha512Hash(password.getBytes(Charsets.UTF_8),salt.getBytes(Charsets.UTF_8),Default_HashIterations).toHex();
return Pair.of(salt,saltedPassword... | return <salt, saltedPassword> |
public void initializePackageContents(){
if (isInitialized) return;
isInitialized=true;
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
EcorePackage theEcorePackage=(EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
docletEClass.getESuperTypes().add(this.getComposite... | Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc --> |
public Matrix4d translationRotateScale(Vector3dc translation,Quaterniondc quat,double scale){
return translationRotateScale(translation.x(),translation.y(),translation.z(),quat.x(),quat.y(),quat.z(),quat.w(),scale,scale,scale);
}
| Set <code>this</code> matrix to <tt>T * R * S</tt>, where <tt>T</tt> is the given <code>translation</code>, <tt>R</tt> is a rotation transformation specified by the given quaternion, and <tt>S</tt> is a scaling transformation which scales all three axes by <code>scale</code>. <p> When transforming a vector by the resul... |
public static IntLiteral makeIntLiteral(char[] token,ASTNode source){
int pS=source == null ? 0 : source.sourceStart, pE=source == null ? 0 : source.sourceEnd;
IntLiteral result;
try {
if (intLiteralConstructor != null) {
result=intLiteralConstructor.newInstance(token,pS,pE);
}
else {
result=... | In eclipse 3.7+, IntLiterals are created using a factory-method Unfortunately that means we need to use reflection as we want to be compatible with eclipse versions before 3.7. |
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
}
| Adds semantic checks to the default deserialization method. This method must have the standard signature for a readObject method, and the body of the method must begin with "s.defaultReadObject();". Other than that, any semantic checks can be specified and do not need to stay the same from version to version. A readObj... |
public void warn(String format,Object arg1,Object arg2){
formatAndLog(Log.WARN,format,arg1,arg2);
}
| Log a message at the WARN level according to the specified format and arguments. <p> This form avoids superfluous object creation when the logger is disabled for the WARN level. </p> |
public void keyPressed(KeyEvent e){
((KeyListener)a).keyPressed(e);
((KeyListener)b).keyPressed(e);
}
| Handles the keyPressed event by invoking the keyPressed methods on listener-a and listener-b. |
public void scale(final double scale){
this.matrix.scale(scale);
}
| Scales this vector by dividing all of its elements by the specified factor. |
public ItemEvent(ItemSelectable source,int id,Object item,int stateChange){
super(source,id);
this.item=item;
this.stateChange=stateChange;
}
| Constructs an <code>ItemEvent</code> object. <p> This method throws an <code>IllegalArgumentException</code> if <code>source</code> is <code>null</code>. |
public static void serializeTableFeaturesReply(List<OFTableFeaturesStatsReply> tableFeaturesReplies,JsonGenerator jGen) throws IOException, JsonProcessingException {
OFTableFeaturesStatsReply tableFeaturesReply=tableFeaturesReplies.get(0);
jGen.writeStringField("version",tableFeaturesReply.getVersion().toString());... | Serializes Table Features Reply |
public boolean isAllowSyntheticDefaultImports(){
return allowSyntheticDefaultImports;
}
| Allow default imports from modules with no default export. This does not affect code emit, just typechecking. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-06 12:50:59.186 -0400",hash_original_method="443D4D0ED29B98EE49439D994126F289",hash_generated_method="C2F95FF4A943FF66CDE846512C13DDCE") public boolean isCancelling(){
return mCanceling;
}
| Gets whether this print is being cancelled. |
protected void paintActiveLinkArrow(Graphics2D g2,Link activeLink){
if (activeLink == null) return;
MutableCoord P1=transform(activeLink.getFromNode().getCoord());
MutableCoord P2=transform(activeLink.getToNode().getCoord());
AffineTransform tx=new AffineTransform();
Line2D.Double lines=new Line2D.Double(P1... | Paints the active link direction arrow |
private void writeObject(ObjectOutputStream out) throws ClassNotFoundException, IOException {
out.defaultWriteObject();
out.writeObject(SerializationUtils.wrap(errorStroke));
}
| Custom serialization method. |
public static void forEachValuePair(LIR lir,AbstractBlockBase<?> toBlock,AbstractBlockBase<?> fromBlock,PhiValueVisitor visitor){
assert Arrays.asList(toBlock.getPredecessors()).contains(fromBlock) : String.format("%s not in predecessor list: %s",fromBlock,Arrays.toString(toBlock.getPredecessors()));
assert fromBlo... | Visits each SIGMA/PHI value pair of an edge, i.e. the outgoing value from the predecessor and the incoming value to the merge block. |
@VisibleForTesting public void processEnableFullscreenRunnableForTest(){
if (mHandler.hasMessages(MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD)) {
mHandler.removeMessages(MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD);
enableFullscreenAfterLoad();
}
}
| Removes the enable fullscreen runnable from the UI queue and runs it immediately. |
public ColorStateList withAlpha(int alpha){
int[] colors=new int[mColors.length];
int len=colors.length;
for (int i=0; i < len; i++) {
colors[i]=(mColors[i] & 0xFFFFFF) | (alpha << 24);
}
return new ColorStateList(mStateSpecs,colors);
}
| Creates a new ColorStateList that has the same states and colors as this one but where each color has the specified alpha value (0-255). |
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:58:21.489 -0500",hash_original_method="4D0156FCE32C3B62D3099FB0908581D6",hash_generated_method="1B3832723BC3034606D499CCE41B0CA4") private void sendSmsAckForEnvelopeResponse(Icc... | Handle the response to the ENVELOPE command. |
public long replace(ContentValues values){
return insertInternal(values,true);
}
| Performs an insert, adding a new row with the given values. If the table contains conflicting rows, they are deleted and replaced with the new row. |
public static void uniteSameRoutesWithJustDifferentDepartures(TransitSchedule schedule){
log.info("Combining TransitRoutes with identical stop sequence...");
long totalNumberOfDepartures=0;
long departuresWithChangedSchedules=0;
long totalNumberOfStops=0;
long stopsWithChangedTimes=0;
double changedTotalTim... | Combines TransitRoutes with an identical stop sequence and combines them to one |
public void onStartButtonPressed(View view){
mGameViews.getStartMenuFragment().onStartButtonPressed();
}
| Responsible for transitioning from the start menu UI to the mission selection menu UI |
protected void layoutMajorAxis(int targetSpan,int axis,int[] offsets,int[] spans){
if (children == null) {
init();
}
SizeRequirements.calculateTiledPositions(targetSpan,null,getChildRequests(targetSpan,axis),offsets,spans);
}
| Perform layout for the major axis of the box (i.e. the axis that it represents). The results of the layout should be placed in the given arrays which represent the allocations to the children along the major axis. |
int lanso(SMat A,int iterations,int dimensions,double endl,double endr,double[] ritz,double[] bnd,double[][] wptr,int[] neigp,int n){
double[] alf, eta, oldeta, bet, wrk;
int ll, neig, j=0, intro=0, last, i, l, id3, first;
boolean ENOUGH;
alf=wptr[6];
eta=wptr[7];
oldeta=wptr[8];
bet=wptr[9];
wrk=wptr[5... | Description ----------- Function determines when the restart of the Lanczos algorithm should occur and when it should terminate. Arguments --------- (input) n dimension of the eigenproblem for matrix B iterations upper limit of desired number of lanczos steps dimensions upper limit of desired... |
private UnManagedVolume createUnManagedClone(VolumeClone driverClone,UnManagedVolume parentUnManagedVolume,com.emc.storageos.db.client.model.StorageSystem storageSystem,com.emc.storageos.db.client.model.StoragePool storagePool,List<UnManagedVolume> unManagedVolumesToCreate,List<UnManagedVolume> unManagedVolumesToUpdate... | Create new or update existing unManaged clone with driver clone discovery data. |
public StringPrinter(Consumer<String> consumer){
this.consumer=consumer;
}
| StringPrinter will pass all the strings it receives to the given consumer. |
public void gameKeyPress(int gameKey){
TestUtils.gameKeyPress(gameKey);
}
| This method just invokes the test utils method, it is here for convenience |
public void doTestIndexWriterReopenSegment(boolean doFullMerge) throws Exception {
Directory dir1=getAssertNoDeletesDirectory(newDirectory());
IndexWriter writer=new IndexWriter(dir1,newIndexWriterConfig(new MockAnalyzer(random())));
IndexReader r1=writer.getReader();
assertEquals(0,r1.maxDoc());
createIndexN... | Tests creating a segment, then check to insure the segment can be seen via IW.getReader |
public MAttachmentEntry(String name,byte[] data,int index){
super();
setName(name);
setData(data);
if (index > 0) m_index=index;
else {
long now=System.currentTimeMillis();
if (s_seed + 3600000l < now) {
s_seed=now;
s_random=new Random(s_seed);
}
m_index=s_random.nextInt();
}
}
| Attachment Entry |
private void returnData(Object ret){
if (myHost != null) {
myHost.returnData(ret);
}
}
| Used to communicate a return object from a plugin tool to the main Whitebox user-interface. |
public RrdDef(String path,long step){
this(path);
if (step <= 0) {
throw new IllegalArgumentException("Invalid RRD step specified: " + step);
}
this.step=step;
}
| Creates new RRD definition object with the given path and step. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.