code
stringlengths
10
174k
nl
stringlengths
3
129k
@Override public Object eInvoke(int operationID,EList<?> arguments) throws InvocationTargetException { switch (operationID) { case TypeRefsPackage.FUNCTION_TYPE_REF___GET_DECLARED_THIS_TYPE: return getDeclaredThisType(); case TypeRefsPackage.FUNCTION_TYPE_REF___GET_TYPE_VARS: return getTypeVars(); case TypeRefsPa...
<!-- begin-user-doc --> <!-- end-user-doc -->
public int processByte(byte in,byte[] out,int outOff) throws DataLengthException, IllegalStateException { int resultLen=0; buf[bufOff++]=in; if (bufOff == buf.length) { resultLen=cipher.processBlock(buf,0,out,outOff); bufOff=0; } return resultLen; }
process a single byte, producing an output block if necessary.
long addLocation(String locationSetting,String cityName,double lat,double lon){ long locationId; Cursor locationCursor=getContext().getContentResolver().query(WeatherContract.LocationEntry.CONTENT_URI,new String[]{WeatherContract.LocationEntry._ID},WeatherContract.LocationEntry.COLUMN_LOCATION_SETTING + " = ?",new ...
Helper method to handle insertion of a new location in the weather database.
public static int deepHashCode(byte[][] array){ int result=1; for (int i=0; i < array.length; i++) { result=31 * result + deepHashCode(array[i]); } return result; }
Computes a hashcode based on the contents of a two-dimensional byte array rather than its identity.
public static void smallestFactors(int number,StackOfIntegers stack){ int i=2; while (number / i != 1) { if (number % i == 0) { stack.push(i); number/=i; } else i++; } stack.push(number); }
Find smallestFactors and push them to StackOfIntegers
private void bindView(View view,ExpandableListItem item,String[] from,int[] to){ for (int i=0; i < to.length; i++) { TextView textView=(TextView)view.findViewById(to[i]); if (textView != null) { textView.setText(item.get(from[i]).toString()); } } }
Binds an item's properties to a layout's text views.
protected void registerContextClasses(final Class<?> inputClass) throws NoSuchMethodException, NoSuchFieldException { final FastSet<Field> fields=getDeclaredFields(inputClass); for ( final Field field : fields) { final Class<?> type=field.getType(); final Class<?> scanClass; if (type.isAssignableFrom(L...
This method will scan the input class and all subclasses and register any JAXB objects as part of this reader
public static org.oscm.internal.vo.VOServiceLocalization convertToUp(org.oscm.vo.VOServiceLocalization oldVO){ if (oldVO == null) { return null; } org.oscm.internal.vo.VOServiceLocalization newVO=new org.oscm.internal.vo.VOServiceLocalization(); newVO.setNames(convertToUpVOLocalizedText(oldVO.getNames())); ...
Convert source version VO to target version VO.
public AccountInfo(final Address address,final Amount balance,final Amount vestedBalance,final BlockAmount numHarvestedBlocks,final String label,final double importance,final MultisigInfo multisigInfo){ this.address=address; this.keyPair=null == this.address.getPublicKey() ? null : new KeyPair(this.address.getPubli...
Creates a new account view model.
private static boolean into(int i,int[] I){ boolean in=false; for (int j=0; j < I.length; j++) { in=in || (i == I[j]); } return in; }
Determines if a value is within an array
private String issueReceipt(){ MInOut inOut=new MInOut(getCtx(),m_M_InOut_ID,null); if (inOut.isSOTrx() || !inOut.isProcessed() || !(MInOut.DOCSTATUS_Completed.equals(inOut.getDocStatus()) || MInOut.DOCSTATUS_Closed.equals(inOut.getDocStatus()))) throw new IllegalArgumentException("Receipt not valid - " + inOut);...
Issue Receipt
public void registerEvent(Object object,Method method){ noParamMap.put(object,method); }
register a method to execute when some time
public static <U,R>Function<ObservableTValue<U>,ObservableTValue<R>> lift(final Function<? super U,? extends R> fn){ return null; }
Lift a function into one that accepts and returns an ObservableT This allows multiple monad types to add functionality to existing functions and methods
<T>Task<T> enqueue(Continuation<Void,Task<T>> taskStart){ lock.lock(); try { Task<T> task; Task<Void> oldTail=tail != null ? tail : Task.<Void>forResult(null); try { Task<Void> toAwait=getTaskToAwait(); task=taskStart.then(toAwait); } catch ( RuntimeException e) { throw e; ...
Enqueues a task created by taskStart.
@Category(FlakyTest.class) @Test public void testParallelAsyncEventQueueHA_Scenario2(){ Integer lnPort=(Integer)vm0.invoke(null); vm1.invoke(createCacheRunnable(lnPort)); vm2.invoke(createCacheRunnable(lnPort)); LogWriterUtils.getLogWriter().info("Created the cache"); vm1.invoke(null); vm2.invoke(null); L...
Test case to test possibleDuplicates. vm1 & vm2 are hosting the PR. vm2 is killed and subsequently vm3 is brought up. Buckets are now rebalanced between vm1 & vm3.
public void print(int x){ out.print(x); out.flush(); }
Prints an integer to this output stream and flushes this output stream.
public static RoundingParams fromCornersRadii(float topLeft,float topRight,float bottomRight,float bottomLeft){ return (new RoundingParams()).setCornersRadii(topLeft,topRight,bottomRight,bottomLeft); }
Factory method that creates new RoundingParams with the specified corners radii.
private Base64(){ }
Defeats instantiation.
public static <T>T registerNewTarget(Class<T> clazz,String baseUrl){ T target; HoodieMetadataParser.parse(clazz); target=(T)Proxy.newProxyInstance(clazz.getClassLoader(),new Class[]{clazz},new ReflectiveInvocationHandler(baseUrl)); return target; }
Register new target
@Override public void addEventLine(EventLine line){ Protocol.debug("addEventLine (" + window + "): "+ line); if (this.window != null) { this.window.addChatLine(line.toString()); } }
just output a line on stdout
@Deprecated public CloudSolrClient(String zkHost){ this.zkHost=zkHost; this.clientIsInternal=true; this.myClient=HttpClientUtil.createClient(null); this.lbClient=new LBHttpSolrClient.Builder().withHttpClient(myClient).build(); this.lbClient.setRequestWriter(new BinaryRequestWriter()); this.lbClient.setParse...
Create a new client object that connects to Zookeeper and is always aware of the SolrCloud state. If there is a fully redundant Zookeeper quorum and SolrCloud has enough replicas for every shard in a collection, there is no single point of failure. Updates will be sent to shard leaders by default.
@Override public void execute(){ if (event.has("members")) { User.updateGroupStatus(event.getList("members"),event.get("lootmode")); GroupPanelController.get().update(event.getList("members"),event.get("leader"),event.get("lootmode")); } else { User.updateGroupStatus(null,null); GroupPanelControlle...
executes the event
public Related(String uri){ setUri(uri); }
Creates a related property.
private boolean isDownloadIdInOMASharedPrefs(long downloadId){ Set<String> omaDownloads=getStoredDownloadInfo(PENDING_OMA_DOWNLOADS); for ( String omaDownload : omaDownloads) { OMAEntry entry=OMAEntry.parseOMAEntry(omaDownload); if (entry.mDownloadId == downloadId) { return true; } } return f...
Check if a download ID is in OMA SharedPrefs.
public void toEPL(StringWriter writer,EPStatementFormatter formatter){ if (selectClause != null) { selectClause.toEPL(writer,formatter,false,false); writer.write(" from "); } splitExpression.toEPL(writer,ExpressionPrecedenceEnum.MINIMUM); if (optionalSplitExpressionTypeName != null) { writer.write("...
Returns the EPL.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:28:18.847 -0500",hash_original_method="7198CC6BA3A84102ED750212181BD596",hash_generated_method="CD4840D16E29173496AB01362327D8D0") public static boolean isEpoch(Time time){ long millis=time.toMillis(true); return getJulianDay(milli...
Returns true if the day of the given time is the epoch on the Julian Calendar (January 1, 1970 on the Gregorian calendar).
void processAncestorClass(AsClass ancestorClass,AsClass thisClass){ if (verbose) { System.out.println("processAncestorClass - thisClass " + thisClass.getFullName() + " ancestorClass "+ ancestorClass.getFullName()); } if (ancestorClass.getFields() != null) { NodeList baseFieldList=ancestorClass.getFields()...
This function is used to process the base classes whne processing a class inheritance.
public static CCSprite sprite(String spriteFrameName,boolean isFrame){ return new CCSprite(spriteFrameName,isFrame); }
Creates an sprite with an sprite frame name. An CCSpriteFrame will be fetched from the CCSpriteFrameCache by name. If the CCSpriteFrame doesn't exist it will raise an exception.
private void grow(int wd){ int newLen=Math.max(this.word.length,wd + 1); long[] tmp=new long[newLen]; System.arraycopy(this.word,0,tmp,0,this.word.length); this.word=tmp; }
Grow this bit vector to contain at least <code>wd+1</code> words.
public void testCertPathValidator02(){ try { CertPathValidator.getInstance(null); fail("NullPointerException or NoSuchAlgorithmException must be thrown when algorithm is null"); } catch ( NullPointerException e) { } catch ( NoSuchAlgorithmException e) { } for (int i=0; i < invalidValues.length; i++...
Test for <code>getInstance(String algorithm)</code> method Assertion: throws NullPointerException when algorithm is null throws NoSuchAlgorithmException when algorithm is not available
public String generateKeyPair(X509Certificate issuerCert,X509Certificate[] issuerCertChain,PrivateKey issuerPrivateKey){ String alias=""; try { int keyPairSize=applicationSettings.getGenerateKeyPairSize(); KeyPairType keyPairType=applicationSettings.getGenerateKeyPairType(); KeyStore activeKeyStore=kseF...
Generate a key pair (with certificate) in the currently opened KeyStore.
public void writeSkyLight(ByteBuf output){ output.writeBytes(skyLight.getHandle()); }
Write the sky light to a buffer
public static StorageImage create(String fileName,byte[] data,int width,int height){ if (Storage.getInstance().writeObject(fileName,data)) { return new StorageImage(fileName,width,height,true); } return null; }
Creates an encoded image that maps to a storage file thus allowing to seamlessly cache images as needed. This only works reasonably well for very small files.
public boolean hasUnsupportedCriticalExtension(){ Set extns=getCriticalExtensionOIDs(); return extns != null && !extns.isEmpty(); }
Will return true if any extensions are present and marked as critical as we currently don't handle any extensions!
public void deleteItem(AutomationItem item){ if (item != null) { if (item.isActionRunning()) { stop(); } if (getCurrentAutomationItem() == item) { setNextAutomationItem(); } String id=item.getId(); item.dispose(); int old=getSize(); _automationHashTable.remove(id); rese...
Delete a AutomationItem
public void waitForTick(long periodMs){ long remaining=periodMs - (long)period.milliseconds(); if (remaining > 0) { try { Thread.sleep(remaining); } catch ( InterruptedException e) { Thread.currentThread().interrupt(); } } period.reset(); }
waitForTick implements a periodic delay. However, this acts like a metronome with a regular periodic tick. This is used to compensate for varying processing times for each cycle. The function looks at the elapsed cycle time, and sleeps for the remaining time interval.
public static <D extends GenericDeclaration>Annotation[] parseTypeVariableAnnotations(D genericDecl,int typeVarIndex){ AnnotatedElement decl; TypeAnnotationTarget predicate; if (genericDecl instanceof Class) { decl=(Class<?>)genericDecl; predicate=TypeAnnotationTarget.CLASS_TYPE_PARAMETER; } else if ...
Parse regular annotations on a TypeVariable declared on genericDecl. Regular Annotations on TypeVariables are stored in the type annotation byte[] in the class file.
public Ethernet(){ super(); this.vlanID=VLAN_UNTAGGED; }
By default, set Ethernet to untagged
public void run(){ try { if (files.length > MAX_SCRIPT_FILE_NUMBER_OF_ARGUMENTS) { List<File[]> fileArrays=splitArray(files,MAX_SCRIPT_FILE_NUMBER_OF_ARGUMENTS); for ( File[] fileSubset : fileArrays) { Runtime.getRuntime().exec(createWSHScriptCommand(playlist,fileSubset)); } } ...
Runs the osascript command
public static <NodeType extends IGraphNode<NodeType>>Pair<Tree<NodeType>,HashMap<NodeType,ITreeNode<NodeType>>> calculate(final IDirectedGraph<NodeType,?> graph,final NodeType rootNode) throws MalformedGraphException { Preconditions.checkNotNull(graph,"Error: Graph argument can not be null"); Preconditions.checkNot...
Generates the dominator tree of a directed graph.
public static boolean isvalidEmailFormat(CharSequence target){ if (TextUtils.isEmpty(target)) return false; else return android.util.Patterns.EMAIL_ADDRESS.matcher(target).matches(); }
Check Email Address Format is valid or not
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:19.860 -0500",hash_original_method="1A9A71EFE325E55C19A2B451F1A9B9E2",hash_generated_method="F7E005DD24A38F96E3E071826A6E3889") public int compareToIgnoreCase(String string...
Compares the specified string to this string using the Unicode values of the characters, ignoring case differences. Returns 0 if the strings contain the same characters in the same order. Returns a negative integer if the first non-equal character in this string has a Unicode value which is less than the Unicode value ...
public boolean isWaitingForMoreInput(){ return state == State.WAITING_FOR_INPUT; }
In this state, the object is waiting for more input to deflate. <p> Only in this state it's legal to feed this
public void indexSourceFolder(JavaProject javaProject,IPath sourceFolder,char[][] inclusionPatterns,char[][] exclusionPatterns){ IProject project=javaProject.getProject(); if (this.jobEnd > this.jobStart) { IndexRequest request=new IndexAllProject(project,this); if (isJobWaiting(request)) return; } ...
Index the content of the given source folder.
public ServerBuilder maxPendingRequests(int maxPendingRequests){ this.maxPendingRequests=ServerConfig.validateMaxPendingRequests(maxPendingRequests); return this; }
Sets the maximum allowed number of pending requests.
public boolean equals(Object o){ if (this == o) return true; if (o instanceof JarPackageFragmentRoot) { JarPackageFragmentRoot other=(JarPackageFragmentRoot)o; return this.jarPath.equals(other.jarPath); } return false; }
Returns true if this handle represents the same jar as the given handle. Two jars are equal if they share the same zip file.
protected void sequence_S_If(ISerializationContext context,S_If semanticObject){ genericSequencer.createSequence(context,semanticObject); }
Contexts: Statement returns S_If S_If returns S_If Constraint: (key='if' firstFacet='condition:'? expr=Expression block=Block (else=S_If | else=Block)?)
public T nowrap(String value){ return attr("nowrap",value); }
Sets the <code>nowrap</code> attribute on the last started tag that has not been closed.
public static String toString(int x){ return toString(x,10); }
Returns a string representation of x, where x is treated as unsigned.
public IndexDescriptor addIndex(String idxName,GridQueryIndexType type) throws IgniteCheckedException { IndexDescriptor idx=new IndexDescriptor(type); if (indexes.put(idxName,idx) != null) throw new IgniteCheckedException("Index with name '" + idxName + "' already exists."); return idx; }
Adds index.
default B baseColor(final DyeColor color){ this.meta().setBaseColor(color); return this.getBuilder(); }
Sets the base color for this banner
public static final String unescapeHtml3(final String input){ return UNESCAPE_HTML3.translate(input); }
<p>Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes. Supports only HTML 3.0 entities.</p>
private String prepareAverageRatingForSorting(){ StringBuffer buffer=new StringBuffer(); buffer.append(", COALESCE("); buffer.append(" (SELECT averagerating"); buffer.append(" FROM productfeedback AS pf"); buffer.append(" WHERE pf.product_tkey = p.tkey)"); buffer.append(" ,"); buffer.append("...
Generates a rating column in the select list
public boolean isZoomEnabled(){ return isZoomXEnabled() || isZoomYEnabled(); }
Returns the enabled state of the zoom on at least one axis.
public StrokeMap(){ this.store=new TreeMap(); }
Creates a new (empty) map.
private ImageCache(float memCacheSizePercent){ init(memCacheSizePercent); }
Creating a new ImageCache object using the specified parameters.
public void addBox(float x,float y,float z,int w,int h,int d,float expansion,float scale){ float scaleX=w * scale; float scaleY=h * scale; float scaleZ=d * scale; float x1=x + scaleX; float y1=y + scaleY; float z1=z + scaleZ; float expX=expansion + scaleX - w; float expY=expansion + scaleY - h; float ...
Adds a new box to the model.
void readFile(File file) throws org.jdom2.JDOMException, java.io.IOException { XmlFile xf=new XmlFile(){ } ; xf.rootFromFile(file); }
Ask SAX to read and verify a file
public Columns(@IntRange(from=1) int columnCount,int initialCapacity){ super(initialCapacity); mColumnCount=columnCount; }
Create spec layer that will evenly divide current bounds in given number of columns and then draw all child layers in each
@CheckResult @Nullable static Icon findIconForKey(@NonNull String iconKey){ for (int i=0, iconFontDescriptorsSize=iconFontDescriptors.size(); i < iconFontDescriptorsSize; i++) { IconFontDescriptorWrapper iconFontDescriptor=iconFontDescriptors.get(i); Icon icon=iconFontDescriptor.getIcon(iconKey); if (icon...
Retrieve an icon from a key,
public static Vector<Region> loadAllRegions(File saveFolder) throws IOException { Vector<Region> ret=new Vector<Region>(); File dir=new File(saveFolder.getAbsoluteFile() + "/region"); if (!dir.exists() || !dir.isDirectory()) throw new FileNotFoundException(dir.getAbsolutePath()); File[] files=dir.listFiles();...
Get the list of all regions in the given save.
final public static double[] earthCircle(double phi1,double lambda0,double c,int n,double[] ret_val){ return earthCircle(phi1,lambda0,c,0.0f,MoreMath.TWO_PI_D,n,ret_val); }
Calculate earth circle in the sphere with double precision. <p> Returns n float lat,lon pairs at arc distance c from point at phi1,lambda0. <p>
private void startupSocket(InetAddress dstAddress,int dstPort,InetAddress localAddress,int localPort,boolean streaming) throws IOException { if (localPort < 0 || localPort > 65535) { throw new IllegalArgumentException("Local port out of range: " + localPort); } InetAddress addr=localAddress == null ? Inet4Add...
Creates a stream socket, binds it to the nominated local address/port, then connects it to the nominated destination address/port.
public boolean isVerbose(){ return verbose; }
True iff verbose output should be printed.
public void notifyMessage(final String message,final String title){ if (message == null || title == null) { return; } if (title.indexOf(AbstractConditionsAttachment.TRIGGER_CHANCE_FAILURE) != -1 && message.indexOf(AbstractConditionsAttachment.TRIGGER_CHANCE_FAILURE) != -1 && !getUIContext().getShowTriggerChan...
We do NOT want to block the next player from beginning their turn.
protected String extractJavaFile(String srcDir,String clazz){ clazz=clazz.replaceAll("\\.",File.separator); if (!srcDir.endsWith(File.separator)) { srcDir+=File.separator; } return srcDir + clazz + ".java"; }
<p> extractJavaFile </p>
public RepositoryStateMachineModelFactory(StateRepository<? extends RepositoryState> stateRepository,TransitionRepository<? extends RepositoryTransition> transitionRepository){ this.stateRepository=stateRepository; this.transitionRepository=transitionRepository; }
Instantiates a new repository state machine model factory.
public String toString(){ if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) { MODELMBEAN_LOGGER.logp(Level.FINER,ModelMBeanOperationInfo.class.getName(),"toString()","Entry"); } String retStr="ModelMBeanOperationInfo: " + this.getName() + " ; Description: "+ this.getDescription()+ " ; Descriptor: "+ this.getDesc...
Returns a string containing the entire contents of the ModelMBeanOperationInfo in human readable form.
public void drawString(String str,float x,float y){ drawString(str,x,y,getFont(),getFontRenderContext(),0f); }
Renders the text specified by the specified <code>String</code>, using the current <code>Font</code> and <code>Paint</code> attributes in the <code>Graphics2D</code> context. The baseline of the first character is at position (<i>x</i>,&nbsp;<i>y</i>) in the User Space. The rendering attributes applied include the <cod...
public NoteendpointRequest(JsonHttpClient client,HttpMethod method,String uriTemplate,Object content){ super(client,method,uriTemplate,content); }
Builds an instance of NoteendpointRequest.
public JarInputReader(String jarFilePath,String jarEntryName) throws IOException { if (Debug.debugging("binaryfile")) { Debug.output("JarInputReader created for " + jarEntryName + " in "+ jarFilePath); } this.jarFileName=jarFilePath; this.jarEntryName=jarEntryName; reopen(); name=jarFilePath + "!" + jar...
Create a JarInputReader win the path to a jar file, and the entry name. The entry name should be a path to the entry from the internal root of the jar file.
private void expandProperty(final int index){ final int selectedRow=getSelectedRow(); final Property property=myProperties.get(index); final String dottedName=getDottedName(property); if (myExpandedProperties.contains(dottedName)) return; myExpandedProperties.add(dottedName); final Property[] children=get...
Expands property with the specified index. The method fires event that model changes and keeps currently selected row.
private void calcXValAverageLength(){ if (mXVals.size() <= 0) { mXValAverageLength=1; return; } float sum=1f; for (int i=0; i < mXVals.size(); i++) { sum+=mXVals.get(i).length(); } mXValAverageLength=sum / (float)mXVals.size(); }
calculates the average length (in characters) across all x-value strings
public void actionPerformed(ActionEvent e){ DefaultMutableTreeNode lastItem=getSelectedNode(); if (lastItem != null) { treeModel.reload(lastItem); } }
Messaged when the user clicks on the Reload menu item. Determines the selection from the Tree and asks the treemodel to reload from that node.
public static void checkAndAppendTimeElement(AVList params,String paramKey,Element context,String path){ if (params == null) { String message=Logging.getMessage("nullValue.ParametersIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } if (paramKey == null) { S...
Checks a parameter list for a specified key and if present attempts to append new elements represeting the parameter to a specified context.
private Map<String,List<VPlexRecommendation>> sortRecommendationsByVarray(List<Recommendation> recommendations,URI[] vplexSystemURIOut){ URI vplexStorageSystemURI=null; Map<String,List<VPlexRecommendation>> varrayRecommendationsMap=new HashMap<String,List<VPlexRecommendation>>(); for ( Recommendation recommendat...
Sort the recommendations by VirtualArray. There can be up to two VirtualArrays, the requested VirtualArray and the HA VirtualArray either passed or determined by the placement when HA virtual volumes are being created. We also set the VPlex storage system, which should be the same for all recommendations.
public VertexBufferObject(boolean isStatic,int numVertices,VertexAttribute... attributes){ this(isStatic,numVertices,new VertexAttributes(attributes)); }
Constructs a new interleaved VertexBufferObject.
@Override public void mouseClicked(MouseEvent e){ if (m_clickAvailable) { int s=-1; for (int noa=0; noa < m_numNodes; noa++) { if (m_nodes[noa].m_quad == 18) { calcScreenCoords(noa); if (e.getX() <= m_nodes[noa].m_center + m_nodes[noa].m_side && e.getX() >= m_nodes[noa].m_center - m_node...
Does nothing.
protected void computeOutlierScores(KNNQuery<O> knnq,final DBIDs ids,WritableDataStore<double[]> densities,WritableDoubleDataStore kdeos,DoubleMinMax minmax){ final int knum=kmax + 1 - kmin; FiniteProgress prog=LOG.isVerbose() ? new FiniteProgress("Computing KDEOS scores",ids.size(),LOG) : null; double[][] scratc...
Compute the final KDEOS scores.
public static int adjustAlpha(int color,float factor){ int alpha=Math.round(Color.alpha(color) * factor); int red=Color.red(color); int green=Color.green(color); int blue=Color.blue(color); return Color.argb(alpha,red,green,blue); }
Adjust the alpha of a color.
protected void integrityCheckParameters(N parent,int index){ E entry=parent.getEntry(index); HyperBoundingBox mbr=computeMBR(); if (mbr == null) { return; } if (!SpatialUtil.equals(entry,mbr)) { String soll=mbr.toString(); String ist=new HyperBoundingBox(entry).toString(); throw new RuntimeExc...
Tests, if the parameters of the entry representing this node, are correctly set. Subclasses may need to overwrite this method.
private static boolean isWindowOpacitySupported(){ Toolkit curToolkit=Toolkit.getDefaultToolkit(); if (!(curToolkit instanceof SunToolkit)) { return false; } return ((SunToolkit)curToolkit).isWindowOpacitySupported(); }
Returns whether the windowing system supports changing the opacity value of top-level windows. Note that this method may sometimes return true, but the native windowing system may still not support the concept of translucency (due to the bugs in the windowing system).
public boolean wasMovedFromHomeInLastMove(){ return moveCountSinceHome <= 1; }
was this token on its home spot before the last move?
public List<FractionManifest> fractionManifests(){ if (this.mode == Mode.UBERJAR && this.manifests == null) { try { loadFractionManifestsFromUberjar(); } catch ( IOException|ModuleLoadException e) { throw new RuntimeException(e); } } return this.manifests; }
Retrieve a sorted list of installed fraction manifests.
private void compareL1WithL2(ResourceBundle l1,ResourceBundle l2){ Locale locale="".equals(l2.getLocale().getCountry()) ? Locale.ENGLISH : l2.getLocale(); Enumeration<String> keys=l1.getKeys(); Set<String> l2KeySet=new HashSet<>(Collections.list(l2.getKeys())); StringBuilder misses=new StringBuilder(); while ...
Compare l1 with l2.
public static <V>int addDistinctList(List<V> sourceList,List<V> entryList){ if (sourceList == null || isEmpty(entryList)) { return 0; } int sourceCount=sourceList.size(); for ( V entry : entryList) { if (!sourceList.contains(entry)) { sourceList.add(entry); } } return sourceList.size() - ...
add all distinct entry to list1 from list2
public Constituent createConstituentAnnotation(int aBegin,int aEnd,String aConstituentType,String aSyntacticFunction){ Type constType=constituentMappingProvider.getTagType(aConstituentType); Constituent constAnno=(Constituent)jCas.getCas().createAnnotation(constType,aBegin,aEnd); constAnno.setConstituentType(aCon...
Creates a new Constituent annotation. Links to parent- and child-annotations are not yet created here.
@Override public void eSet(int featureID,Object newValue){ switch (featureID) { case SexecPackage.IF__CHECK: setCheck((Check)newValue); return; case SexecPackage.IF__THEN_STEP: setThenStep((Step)newValue); return; case SexecPackage.IF__ELSE_STEP: setElseStep((Step)newValue); return; } super.eSet(featureID,newValu...
<!-- begin-user-doc --> <!-- end-user-doc -->
public void loadVersion1(File f) throws ConfigPersisterException { try { Props props=new Props(f); _config=new Config(); String header=props.getProperty(Config.HEADER); _config.setHeaderType(header == null || header.toLowerCase().equals("guihead.bin") ? Config.GUI_HEADER : Config.CONSOLE_HEADER); ...
Imports launch4j 1.x.x config file.
public DOMReference(String uri,String type,DigestMethod dm,List<? extends Transform> transforms,String id,Provider provider){ this(uri,type,dm,null,null,transforms,id,null,provider); }
Creates a <code>Reference</code> from the specified parameters.
public DiasporaPodList fromJson(JSONObject json) throws JSONException { JSONArray jarr; pods.clear(); if (json.has("pods")) { jarr=json.getJSONArray("pods"); for (int i=0; i < jarr.length(); i++) { DiasporaPod pod=new DiasporaPod().fromJson(jarr.getJSONObject(i)); pods.add(pod); } } if...
Load DiasporaPodList from Json
private void updateHistoryModDate(DomainObject<?> obj,Date date){ obj.setHistoryModificationTime(Long.valueOf(date.getTime())); }
Update the modification date of the last history record for the given subscription.
protected void sequence_TAnnotationStringArgument(ISerializationContext context,TAnnotationStringArgument semanticObject){ if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject,TypesPackage.Literals.TANNOTATION_STRING_ARGUMENT__VALUE) == ValueTransient.YES) errorAcceptor.accept(diag...
Contexts: TAnnotationArgument returns TAnnotationStringArgument TAnnotationStringArgument returns TAnnotationStringArgument Constraint: value=STRING
protected boolean removeIfPresentEstimate(EstimateMapKey key,LoadEstimateTask task){ return estimateMap.remove(key,task); }
Remove the task from the estimate map at the given key.
public static Project v(){ return project; }
Return the singleton project object the current run of DroidSafe.
public OverTheTopLayer generateBitmap(Resources resources,int drawableResId,float mScalingFactor,int[] location){ if (location == null) { location=new int[]{0,0}; } else if (location.length != 2) { throw new OverTheTopLayerException("Requires location as an array of length 2 - [x,y]"); } Bitmap bitma...
Draws the image as per the drawable resource id on the given location pixels.
public ToStringHelper addValue(boolean value){ return addHolder(String.valueOf(value)); }
Adds an unnamed value to the formatted output.
private void DFS(TreeNode node){ list.add(node); Enumeration<TreeNode> childEnum=node.getChildren(); while (childEnum.hasMoreElements()) { TreeNode child=childEnum.nextElement(); DFS(child); } }
A preorder depth first traversal, adding nodes to the list
public void addRule(Rule rule){ this.qtyRulesRead++; rule.setOwner(owner); if (numDenseFeatures == 0) numDenseFeatures=rule.getFeatureVector().getDenseFeatures().size(); MemoryBasedTrie pos=root; int[] french=rule.getFrench(); maxSourcePhraseLength=Math.max(maxSourcePhraseLength,french.length); for ( i...
Adds a rule to the grammar.
@Override protected void register(DeployerFactory deployerFactory){ deployerFactory.registerDeployer("jboss3x",DeployerType.INSTALLED,JBossInstalledLocalDeployer.class); deployerFactory.registerDeployer("jboss4x",DeployerType.INSTALLED,JBossInstalledLocalDeployer.class); deployerFactory.registerDeployer("jboss4x"...
Register deployer.