code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public T margin(float leftDip,float topDip,float rightDip,float bottomDip){
if (view != null) {
LayoutParams lp=view.getLayoutParams();
if (lp instanceof MarginLayoutParams) {
Context context=getContext();
int left=AQUtility.dip2pixel(context,leftDip);
int top=AQUtility.dip2pixel(context,top... | Set the margin of a view. Notes all parameters are in DIP, not in pixel. |
public final void testGetItemViewType(){
CharSequence[] entries=new CharSequence[]{"entry1","entry2"};
ProxySpinnerAdapter proxySpinnerAdapter=createAdapter(entries);
assertEquals(0,proxySpinnerAdapter.getItemViewType(0));
}
| Tests the functionality of the getItemViewType-method. |
public CCallgraphEdge(final ICallgraphNode source,final ICallgraphNode target){
super(source,target);
}
| Creates a new call graph edge object. |
public static Vector<String> toVector(String[] array){
if (array == null) {
return new Vector<String>(0);
}
Vector<String> v=new Vector<String>(array.length);
v.copyInto(array);
return v;
}
| Creates a new <tt>Vector</tt> collection from the specified array of <tt>String</tt>s. |
public DeleteEntityAction(final OdorWorldPanel worldPanel,OdorWorldEntity entity){
super("Delete entity");
this.worldPanel=worldPanel;
this.entity=entity;
putValue(SMALL_ICON,ResourceManager.getImageIcon("Delete.png"));
putValue(SHORT_DESCRIPTION,"Delete entity");
}
| Create a delete entity action. |
protected void freeMemory(){
memory.clear();
}
| Remove the hard reference to the memory. |
public final boolean subdivp(double dsq,HG hg){
MathVector dr=new MathVector();
dr.subtraction(pos,hg.pos0);
double drsq=dr.dotProduct();
return (drsq < dsq);
}
| Decide if the cell is too close to accept as a single term. |
private void checkForUpdate(){
try {
String current=getClass().getPackage().getImplementationVersion();
if (current == null) {
return;
}
DefaultArtifactVersion currentVersion=new DefaultArtifactVersion(current);
GitHub github=GitHub.connectAnonymously();
GHRepository repository=github.ge... | GitHub dependency is only used here and unused parts are excluded. Make sure it works fine if it is used somewhere else. |
public ST(){
st=new TreeMap<Key,Value>();
}
| Initializes an empty symbol table. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:13.817 -0500",hash_original_method="865736B8E6D41CC27E8C4571B72736D6",hash_generated_method="2FBFF2774EBE1C709D4520ED4335CEEE") public DERExternal(DERObjectIdentifier directReference,DERInteger indirectReference,ASN1Object dataValue... | Creates a new instance of DERExternal. See X.690 for more informations about the meaning of these parameters |
@Override public Mono<Object> resolveArgument(MethodParameter parameter,ModelMap model,ServerWebExchange exchange){
String name=HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE;
Optional<Object> value=exchange.getAttribute(name);
return (value.isPresent() ? Mono.just(value.get()) : Mono.just(Collections.emptyMap()... | Return a Map with all URI template variables or an empty map. |
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void handleDocumentActivityIntent(){
if (getIntent() == null || mIntentHandler.shouldIgnoreIntent(this,getIntent())) {
Log.e(TAG,"Ignoring intent: " + getIntent());
mIsFinishNeeded=true;
return;
}
maybePrefetchDnsInBackground();
boolean hasUserGesture... | Handles the launching of a DocumentActivity from the current Intent. Routing Intents to other types of Activities must be handled from onCreate() instead. |
public long maxSize(){
return maxSize;
}
| Returns the maximum number of bytes that this cache should use to store its data. |
public Builder addConfig(String configName,Path configPath){
this.configs.add(new Config(configName,configPath));
return this;
}
| Upload a collection config before tests start |
protected IdentifierToken parseName(boolean star) throws SyntaxError, IOException {
IdentifierToken res=scanner.getIdToken();
expect(IDENT);
if (token != FIELD) {
return res;
}
StringBuffer buf=new StringBuffer(res.id.toString());
while (token == FIELD) {
scan();
if ((token == MUL) && star) {
... | Parse an identifier. ie: a.b.c returns "a.b.c" If star is true then "a.b.*" is allowed. The return value encodes both the identifier and its location. |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
final double radToDeg=180 / Math.PI;
final double degToRad=Math.PI / 180;
double azimuth=315 * degToRad;
double altitude=45 * degToRad;
double zFactor=1;
double z;
int progress;
int[] Dy={-1,0,1,1,1,0,-... | Used to execute this plugin tool. |
private void init(){
mFadeDuration=DEFAULT_FADE_DURATION;
mPlaceholderImage=null;
mPlaceholderImageScaleType=null;
mRetryImage=null;
mRetryImageScaleType=null;
mFailureImage=null;
mFailureImageScaleType=null;
mProgressBarImage=null;
mProgressBarImageScaleType=null;
mActualImageScaleType=DEFAULT_ACTU... | Initializes this builder to its defaults. |
private File findFirstExisting(String path,@Nullable Location currentLocation){
if (isAbsolutePath(path)) {
File f=new File(path);
return f.exists() ? f : null;
}
if (currentLocation != null) {
File maybeFile=new File(currentLocation.base(),path).getAbsoluteFile();
if (maybeFile.exists()) {
... | Resolves a relative path to the first existing match. Resolution rules favor, in order: 1. Absolute paths 2. The current working location, if given 3. The include path, in the order given. |
public SetGenerator(){
super();
}
| Constructs the command line utility for generating reference sets for a given problem. |
public static String escapeHtml(String s,CleanerProperties props){
boolean advanced=props.isAdvancedXmlEscape();
boolean recognizeUnicodeChars=props.isRecognizeUnicodeChars();
boolean translateSpecialEntities=props.isTranslateSpecialEntities();
boolean transResCharsToNCR=props.isTransResCharsToNCR();
boolean ... | Escapes HTML string |
public static boolean canHandleStreetView(Context context){
Destination.StreetView sv=new Destination.StreetView();
Intent intent=getStreetViewIntent(context.getString(R.string.streetview_uri),sv);
List<ResolveInfo> resolvers=context.getPackageManager().queryIntentActivities(intent,0);
return resolvers != null ... | Checks if the device can handle a GMM StreetView intent. |
public void noop() throws IOException {
frameWriter.noop();
}
| Sends a noop frame to the peer. |
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:32:18.295 -0500",hash_original_method="C0E9548D6FEBBB39DCAB5DD502EC06AD",hash_generated_method="D39D8B79B28699344B30CF82A503E4E0") private View fillSpecific(int position,int top... | Put a specific item at a specific location on the screen and then build up and down from there. |
public static void removeCommonFrames(List causeFrames,List wrapperFrames){
if (causeFrames == null || wrapperFrames == null) {
throw new IllegalArgumentException("The List must not be null");
}
int causeFrameIndex=causeFrames.size() - 1;
int wrapperFrameIndex=wrapperFrames.size() - 1;
while (causeFrameIn... | <p>Removes common frames from the cause trace given the two stack traces.</p> |
@Override public int hashCode(){
return value ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode();
}
| Returns a suitable hash code for this mutable. |
private String generateCreateTableDdlHelper(GenerateDdlRequest generateDdlRequest){
StringBuilder sb=new StringBuilder();
HashMap<String,String> replacements=new HashMap<>();
if (generateDdlRequest.isPartitioned && !CollectionUtils.isEmpty(generateDdlRequest.partitionFilters)) {
for ( List<String> partitio... | Generates and append to the string builder the create table Hive 13 DDL as per specified parameters. |
@Override public void close() throws IOException {
close(GOAWAY_OK,SpdyStream.RST_CANCEL);
}
| Closes this connection. This cancels all open streams and unanswered pings. It closes the underlying input and output streams and shuts down internal executor services. |
public static void main(String[] args){
try {
JettySolrRunner jetty=new JettySolrRunner(".","/solr",8983);
jetty.start();
}
catch ( Exception ex) {
ex.printStackTrace();
}
}
| A main class that starts jetty+solr This is useful for debugging |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:02:37.746 -0500",hash_original_method="ECDCE15AD3E40A66FECAA373F1AD69DD",hash_generated_method="B6D4BCB8D87317739197DB0702F9771D") public FileURLConnection(URL url){
super(url);
fileName=url.getFile();
if (fileName == null) {
... | Creates an instance of <code>FileURLConnection</code> for establishing a connection to the file pointed by this <code>URL<code> |
@SuppressWarnings("rawtypes") public Object[] toComponentArray(LiteralExtensionIV iv){
long[] longArr=asLongArray(iv);
return longArrAsComponentArr(longArr);
}
| Conversion of a an IV into its component array. |
public AbstractTask retrieveTask(String taskIdentifier){
final Executable task=this.executableRegistry.getTask(taskIdentifier);
return new LocalJvmTask(task);
}
| Retrieves the task corresponding to the given task identifier |
private void analize(){
StringTokenizer tokenizer=new StringTokenizer(sourceData,"|");
StringTokenizer tokenizer2=new StringTokenizer(tokenizer.nextToken(),",");
isstd=Integer.parseInt(tokenizer2.nextToken());
if (isstd != 0) {
numItems=Integer.parseInt(tokenizer2.nextToken());
int i=0;
while (token... | Private methods |
private void zzScanError(int errorCode){
String message;
try {
message=ZZ_ERROR_MSG[errorCode];
}
catch ( ArrayIndexOutOfBoundsException e) {
message=ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
}
throw new Error(message);
}
| Reports an error that occured while scanning. In a wellformed scanner (no or only correct usage of yypushback(int) and a match-all fallback rule) this method will only be called with things that "Can't Possibly Happen". If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty scanne... |
public void delete(){
this.isDeleted=true;
this.isActive=false;
this.name=this.name + "_deleted_" + this.getId();
}
| delete the report mailing job, set the isDeleted property to 1 and alter the name |
private void removeDeadCouplings(Object object){
List<Coupling<?>> toRemove=new ArrayList<Coupling<?>>();
for ( Coupling<?> coupling : getCouplings()) {
if (coupling.getConsumer().getBaseObject() == object) {
toRemove.add(coupling);
}
if (coupling.getProducer().getBaseObject() == object) {
... | Remove any couplings associated with the "dead" object. |
@Override public void splitNode(BallNode node,int numNodesCreated) throws Exception {
correctlyInitialized();
m_Rand=new Random(m_RandSeed);
int ridx=node.m_Start + m_Rand.nextInt(node.m_NumInstances);
Instance randomInst=(Instance)m_Instances.instance(m_Instlist[ridx]).copy();
double[] distList=new double[no... | Splits a ball into two. |
public void startUploadRepeat(final String hostname,final String uri,final int repeatWindow,final int reportPeriodMillis,final int fileSizeOctet,final IRepeatListener repeatListener){
startUploadRepeat(hostname,SpeedTestConst.HTTP_DEFAULT_PORT,uri,repeatWindow,reportPeriodMillis,fileSizeOctet,repeatListener);
}
| Start repeat upload task. |
public ASN1GeneralizedTime(String time){
this.time=Strings.toByteArray(time);
try {
this.getDate();
}
catch ( ParseException e) {
throw new IllegalArgumentException("invalid date string: " + e.getMessage());
}
}
| The correct format for this is YYYYMMDDHHMMSS[.f]Z, or without the Z for local time, or Z+-HHMM on the end, for difference between local time and UTC time. The fractional second amount f must consist of at least one number with trailing zeroes removed. |
public RetryAfterParser(String retryAfter){
super(retryAfter);
}
| Creates a new instance of RetryAfterParser |
public void test_roll(){
Calendar calendar=Calendar.getInstance();
calendar.set(2008,3,20,17,28,12);
calendar.roll(Calendar.DATE,5);
assertEquals(25,calendar.get(Calendar.DATE));
calendar.roll(Calendar.DATE,-5);
assertEquals(20,calendar.get(Calendar.DATE));
calendar.roll(Calendar.DATE,0);
assertEquals(2... | java.util.Calendar#roll(int, int) |
private synchronized String loadLibraryAsResource(String libname){
try {
InputStream is=getResourceAsStream(libname.replace(File.separatorChar,'/'));
if (is != null) {
try {
File directory=new File(libraryDirectory);
directory.mkdirs();
File file=Files.createTempFile(directory.to... | Search the specified native library in any of the JAR files loaded by this classloader. If the library is found copy it into the library directory and return the absolute path. If the library is not found then return null. |
@DSComment("Package priviledge") @DSBan(DSCat.DEFAULT_MODIFIER) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:29:13.114 -0500",hash_original_method="0F816E844CC5CD74396FEF014D25737B",hash_generated_method="0F816E844CC5CD74396FEF014D25737B") boolean isToDirectionOf(int direction,Re... | e.g for left, is 'to left of' |
public XMLMapper(Serializer serializer){
this.serializer=serializer;
}
| Constructs a XMLMapper using the given serializer. |
protected void linkStationsToNetwork(){
log.info("Linking pt stations to network...");
Counter counter=new Counter("route # ");
Set<TransitStopFacility> newFacilities=new HashSet<>();
for ( TransitStopFacility facility : this.schedule.getFacilities().values()) {
final Id<Link> closestLink=findClosestLink(f... | Link the pt-stations in the schedule to the closest network links. Thereby modifies this.schedule. |
private void selectSleepTimer(){
new MaterialDialog.Builder(this).title(R.string.sleep_timer_title).items(R.array.sleep_timer).itemsCallback(null).show();
}
| Pick a desired sleep timer |
public final boolean safeRun(int currentRunCount){
return baseJob.safeRun(currentRunCount);
}
| runs the job w/o throwing any exceptions |
public EmpiricalMeasurementDistribution(int size){
super();
distribution=new double[size];
}
| Construct an instance, ready to fill out the distribution |
public void deleteDataTable(final String name){
if (dataTableExists(name)) {
DataTable table=dataTableMap.remove(name);
for ( LoggingListener listener : loggingListeners) {
listener.removeDataTable(table);
}
}
}
| Deletes a single data table. |
public GenerationalDistance(Problem problem,NondominatedPopulation referenceSet){
super(problem,referenceSet);
}
| Constructs a generational distance evaluator for the specified problem and corresponding reference set. |
private void addLenient(String fieldName,String value){
namesAndValues.add(fieldName);
namesAndValues.add(value.trim());
}
| Add a field with the specified value without any validation. Only appropriate for headers from the remote peer. |
public boolean isSOTrx(){
return getParent().isSOTrx();
}
| get if this document line is the Sales transaction |
public static boolean sameDay(ZonedDateTime date1,ZonedDateTime date2){
if (date1.getYear() == date2.getYear() && date1.getMonthValue() == date2.getMonthValue() && date1.getDayOfMonth() == date2.getDayOfMonth()) return true;
return false;
}
| Method sameDay. |
@Deprecated public SearchSourceBuilder defaultRescoreWindowSize(int defaultRescoreWindowSize){
this.defaultRescoreWindowSize=defaultRescoreWindowSize;
return this;
}
| Set the rescore window size for rescores that don't specify their window. |
public static void main(final String[] args){
DOMTestCase.doMain(nodesetprefix08.class,args);
}
| Runs this test from the command line. |
public UltraPlayer(UUID uuid,UltraCosmetics ultraCosmetics){
try {
this.uuid=uuid;
gadgetCooldowns=new HashMap<>();
if (UltraCosmeticsData.get().usingFileStorage()) SettingsManager.getData(getPlayer()).addDefault("Keys",0);
if (UltraCosmeticsData.get().isAmmoEnabled()) {
if (!UltraCosmeticsD... | Allows to store custom data for each player easily. <p/> Created on join, and deleted on quit. |
public void update(){
stepsDone++;
int newState=(int)(100 * stepsDone / numberOfSteps);
if (newState > 100) newState=100;
while (newState > percent) {
percent++;
System.out.print('|');
}
if (newState == 100 && !isFinished) {
System.out.println("\r\n");
isFinished=Boolean.TRUE;
}
}
| updates the progress bar |
public void test() throws Exception {
Similarity sim=getSimilarity("text");
assertEquals(IBSimilarity.class,sim.getClass());
IBSimilarity ib=(IBSimilarity)sim;
assertEquals(DistributionSPL.class,ib.getDistribution().getClass());
assertEquals(LambdaDF.class,ib.getLambda().getClass());
assertEquals(Normalizat... | spl/df/h2 with default parameters |
public static Identifier lookupInner(Identifier c,Identifier n){
Identifier id;
if (c.isInner()) {
if (c.name.charAt(c.name.length() - 1) == INNERCLASS_PREFIX) id=lookup(c.name + n);
else id=lookup(c,n);
}
else {
id=lookup(c + "." + INNERCLASS_PREFIX+ n);
}
id.value=c.value;
return id;
}
| Lookup an inner identifier. (Note: n can be idNull.) |
private static boolean hasHWChildren(Component comp){
if (comp instanceof Container) {
for ( Component c : ((Container)comp).getComponents()) {
if (c.getPeer() instanceof WComponentPeer || hasHWChildren(c)) {
return true;
}
}
}
return false;
}
| Returns true if the component has heavyweight children. |
public EventBusIdlingResource(String name,EventBusRegistrationInterface eventBus){
mName=name;
mEventBus=eventBus;
mEventBus.register(mSubscriber);
}
| Listens for events on the given EventBusRegistrationInterface. Resources with the same name as existing resources may be ignored, so be sure to use different names when registering multiple resources. |
private static Double priority(final String text){
final String[] parts=MediaType.split(text);
final Double priority;
if (parts.length > 1) {
final String num=MediaType.NON_DIGITS.matcher(parts[1]).replaceAll("");
if (num.isEmpty()) {
priority=0.0d;
}
else {
priority=Double.parseDouble(nu... | Returns the media type priority. |
public void paint(Graphics g,Shape allocation){
Container host=getContainer();
if (host != null && htmlPane != null && htmlPane.isEditable() != ((JTextComponent)host).isEditable()) {
editable=((JTextComponent)host).isEditable();
htmlPane.setEditable(editable);
}
super.paint(g,allocation);
}
| Also determines if the FrameView should be editable or not based on whether the JTextComponent that contains it is editable. And then proceeds to call the superclass to do the paint(). |
private boolean sample(){
Sampler[] samplers=curSamplers;
for ( Sampler sampler : samplers) {
if (sampler.next()) {
return true;
}
}
return false;
}
| Return true if we should create a new top-level span. We will create the span if any configured sampler returns true. |
public int nextInt(){
return generateBinomial(n,p);
}
| Returns a random number from the distribution. |
public String toReadableString(String className){
return className + "#" + mName+ "("+ mFieldType+ ")";
}
| Make a readable string according to the class name specified. |
private void assertElementAttributeEquals(final HtmlPage page,final String elementId,final String attributeName,final String expected){
HtmlElement element=page.getElementById(elementId);
assertNotNull(element);
assertEquals("Testing attribute '" + attributeName + "' of #"+ elementId,expected,element.getAttribute... | Helper to test for the value of an attribute of a HTML-Element. This method will assert, that the Element with the provided id exists and that the value of the attribute with the provided attributeName is equal to the provided expected content. |
public DelimitedPayloadTokenFilterFactory(Map<String,String> args){
super(args);
encoderClass=require(args,ENCODER_ATTR);
delimiter=getChar(args,DELIMITER_ATTR,'|');
if (!args.isEmpty()) {
throw new IllegalArgumentException("Unknown parameters: " + args);
}
}
| Creates a new DelimitedPayloadTokenFilterFactory |
public void pasteSubsession(List sessionElements,Point point){
getToolbar().setRespondingToEvents(false);
getWorkbench().pasteSubsession(sessionElements,point);
getToolbar().setRespondingToEvents(true);
}
| Pastes a consistent list of model nodes into the workbench. Note that the responsivity of the toolbar to events needs to be turned off during this operation. |
public void testSetBitZeroOutside1(){
byte aBytes[]={0};
int aSign=0;
int number=95;
byte rBytes[]={0,-128,0,0,0,0,0,0,0,0,0,0,0};
BigInteger aNumber=new BigInteger(aSign,aBytes);
BigInteger result=aNumber.setBit(number);
byte resBytes[]=new byte[rBytes.length];
resBytes=result.toByteArray();
for (int... | setBit(int n) outside zero |
public synchronized int write(InputStream in) throws IOException {
int readCount=0;
int inBufferPos=count - filledBufferSum;
int n=in.read(currentBuffer,inBufferPos,currentBuffer.length - inBufferPos);
while (n != -1) {
readCount+=n;
inBufferPos+=n;
count+=n;
if (inBufferPos == currentBuffer.len... | Writes the entire contents of the specified input stream to this byte stream. Bytes from the input stream are read directly into the internal buffers of this streams. |
private static String extractLibrary(final String platform,final String lib){
final String source='/' + Loader.class.getPackage().getName().replace('.','/') + '/'+ "linux-arm"+ "/"+ "libusb4java.so";
final URL url=Loader.class.getResource(source);
if (url == null) {
throw new LoaderException("Native library n... | Extracts a single library. |
public boolean hasExtraStillImage(){
return isApng() && !firsIdatApngFrame;
}
| True if it has a default image (IDAT) that is not part of the animation. In that case, we consider it as a pseudo-frame (number -1) |
public boolean isPendingForRemoval(){
return mPendingRemoval;
}
| Returns true if this session is no longer used and it is pending to be removed upon timeout. |
@SuppressWarnings({"rawtypes","unchecked"}) @Test public void testOperator() throws Exception {
JsonByteArrayOperator oper=new JsonByteArrayOperator();
oper.setConcatenationCharacter('.');
CollectorTestSink mapSink=new CollectorTestSink();
CollectorTestSink jsonObjectSink=new CollectorTestSink();
CollectorTes... | Test json byte array to HashMap operator pass through. The Object passed is not relevant |
public void visitEnd(){
if (av != null) {
av.visitEnd();
}
}
| Visits the end of the annotation. |
@Override public void postInvalidateOnAnimation(){
if (mPendingInvalidation) return;
long nextDrawTime=mLastDrawTimeMs + MIN_MS_PER_FRAME;
long delay=Math.max(0,nextDrawTime - System.currentTimeMillis());
mPendingInvalidation=true;
postOnAnimationDelayed(mInvalidationRunnable,delay);
}
| Delay invalidations to be no more than 1 per MIN_MS_PER_FRAME; never allow more than one invalidation outstanding. |
public void merge(JavaDocStore javaDocStore){
if (javaDocStore != null) {
for ( Entry<String,JavaDocEntry> entry : javaDocStore.javaDocStore.entrySet()) {
putValue(entry.getKey(),entry.getValue());
}
}
}
| Merges a Java Doc Store with this one. Only keys with higher semantic content will be absorbed into the store |
public frameset addElement(String element){
addElementToRegistry(element);
return (this);
}
| Adds an Element to the element. |
public TagTitle createTagTitle(){
TagTitleImpl tagTitle=new TagTitleImpl();
return tagTitle;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public void addPage(@NotNull WizardPage<T> page){
page.setUpdateDelegate(delegate);
page.setContext(context);
page.init(dataObject);
wizardPages.add(page);
}
| Add page to wizard. |
public static int computeMessageSize(final int fieldNumber,final MessageLite value){
return computeTagSize(fieldNumber) + computeMessageSizeNoTag(value);
}
| Compute the number of bytes that would be needed to encode an embedded message field, including tag. |
public String innerClass(int nth){
int i=innerClassIndex(nth);
if (i == 0) return null;
else return constPool.getClassInfo(i);
}
| Returns the class name indicated by <code>classes[nth].inner_class_info_index</code>. |
public static void serialize(GPathResult node,OutputStream os){
serialize(asString(node),os);
}
| Write a pretty version of the GPathResult to the OutputStream. |
public final BufferedImage filter(BufferedImage src,BufferedImage dst){
if (src == null) {
throw new NullPointerException("src image is null");
}
if (src == dst) {
throw new IllegalArgumentException("src image cannot be the " + "same as the dst image");
}
boolean needToConvert=false;
ColorModel srcC... | Performs a convolution on BufferedImages. Each component of the source image will be convolved (including the alpha component, if present). If the color model in the source image is not the same as that in the destination image, the pixels will be converted in the destination. If the destination image is null, a Buff... |
public Breadcrumb(final Composite parent,final int style){
super(parent,checkStyle(style) | SWT.DOUBLE_BUFFERED);
this.items=new ArrayList<BreadcrumbItem>();
this.hasBorder=(style & SWT.BORDER) != 0;
addListeners();
}
| Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, us... |
private void onAttacked(final Entity attacker){
attackers.remove(attacker);
attackers.add(attacker);
}
| When attacker attacks this entity. |
protected static void placeSomeTerrain(IBoard board,int terrainType,int probMore,int minHexes,int maxHexes,HashMap<IHex,Point> reverseHex,boolean exclusive){
Point p=new Point(Compute.randomInt(board.getWidth()),Compute.randomInt(board.getHeight()));
int count=minHexes;
if ((maxHexes - minHexes) > 0) {
count+... | Places randomly some connected Woods. |
public ComputeJobFailoverException(String msg){
super(msg);
}
| Creates new exception with given error message. |
public int hashCode(){
return (field << 24) | (beginIndex << 16) | endIndex;
}
| Returns a hash code for this FieldPosition. |
public HttpsURL(final String original,final String charset) throws URIException {
protocolCharset=charset;
parseUriReference(original,false);
checkValid();
}
| Construct a HTTPS URL from a given string with the given charset to do escape encoding. |
public boolean isComponentMaximised(){
return maximisedComponent != null;
}
| Tells whether or not there is a maximised component. |
public void execute(TransformerImpl transformer) throws TransformerException {
VariableStack vars=transformer.getXPathContext().getVarStack();
if (!vars.isLocalSet(m_index)) {
int sourceNode=transformer.getXPathContext().getCurrentNode();
XObject var=getValue(transformer,sourceNode);
transformer.getXPat... | Execute a variable declaration and push it onto the variable stack. |
public AsicContainer(String message,SignatureData signature,TimestampData timestamp) throws Exception {
put(ENTRY_MIMETYPE,MIMETYPE);
put(ENTRY_MESSAGE,message);
put(ENTRY_SIGNATURE,signature.getSignatureXml());
put(ENTRY_SIG_HASH_CHAIN_RESULT,signature.getHashChainResult());
put(ENTRY_SIG_HASH_CHAIN,signatur... | Creates an AsicContainer containing given message, signature and timestamp. Attempts to verify it's contents. |
protected URLConnection createFileURLConnection(URL url,File file){
return new FileURLConnection(url,file);
}
| Template method to be overriden by Java Plug-in. [stanleyh] |
public void enableRowScaling(boolean enable){
mRowScaleEnabled=enable;
}
| Enables scaling of rows. |
public Vertex parseEquationForEvaluation(String code,Vertex speaker,Vertex target,boolean debug,Network network){
TextStream stream=new TextStream(code);
try {
Map<String,Map<String,Vertex>> elements=new HashMap<String,Map<String,Vertex>>();
elements.put(VARIABLE,new HashMap<String,Vertex>());
elements.... | Parse the code into a temporary equation so it can be evaluated. |
public synchronized boolean removeLast(K obj){
if (peekLast() != obj) {
return false;
}
head=Entry.removeLast(head);
return true;
}
| Remove the last element, if it matches. |
private static byte determineOrientation(World world,int x,int y,int z,EntityLivingBase entityLiving){
if (entityLiving != null) {
if (MathHelper.abs((float)entityLiving.posX - x) < 2.0F && MathHelper.abs((float)entityLiving.posZ - z) < 2.0F) {
double var5=entityLiving.posY + 1.82D - entityLiving.yOffset;
... | gets the way this piston should face for that entity that placed it. |
private String[] constructCommand(){
List<String> command=new ArrayList<String>();
command.add(tlapmPath.toOSString());
if (toolboxMode) {
command.add("--toolbox");
if (nodeToProve instanceof ModuleNode) {
command.add("0");
command.add("0");
}
else {
int beginLine=getBeginLine(nodeT... | Constructs and returns the command to launch the prover. |
public boolean isSetHello(){
return this.hello != null;
}
| Returns true if field hello is set (has been assigned a value) and false otherwise |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.