code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public Operation(int nTail,int nHead,int nOperation){
m_nHead=nHead;
m_nTail=nTail;
m_nOperation=nOperation;
}
| c'tor + initializers |
public SetSkuQuantityToCartEventCommandImpl(final ShoppingCartCommandRegistry registry,final PriceService priceService,final PricingPolicyProvider pricingPolicyProvider,final ProductService productService,final ShopService shopService,final ProductQuantityStrategy productQuantityStrategy){
super(registry,priceService... | Construct sku command. |
public void assertLabel(int[] path,String text){
TestUtils.assertLabel(path,text);
}
| This method just invokes the test utils method, it is here for convenience |
public ObjectStreamField(String name,Class<?> cl){
if (name == null) {
throw new NullPointerException("name == null");
}
else if (cl == null) {
throw new NullPointerException("cl == null");
}
this.name=name;
this.type=new WeakReference<Class<?>>(cl);
}
| Constructs an ObjectStreamField with the specified name and type. |
ByteVector put11(final int b1,final int b2){
int length=this.length;
if (length + 2 > data.length) {
enlarge(2);
}
byte[] data=this.data;
data[length++]=(byte)b1;
data[length++]=(byte)b2;
this.length=length;
return this;
}
| Puts two bytes into this byte vector. The byte vector is automatically enlarged if necessary. |
SkinPaletteSelector(SkinColorSelectionModel model){
super(model);
}
| Create a new SkinPaletteSelector. |
public <T>List<T> createListDtoFromJson(String json,Class<T> dtoInterface){
final DtoProvider<T> dtoProvider=getDtoProvider(dtoInterface);
final JSONArray jsonArray=JSONParser.parseStrict(json).isArray();
final List<T> result=new ArrayList<>();
for (int i=0; i < jsonArray.size(); i++) {
String payload=jsonA... | Parses the JSON data from the specified sting into list of objects of the specified type. |
private static int map(int x,int in_min,int in_max,int out_min,int out_max){
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
| Maps a given value x from one input range [in_min, in_max] to another output range [out_min, out-max]. |
public static _GetOption fromString(final String value) throws SOAPSerializationException {
return (_GetOption)Enumeration.fromString(value,_GetOption.VALUES_TO_INSTANCES);
}
| Gets the specific enumeration value in this class appropriate for the given XML attribute value. If no value is known, null is returned (_DEFAULT is not used; that value is for when the attribute is not present). |
Model learn(ExampleSet trainingSet) throws OperatorException {
innerTrainSetSource.deliver(trainingSet);
getSubprocess(1).execute();
return innerModelSink.getData(Model.class);
}
| Applies the learner. |
private boolean isActiveSMISProvider(String smisProviderURI) throws IOException {
_logger.debug("Entering {}",Thread.currentThread().getStackTrace()[1].getMethodName());
Set<String> activeSMISProvidersFromDB=getAllActiveSMISProviderFromDB();
_logger.debug("Exiting {}",Thread.currentThread().getStackTrace()[1].get... | Checks the given SMIS provider is active or Passive |
public static boolean isOptional(BOp node){
return node instanceof IJoinNode && ((IJoinNode)node).isOptional();
}
| Checks whether a given node is an OPTIONAL node. |
public final void testValidateFails(){
IPv6AddressValidator iPv4AddressValidator=new IPv6AddressValidator("foo");
assertFalse(iPv4AddressValidator.validate("FE80:0000:0000:0000:0202:B3XX:FE1E:8329"));
assertFalse(iPv4AddressValidator.validate("FE80:0000:0000:0000:0202:B3FF:FE1E:8329:3492"));
}
| Tests the functionality of the validate-method, if it fails. |
private void elementDecl(XSElementDecl decl,String extraAtts){
XSType type=decl.getType();
String str=MessageFormat.format("Element name=\"{0}\"{1}{2}",new Object[]{decl.getName(),type.isLocal() ? "" : " type=\"{" + type.getTargetNamespace() + "}"+ type.getName()+ "\"",extraAtts});
SchemaTreeNode newNode=new Sche... | Creates node for element declaration with additional attributes. |
private boolean redirectCarsFromAlternateTrack(){
if (!Setup.isBuildAggressive()) {
return false;
}
boolean redirected=false;
List<RollingStock> cars=carManager.getByTrainList(_train);
for ( RollingStock rs : cars) {
Car car=(Car)rs;
if (car.getFinalDestination() == null || car.getFinalDestinatio... | Checks to see if cars that are already in the train can be redirected from the alternate track to the spur that really wants the car. Fixes the issue of having cars placed at the alternate when the spur's cars get pulled by this train, but cars were sent to the alternate because the spur was full at the time it was tes... |
public boolean isNavigationAtBottom(){
return (mSmallestWidthDp >= 600 || mInPortrait);
}
| Should a navigation bar appear at the bottom of the screen in the current device configuration? A navigation bar may appear on the right side of the screen in certain configurations. |
@Override public int compare(MovePath mp1,MovePath mp2){
int d1=mp1.getFinalCoords().distance(destination);
int d2=mp2.getFinalCoords().distance(destination);
if (d1 != d2) return d1 - d2;
else return mp1.getMpUsed() - mp2.getMpUsed();
}
| Compares MovePaths based on distance from final position to destination. If those distances are equal then spent movement points are compared. |
public HtmlElement(final String label,final By by){
this.label=label;
this.by=by;
}
| Find element using BY locator. Make sure to initialize the driver before calling findElement() |
protected void removeChild(final AbstractNode child){
assert child != null;
assert !child.deleted;
assert child.parent.get() == this;
assert dirty;
assert !deleted;
assert !isPersistent();
assert !isReadOnly();
final BTree btree=(BTree)this.btree;
if (btree.debug) assertInvariants();
if (DEBUG) {
... | Invoked when a non-root node or leaf has no more keys to detach the child from its parent. If the node becomes deficient, then the node is joined with one of its immediate siblings. If the node is the root of the tree, then the root of the tree is also updated. The child is deleted as a post-condition. |
public final int numberOfNodes(){
int n=0;
if (root == null) return n;
for (Enumeration<TreeNode> e=elements(); e.hasMoreElements(); ) {
e.nextElement();
n++;
}
return n;
}
| Counts and returns the number of nodes |
public boolean isConnected(){
if (connection == null) {
LOG.debug("Not connected to vSphere. URL: " + url + ", UserId: "+ user);
return false;
}
try {
long ref=System.currentTimeMillis();
new ManagedObjectAccessor(connection).getDecendentMoRef(null,"VirtualMachine","no-name");
LOG.debug("vSphe... | Returns whether the connection has been established |
public EventStoreBuilder useSslConnection(String certificateCommonName){
settingsBuilder.sslSettings(SslSettings.trustCertificateCN(certificateCommonName));
return this;
}
| Enables connection encryption using SSL and trusts an X.509 server certificate whose Common Name (CN) matches. |
public Property year(){
return new Property(this,getChronology().year());
}
| Get the year property. |
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
setMeasuredDimension(getResources().getDisplayMetrics().widthPixels,DisplayUtils.getStatusBarHeight(getResources()));
}
| <br> UI. |
public Enumeration<Option> listOptions(){
Vector<Option> newVector=new Vector<Option>(5);
newVector.addElement(new Option("\tUse resampling instead of reweighting for boosting.","Q",0,"-Q"));
newVector.addElement(new Option("\tPercentage of weight mass to base training on.\n" + "\t(default 100, reduce to around 9... | Returns an enumeration describing the available options. |
public static void download(IBurpExtenderCallbacks cb,IHttpRequestResponse baseRequestResponse,byte[] request,String baseConfigFile){
IExtensionHelpers helpers=cb.getHelpers();
String requestToString=helpers.bytesToString(request);
PrintWriter stderr=new PrintWriter(cb.getStderr(),true);
IRequestInfo requestInf... | Through a base LFI request, modify the given LFI payload to automatically retrieve common configuration files |
public Industry(int id,String name){
this(id,name,null);
}
| Construct an industry with with no segments. |
public void mark(){
mark(1);
}
| Mark the occurrence of an event. |
public long value(){
return value;
}
| long value of FlakeId |
private static void attemptRetryOnException(String logPrefix,Request<?> request,VolleyError exception) throws VolleyError {
RetryPolicy retryPolicy=request.getRetryPolicy();
int oldTimeout=request.getTimeoutMs();
try {
retryPolicy.retry(exception);
}
catch ( VolleyError e) {
request.addMarker(String.f... | Attempts to prepare the request for a retry. If there are no more attempts remaining in the request's retry policy, a timeout exception is thrown. |
public static String generatePassword(){
return RandomStringUtils.randomAlphanumeric(DEF_COUNT);
}
| Generates a password. |
public boolean isMemory(){
return memory;
}
| Gets the value of the memory property. |
private static void uaRIMGe(MatrixBlock in,MatrixBlock out,double[] bv,int[] bvi,BinaryOperator bOp) throws DMLRuntimeException {
int ind0=uarimaxGe(0.0,bv,bvi,bOp);
int m=in.rlen;
for (int i=0; i < m; i++) {
double ai=in.quickGetValue(i,0);
int ind=(ai == 0) ? ind0 : uarimaxGe(ai,bv,bvi,bOp);
out.qui... | UAgg rowIndexMax for GreaterThanEqual operator |
public GuildRoleDeleteHandler(ImplDiscordAPI api){
super(api,true,"GUILD_ROLE_DELETE");
}
| Creates a new instance of this class. |
public SRuntimeFactoryImpl(){
super();
}
| Creates an instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc --> |
public boolean digitalRead(int pin){
if (!isConnected()) {
onError(OneSheeldError.DEVICE_NOT_CONNECTED);
return false;
}
else if (isUpdatingFirmware()) {
onError(OneSheeldError.FIRMWARE_UPDATE_IN_PROGRESS);
return false;
}
if (isPinDebuggingEnabled) Log.i("Device " + this.name + ": Digital ... | Digital read from a specific pin. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-08-13 13:14:19.217 -0400",hash_original_method="35E182D2C7EEB0F8214080478407DB5E",hash_generated_method="B3CA99D2C95F40EB28F19456D85CA93B") public boolean isRightToLeft(){
return direction == UBiDiDirection_UBIDI_RTL;
}
| Indicates whether the text is from right to left, that is, both the base direction and the text direction is from right to left. |
void cp(Deque<Block> code){
EdgeMap<Expr> uses=findUses(code);
Map<Expr,Expr> map=new HashMap<Expr,Expr>();
Set<Expr> work=new TreeSet<Expr>();
for ( Block b : code) {
if (!b.must_isolate_block) {
for ( Expr e : b) if (e.op == OP_phi || e.op == OP_dup) work.add(e);
}
}
while ... | Copy propagation. Phi nodes that only choose themselves or one other variable are replaced by references to that other variable: |
public boolean hasDeleteTargetPermission(){
return hasTargetReadPermission() && permissionService.hasPermission(SpPermission.DELETE_TARGET);
}
| Gets the SP delete Target Permission. |
public static boolean intersectRayCircle(double originX,double originY,double dirX,double dirY,double centerX,double centerY,double radiusSquared,Vector2d result){
double Lx=centerX - originX;
double Ly=centerY - originY;
double tca=Lx * dirX + Ly * dirY;
double d2=Lx * Lx + Ly * Ly - tca * tca;
if (d2 > radi... | Test whether the given ray with the origin <tt>(originX, originY)</tt> and direction <tt>(dirX, dirY)</tt> intersects the given circle with center <tt>(centerX, centerY)</tt> and square radius <code>radiusSquared</code>, and store the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> f... |
public boolean execute(INode n){
if (!isValid(n)) {
return false;
}
FreeCellNode state=(FreeCellNode)n;
Column col=state.cols[nth];
col.remove();
if (col.num == 0) {
state.sortMap();
}
state.insertFoundation(card);
return true;
}
| Execute the move on the given board state. |
public final void endDocument() throws org.xml.sax.SAXException {
flushPending();
if (m_doIndent && !m_isprevtext) {
try {
outputLineSep();
}
catch ( IOException e) {
throw new SAXException(e);
}
}
flushWriter();
if (m_tracer != null) super.fireEndDoc();
}
| Receive notification of the end of a document. |
public boolean isDistinct(){
return distinct;
}
| This method was generated by MyBatis Generator. This method corresponds to the database table group |
protected boolean checkGeneratorArg(String[] argv,int currentIndex){
boolean result=true;
if (argv[currentIndex].startsWith("-")) {
String arg=argv[currentIndex].substring(1).toLowerCase();
for (int i=0; i < generatorArgs.length; i++) {
if (arg.equalsIgnoreCase(generatorArgs[i])) {
Generator g... | If this argument is for a generator, instantiate it, call parseArgs(...) and add generator to generators vector. Returns false on error. |
public boolean isSetStore(){
return this.store != null;
}
| Returns true if field store is set (has been assigned a value) and false otherwise |
public JSONArray put(int index,int value) throws JSONException {
this.put(index,new Integer(value));
return this;
}
| Put or replace an int value. If the index is greater than the length of the JSONArray, then null elements will be added as necessary to pad it out. |
protected DoubleFactory1D(){
}
| Makes this class non instantiable, but still let's others inherit from it. |
public void loadScale(float x,float y,float z){
loadIdentity();
mMat[0]=x;
mMat[4]=y;
mMat[8]=z;
}
| Sets current values to be a scale matrix of given dimensions |
private static Placemark createAircraftPlacemark(Position position){
Placemark placemark=Placemark.createWithImage(position,ImageSource.fromResource(R.drawable.aircraft_fighter));
placemark.getAttributes().setImageOffset(Offset.bottomCenter()).setImageScale(NORMAL_IMAGE_SCALE).setDrawLeader(true);
placemark.setHi... | Helper method to create aircraft placemarks. |
public void testPrefixTerm() throws IOException {
Directory indexStore=getIndexStore("field",new String[]{"prefix","prefixx"});
IndexReader reader=DirectoryReader.open(indexStore);
IndexSearcher searcher=newSearcher(reader);
MultiTermQuery wq=new WildcardQuery(new Term("field","prefix*"));
assertMatches(searc... | Tests if a WildcardQuery that has only a trailing * in the term is rewritten to a single PrefixQuery. The boost and rewriteMethod should be preserved. |
private URI createBlockConsistencyGroup(String name){
BlockConsistencyGroup cg=new BlockConsistencyGroup();
URI cgURI=URIUtil.createId(BlockConsistencyGroup.class);
cg.setId(cgURI);
cg.setLabel(name);
_dbClient.createObject(cg);
return cg.getId();
}
| Creates the consistency group used by the BlockObjects. |
public void arrayLength(){
mv.visitInsn(Opcodes.ARRAYLENGTH);
}
| Generates the instruction to compute the length of an array. |
public WindowSurface(EglCore eglCore,Surface surface,boolean releaseSurface){
super(eglCore);
createWindowSurface(surface);
mSurface=surface;
mReleaseSurface=releaseSurface;
}
| Associates an EGL surface with the native window surface. <p> Set releaseSurface to true if you want the Surface to be released when release() is called. This is convenient, but can interfere with framework classes that expect to manage the Surface themselves (e.g. if you release a SurfaceView's Surface, the surfaceDe... |
@DSComment("not sensitive") @DSSafe(DSCat.SAFE_OTHERS) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:49.608 -0500",hash_original_method="85FD61C7B117729DDA17405FA5EDFA09",hash_generated_method="685D98350CD97C9342EE1C690C8DF05E") @Override public void flush() throws IOException ... | Flushes this stream to ensure all pending data is sent out to the target stream. This implementation then also flushes the target stream. |
public Item(final int id,@NonNull final CharSequence title){
super(id,title);
ensureAtLeast(id,0,"The id must be at least 0");
ensureNotNull(title,"The title may not be null");
ensureNotEmpty(title,"The title may not be empty");
this.icon=null;
this.enabled=true;
}
| Creates a new item. |
@Override public void execute(){
getArgs().setCounter(0);
executeImpl();
}
| Delete all the contacts from the Contacts Provider asynchronously. |
public void draw(Canvas canvas){
for (int i=0; i < mHolders.size(); ++i) {
Drawable drawable=get(i).getTopLevelDrawable();
if (drawable != null) {
drawable.draw(canvas);
}
}
}
| Convenience method to draw all the top-level drawables in this holder. |
private Transform matchUtility(Class type) throws Exception {
if (type == Date.class) {
return new DateTransform(type);
}
if (type == Locale.class) {
return new LocaleTransform();
}
if (type == Currency.class) {
return new CurrencyTransform();
}
if (type == GregorianCalendar.class) {
retur... | This is used to resolve <code>Transform</code> implementations that relate to the <code>java.util</code> package. If the type does not resolve to a valid transform then this method will throw an exception to indicate that no stock transform exists for the specified type. |
@Override public double downsideDeviation(){
return Math.sqrt(downsideVariance());
}
| returns the downside deviation, defined as the square root of the downside variance. |
public static boolean isImsConnected(){
Core core=Core.getInstance();
if (core == null) {
return false;
}
ImsNetworkInterface networkInterface=core.getImsModule().getCurrentNetworkInterface();
return networkInterface != null && networkInterface.isRegistered();
}
| Is connected to IMS |
private TaskList performFileProtectionAction(FileReplicationParam param,URI id,String op){
TaskResourceRep taskResp=null;
TaskList taskList=new TaskList();
FileCopy copy=param.getCopies().get(0);
if (copy.getType().equalsIgnoreCase(FileTechnologyType.REMOTE_MIRROR.name()) || copy.getType().equalsIgnoreCase(File... | perform file protection action |
protected List<Callable<RuleStats>> newMutationTasks(final IStep step,final IJoinNexus joinNexus,final Map<String,IBuffer<ISolution[]>> buffers){
if (log.isDebugEnabled()) log.debug("program=" + step.getName());
final List<Callable<RuleStats>> tasks;
if (step.isRule()) {
if (step.isRule() && ((IRule)step).g... | Builds a set of tasks for the program. |
@Override public void flushBuffer() throws IOException {
getDelegate().flushBuffer();
logStream().flush();
}
| Flushes buffered writes. |
public ThumbnailParameter(double widthScalingFactor,double heightScalingFactor,Region sourceRegion,boolean keepAspectRatio,String outputFormat,String outputFormatType,float outputQuality,int imageType,List<ImageFilter> filters,Resizer resizer,boolean fitWithinDimensions,boolean useExifOrientation){
this(null,widthSca... | Creates an object holding the parameters needed in order to make a thumbnail. |
public void testMatchLjava_security_cert_X509CRL(){
X509CRLSelector selector=new X509CRLSelector();
assertFalse("The null object should not match",selector.match((X509CRL)null));
}
| match(CRL crl) method testing. Tests if the null object matches to the selector or not. |
public static void drawAxis(SVGPlot plot,Element parent,LinearScale scale,double x1,double y1,double x2,double y2,LabelStyle labelstyle,StyleLibrary style) throws CSSNamingConflict {
assert (parent != null);
Element line=plot.svgLine(x1,y1,x2,y2);
SVGUtil.setCSSClass(line,CSS_AXIS);
parent.appendChild(line);
... | Plot an axis with appropriate scales |
public static Document createXMLValidationList(ValidationResults results,int initRow,int enabled,Locale locale,List fieldsInfo,String caseSensitive){
Document doc=createDocument(initRow,results,RBUtil.getInstance(locale).getProperty(I18N_VALIDATIONUSECASE_TYPESUBJECT),"","",fieldsInfo,locale,caseSensitive,0,0);
Ele... | Public methods |
@Override public void execute(String[] params,Server server,Conversation conversation,IRCService service) throws CommandException {
if (params.length == 2) {
showCommandDetails(service,server,conversation,params[1]);
}
else if (params.length == 1) {
showAllCommands(service,server,conversation);
}
else... | Execute /help |
public ExecutionVariable createExecutionVariable(){
ExecutionVariableImpl executionVariable=new ExecutionVariableImpl();
return executionVariable;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public SortingParams by(final String pattern){
return by(SafeEncoder.encode(pattern));
}
| Sort by weight in keys. <p> Takes a pattern that is used in order to generate the key names of the weights used for sorting. Weight key names are obtained substituting the first occurrence of * with the actual value of the elements on the list. <p> The pattern for a normal key/value pair is "keyname*" and for a value i... |
protected final <T extends IgniteSpiManagementMBean>void registerMBean(String gridName,T impl,Class<T> mbeanItf) throws IgniteSpiException {
MBeanServer jmx=ignite.configuration().getMBeanServer();
assert mbeanItf == null || mbeanItf.isInterface();
assert jmx != null;
try {
spiMBean=U.registerMBean(jmx,grid... | Registers SPI MBean. Note that SPI can only register one MBean. |
private String randomString(){
return ("test" + Math.random()).substring(0,10);
}
| Constructs a random string of length 10. |
@SuppressWarnings("unchecked") private static void loadExtensions(final ClassLoader classLoader){
for ( final Map.Entry<Class,Set<Class>> entry : definitionMap.entrySet()) {
final ServiceLoader<?> serviceLoader=ServiceLoader.load(entry.getKey(),classLoader);
for ( final Object o : serviceLoader) {
r... | Loads extensions from the specified class loader. |
public void requestFocus(){
}
| Handle grabbing the focus from the parent applet. Other renderers can override this if handling needs to be different. |
protected void isEntityReferneceWellFormed(EntityReference node){
if (!isXMLName(node.getNodeName(),fIsXMLVersion11)) {
String msg=Utils.messages.createMessage(MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,new Object[]{"EntityReference",node.getNodeName()});
if (fErrorHandler != null) {
fErrorHandler.hand... | Checks if an EntityRefernece node is well-formed, by checking it's node name. Then depending on whether it is referenced in Element content or in an Attr Node, checks if the EntityReference references an unparsed entity or a external entity and if so throws raises the appropriate well-formedness error. |
public Transaction fromWire(WireFormat.Reader reader) throws IOException {
Transaction.Builder builder=new Transaction.Builder();
builder=builder.version(reader.readUint32());
long nin=reader.readVarInt();
if (nin > 0) {
List<TransactionInput> inputs=new ArrayList<>();
for (int i=0; i < nin; ++i) {
... | Recreate a transaction from a wire format stream |
public T caseDocletElement(DocletElement object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Doclet Element</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
public synchronized void addThresholdDataListener(ThresholdDataListener cl){
m_thresholdListeners.addElement(cl);
}
| Add a threshold data listener |
public void unwind(GridCacheContext ctx){
List<CA> q;
synchronized (undeploys) {
q=undeploys.remove(ctx.name());
}
if (q == null) return;
int cnt=0;
for ( CA c : q) {
c.apply();
cnt++;
}
if (log.isDebugEnabled()) log.debug("Unwound undeploys count: " + cnt);
}
| Undeploy all queued up closures. |
public void addMovingPoint(){
Projection proj=getProjection();
if (proj == null) {
return;
}
int numOfSpritesToAdd=1;
if (spinner != null) {
try {
numOfSpritesToAdd=Integer.parseInt(spinner.getValue().toString());
}
catch ( NumberFormatException nfe) {
spinner.setValue(1);
}
... | Create a new point for the list. We're going to look at the current projection and find some random point within the height and width of the map. If the projection isn't set on the layer yet (it hasn't been added to the map), no point will be added. |
public void remove(){
}
| Remove the text from the screen. |
public DelimitedTextTableWriter(String delimiter){
this(delimiter,true);
}
| Create a new DelimitedTextTableWriter. |
public File resolveFileName(final String name){
File absolute=new File(name);
if (absolute.isAbsolute()) {
return absolute;
}
if (processLocation instanceof FileProcessLocation) {
File processFile=((FileProcessLocation)processLocation).getFile();
return Tools.getFile(processFile.getParentFile(),name... | Resolves the given filename against the directory containing the process file. |
public static SendableChatActionBuilder builder(){
return new SendableChatActionBuilder();
}
| This builder will allow you to progressively construct this object. |
public ExtractMethodRefactoring(ICompilationUnit unit,int selectionStart,int selectionLength){
fCUnit=unit;
fRoot=null;
fMethodName="extracted";
fSelectionStart=selectionStart;
fSelectionLength=selectionLength;
fVisibility=-1;
}
| Creates a new extract method refactoring |
public void limitTransAndScale(Matrix matrix,RectF content){
float[] vals=new float[9];
matrix.getValues(vals);
float curTransX=vals[Matrix.MTRANS_X];
float curScaleX=vals[Matrix.MSCALE_X];
float curTransY=vals[Matrix.MTRANS_Y];
float curScaleY=vals[Matrix.MSCALE_Y];
mScaleX=Math.max(mMinScaleX,curScaleX)... | limits the maximum scale and X translation of the given matrix |
public static FXGLogger createDefaultLogger(){
return new SystemLogger();
}
| Creates a new instance of the default implementation of FXGLogger. |
public void add(K key,V value){
if (key == null) {
return;
}
K[] keys=_keys;
int size=_size;
for (int i=size - 1; i >= 0; i--) {
if (key.equals(keys[i])) {
_values[i].add(value);
return;
}
}
if (_keys.length <= size) {
int newSize=Math.min(2 * size,_maxCapacity);
if (newSiz... | Puts a new item in the cache. |
public boolean itemPlaceAllowed(int slot,ItemStack stack){
return getSlotType(slot) != SlotType.RESULT;
}
| Check whether it is allowed for a player to insert the given ItemStack at the slot, regardless of the slot's current contents. Should return false for crafting output slots or armor slots which cannot accept the given item. |
public static Date tomorrowAt(int hour,int minute,int second){
validateSecond(second);
validateMinute(minute);
validateHour(hour);
Date date=new Date();
Calendar c=Calendar.getInstance();
c.setTime(date);
c.setLenient(true);
c.add(Calendar.DAY_OF_YEAR,1);
c.set(Calendar.HOUR_OF_DAY,hour);
c.set(Cale... | <p> Get a <code>Date</code> object that represents the given time, on tomorrow's date. </p> |
public label addElement(String hashcode,String element){
addElementToRegistry(hashcode,element);
return (this);
}
| Adds an Element to the element. |
public static String normalizeReference(String reference){
IScanner scanner=ToolFactory.createScanner(false,false,false,false);
scanner.setSource(reference.toCharArray());
StringBuffer sb=new StringBuffer();
try {
int tokenType=scanner.getNextToken();
while (tokenType != ITerminalSymbols.TokenNameEOF) {... | Removes comments and whitespace |
public int nscan(){
return sharedQueue.nscan();
}
| The nscan value of the shared queue. |
public static final <ReferenceType extends WordReference>ByteBuffer compressIndex(final ReferenceContainer<WordReference> inputContainer,final ReferenceContainer<WordReference> excludeContainer,final long maxtime){
final long timeout=maxtime == Long.MAX_VALUE ? Long.MAX_VALUE : (maxtime < 0) ? Long.MAX_VALUE : System... | create an index abstract for a given WordReference ReferenceContainer This extracts all the host hashes from a reference Container and returns a byte buffer with a compressed representation of the host references |
protected boolean _findCanonicalLabelling(boolean tmpPreviouslyEqualToMin){
boolean foundNewMinimum=false;
IntArrayList underlyingVertexPosThatExtendTmp=getUnderlyingVertexPosThatExtendTmp();
IntCursor underlyingVertexPosThatExtendTmpCursor=underlyingVertexPosThatExtendTmp.cursor();
while (underlyingVertexPosTh... | Find the canonical labelling by increasing a tmpPattern one vertex at a time and comparing it with the previous minimum. |
public static Array listToArrayTrim(String list,String delimiter,int[] info){
if (delimiter.length() == 1) return listToArrayTrim(list,delimiter.charAt(0),info);
if (list.length() == 0) return new ArrayImpl();
char[] del=delimiter.toCharArray();
char c;
outer: while (list.length() > 0) {
c=list.char... | casts a list to Array object, remove all empty items at start and end of the list and store count to info |
public static JPanel createDialogButtonPanel(JButton jbPositive,JButton jbNegative,JButton jbOther,boolean resizable){
return createDialogButtonPanel(jbPositive,jbNegative,(jbOther == null ? null : new JButton[]{jbOther}),resizable);
}
| Create a dialog button panel with the order and alignment dependant on the platform. |
protected void changeLayers(ContainerEvent e){
if (!doContainerChange) {
return;
}
Component[] comps=this.getComponents();
int ncomponents=comps.length;
Layer[] newLayers=new Layer[ncomponents];
System.arraycopy(comps,0,newLayers,0,ncomponents);
if (logger.isLoggable(Level.FINE)) {
debugmsg("chang... | ContainerListener Interface method. Should not be called directly. Part of the ContainerListener interface, and it's here to make the MapBean a good Container citizen. |
public static CategoryLabelPositions createDownRotationLabelPositions(double angle){
return new CategoryLabelPositions(new CategoryLabelPosition(RectangleAnchor.BOTTOM,TextBlockAnchor.BOTTOM_RIGHT,TextAnchor.BOTTOM_RIGHT,angle,CategoryLabelWidthType.RANGE,0.50f),new CategoryLabelPosition(RectangleAnchor.TOP,TextBlock... | Creates a new instance where the category labels angled downwards by the specified amount. |
public static double cauchy(){
return Math.tan(Math.PI * (uniform() - 0.5));
}
| Returns a random real number from the Cauchy distribution. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.