code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
---|---|
public CorrelationMatrix(ICovarianceMatrix matrix,boolean inPlace){
this(matrix.getVariables(),(inPlace ? matrix.getMatrix() : new CovarianceMatrix(matrix).getMatrix()),matrix.getSampleSize(),inPlace);
}
| Constructs a new correlation matrix using the covariances in the given covariance matrix. |
@Override public int size(){
return this._set.size();
}
| Returns the number of entries in the set. |
public static void isGTE(String argName,long i,long min){
if (i < min) {
throw new IllegalArgumentException(String.format("%s must be >= %d; was %d",argName,min,i));
}
}
| Makes sure the given number is greater than or equal to the given minimum. |
public String toString(){
return ":" + getLocalName();
}
| Returns a representation of the selector. |
public static CompiledScript compileScriptString(String language,String script) throws ScriptException {
Assert.notNull("language",language,"script",script);
String cacheKey=language.concat("://").concat(script);
CompiledScript compiledScript=parsedScripts.get(cacheKey);
if (compiledScript == null) {
ScriptEngineManager manager=new ScriptEngineManager();
ScriptEngine engine=manager.getEngineByName(language);
if (engine == null) {
throw new IllegalArgumentException("The script type is not supported for language: " + language);
}
try {
Compilable compilableEngine=(Compilable)engine;
compiledScript=compilableEngine.compile(script);
if (Debug.verboseOn()) {
Debug.logVerbose("Compiled script [" + script + "] using engine "+ engine.getClass().getName(),module);
}
}
catch ( ClassCastException e) {
if (Debug.verboseOn()) {
Debug.logVerbose("Script engine " + engine.getClass().getName() + " does not implement Compilable",module);
}
}
if (compiledScript != null) {
parsedScripts.putIfAbsent(cacheKey,compiledScript);
}
}
return compiledScript;
}
| Returns a compiled script. |
public void notifyDataChanged(){
init(mDataSets);
}
| Call this method to let the CartData know that the underlying data has changed. |
public boolean isProcessing(){
Object oo=get_Value(COLUMNNAME_Processing);
if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
| Get Process Now. |
public DrawerBuilder withItemAnimator(@NonNull RecyclerView.ItemAnimator itemAnimator){
mItemAnimator=itemAnimator;
return this;
}
| defines the itemAnimator to be used in conjunction with the RecyclerView |
public void testGetServletRunAsRole() throws Exception {
String xml=WEBAPP_TEST_HEADER + "" + " <servlet>"+ " <servlet-name>s1</servlet-name>"+ " <servlet-class>sclass1</servlet-class>"+ " <run-as>"+ " <role-name>r1</role-name>"+ " </run-as>"+ " </servlet>"+ "</web-app>";
WebXml webXml=WebXmlIo.parseWebXml(new ByteArrayInputStream(xml.getBytes("UTF-8")),getEntityResolver());
String roleName=WebXmlUtils.getServletRunAsRoleName(webXml,"s1");
assertEquals("r1",roleName);
}
| Tests that the a servlets run-as role-name can be extracted. |
public boolean isAllowUnassignedIssues(){
return allowUnassignedIssues;
}
| Gets the allowUnassignedIssues value for this RemoteConfiguration. |
public static double blackFormula(final PlainVanillaPayoff payoff,@Real final double strike,@Real final double forward,@StdDev final double stddev,@DiscountFactor final double discount,@Real final double displacement){
return blackFormula(payoff.optionType(),payoff.strike(),forward,stddev,discount,displacement);
}
| Black 1976 formula |
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
ois.defaultReadObject();
}
| Restore a persistent object, must wait for subsequent setBeanContext() to fully restore any resources obtained from the new nesting BeanContext |
public static void remove(final String key){
SharedPreferences prefs=getOptimusPref();
final Editor editor=prefs.edit();
editor.remove(key).apply();
}
| Removes a preference value. |
public boolean isConnectEnabled(){
return connectEnabled;
}
| Gets the value of the connectEnabled property. |
public void loadPDF(final String input){
if (input == null) {
return;
}
scale=1;
PDFfile=input;
fileLoc.setText(PDFfile);
if (input.startsWith("http")) {
openFile(null,input,true);
}
else {
openFile(new File(input),null,false);
}
}
| take a File handle to PDF file on local filesystem and displays in PDF viewer |
public static boolean unexportObject(Remote obj,boolean force) throws NoSuchObjectException {
return sun.rmi.transport.ObjectTable.unexportObject(obj,force);
}
| Remove the remote object, obj, from the RMI runtime. If successful, the object can no longer accept incoming RMI calls. If the force parameter is true, the object is forcibly unexported even if there are pending calls to the remote object or the remote object still has calls in progress. If the force parameter is false, the object is only unexported if there are no pending or in progress calls to the object. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:36:25.948 -0500",hash_original_method="55B596B0C996801BF0FD9956A535E1C7",hash_generated_method="1CE8E8BF6FF20203CD69EBA8E105DEF8") public SimpleSessionDescription(String message){
String[] lines=message.trim().replaceAll(" +"," ").split("[\r\n]+");
Fields fields=mFields;
for ( String line : lines) {
try {
if (line.charAt(1) != '=') {
throw new IllegalArgumentException();
}
if (line.charAt(0) == 'm') {
String[] parts=line.substring(2).split(" ",4);
String[] ports=parts[1].split("/",2);
Media media=newMedia(parts[0],Integer.parseInt(ports[0]),(ports.length < 2) ? 1 : Integer.parseInt(ports[1]),parts[2]);
for ( String format : parts[3].split(" ")) {
media.setFormat(format,null);
}
fields=media;
}
else {
fields.parse(line);
}
}
catch ( Exception e) {
throw new IllegalArgumentException("Invalid SDP: " + line);
}
}
}
| Creates a session description from the given message. |
private void resetPhotoView(){
if (mPhotoView != null) {
mPhotoView.bindPhoto(null);
}
}
| Resets the photo view to it's default state w/ no bound photo. |
public List<K> toKeys(){
return root.toList(null);
}
| Retrieves an ordered list of all keys of the map. |
public GeometryLocation locateNonVertexPoint(Coordinate testPt,double tolerance){
Geometry geom=getGeometry();
if (geom == null) return null;
return GeometryPointLocater.locateNonVertexPoint(getGeometry(),testPt,tolerance);
}
| Locates a non-vertex point on a line segment of the current geometry within the given tolerance, if any. Returns the closest point on the segment. |
final Object peek(){
int size=stack.size();
return size == 0 ? null : stack.get(size - 1);
}
| Return the top object on the stack without removing it. If there are no objects on the stack, return <code>null</code>. |
private void initNullGraphicsDevice(){
graphicsDevices[NULL_GRAPHICS_DEVICE_INDEX]=NullGraphicsDevice.getInstance();
}
| According to GNUR 0 index is for the Null graphics device. |
public void runTest() throws Throwable {
Document doc;
NodeList elementList;
Node nameNode;
CharacterData child;
String substring;
doc=(Document)load("staff",false);
elementList=doc.getElementsByTagName("name");
nameNode=elementList.item(0);
child=(CharacterData)nameNode.getFirstChild();
substring=child.substringData(0,8);
assertEquals("characterdataSubStringValueAssert","Margaret",substring);
}
| Runs the test case. |
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-17 12:44:27.054 -0400",hash_original_method="AE8D2F77597464B24506681CBB435A18",hash_generated_method="F96AA07650E84FF2DD96427AE369120F") @Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
mFragments.noteStateNotSaved();
int index=requestCode >> 16;
if (index != 0) {
index--;
if (mFragments.mActive == null || index < 0 || index >= mFragments.mActive.size()) {
Log.w(TAG,"Activity result fragment index out of range: 0x" + Integer.toHexString(requestCode));
return;
}
Fragment frag=mFragments.mActive.get(index);
if (frag == null) {
Log.w(TAG,"Activity result no fragment exists for index: 0x" + Integer.toHexString(requestCode));
}
else {
frag.onActivityResult(requestCode & 0xffff,resultCode,data);
}
return;
}
super.onActivityResult(requestCode,resultCode,data);
}
| Dispatch incoming result to the correct fragment. |
public static void customMethod(String methodType,String methodName,Class<?> clazz){
String completeName=clazz.getCanonicalName();
String packageName=clazz.getPackage().getName();
String className=completeName.substring(packageName.length() + 1);
throw new MalformedBeanException(MSG.INSTANCE.message(customMethodException,methodType,methodName,className));
}
| Thrown when the bean doesn't respect the javabean conventions. |
public static String scrubSubscriberId(String subscriberId){
if ("eng".equals(Build.TYPE)) {
return subscriberId;
}
else if (subscriberId != null) {
return subscriberId.substring(0,Math.min(6,subscriberId.length())) + "...";
}
else {
return "null";
}
}
| Scrub given IMSI on production builds. |
public void println(char x){
out.println(x);
}
| Print a char and then terminate the line. |
public void testDetectLanguageVi(){
LOGGER.debug("detectLanguage vi");
LanguageDetector instance=LanguageDetector.getInstance();
Document doc;
try {
doc=Jsoup.parse(new File(PATH + "vi.wikipedia.org-wiki_20140701.html"),UTF_8);
LOGGER.debug("start detection");
assertEquals("vi",instance.detectLanguage(doc.text()).getDetectedLanguage());
assertEquals("vi",instance.detectLanguage(doc.text().toLowerCase()).getDetectedLanguage());
assertEquals("vi",instance.detectLanguage(doc.text().toUpperCase()).getDetectedLanguage());
LOGGER.debug("detection ended");
}
catch ( IOException ex) {
LOGGER.error(ex);
}
catch ( NullPointerException npe) {
LOGGER.error("error while fetching page " + npe);
}
}
| Test of detectLanguage method, of class LanguageDetector with vi pages. |
@Override public boolean eIsSet(int featureID){
switch (featureID) {
case ImPackage.SNIPPET__CODE:
return CODE_EDEFAULT == null ? code != null : !CODE_EDEFAULT.equals(code);
}
return super.eIsSet(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public LayersPanel(){
super();
setKey(defaultKey);
setLayout(new BorderLayout());
}
| Construct the LayersPanel. |
public static boolean startsWithHTTP(final String s){
try {
int at=0;
while (Character.isWhitespace(s.charAt(at))) {
++at;
}
return ("HTTP".equals(s.substring(at,at + 4)));
}
catch ( final StringIndexOutOfBoundsException e) {
return false;
}
}
| Tests if the string starts with 'HTTP' signature. |
private void unindex(final VirtualFile root,final List<FilePath> files,boolean toUnversioned) throws VcsException {
GitFileUtils.delete(myProject,root,files,"--cached","-f");
if (toUnversioned) {
final GitRepository repo=GitUtil.getRepositoryManager(myProject).getRepositoryForRoot(root);
final GitUntrackedFilesHolder untrackedFilesHolder=(repo == null ? null : repo.getUntrackedFilesHolder());
for ( FilePath path : files) {
final VirtualFile vf=VcsUtil.getVirtualFile(path.getIOFile());
if (untrackedFilesHolder != null && vf != null) {
untrackedFilesHolder.add(vf);
}
}
}
}
| Remove file paths from index (git remove --cached). |
public static void log(String event,String user,String reason,Map<String,Object> data){
Map<String,Object> message=new LinkedHashMap<>();
message.put(EVENT_PARAM,event + FAILURE_SUFFIX);
message.put(USER_PARAM,user);
message.put(REASON_PARAM,reason);
message.put(DATA_PARAM,data);
log(JsonUtils.getSerializer().toJson(message));
}
| Log a failure event with data for a user. |
static final int advanceProbe(int probe){
probe^=probe << 13;
probe^=probe >>> 17;
probe^=probe << 5;
setProbe(probe);
return probe;
}
| Pseudo-randomly advances and records the given probe value for the given thread. Duplicated from ThreadLocalRandom because of packaging restrictions. |
public VariableStatementKeyword createVariableStatementKeywordFromString(EDataType eDataType,String initialValue){
VariableStatementKeyword result=VariableStatementKeyword.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '"+ eDataType.getName()+ "'");
return result;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private void nextToken(String r){
int t=0;
try {
t=m_st.nextToken();
}
catch ( IOException e) {
}
if (t == StreamTokenizer.TT_EOF) {
System.out.println("eof , " + r);
}
else if (t == StreamTokenizer.TT_NUMBER) {
System.out.println("got a number , " + r);
}
}
| This will parse the next token out of the stream and check for certain conditions. |
public ClientResourceException(final int statusCode){
this.statusCode=statusCode;
}
| Creates a new exposition instance with the HTTP status code argument. |
private void buildModel(RecordHolder record,Map<String,List<String>> modelAccessionNestsModelAccession){
if (record.getModelAc() != null) {
clanData.addModel(record.getModelAc());
if (record.getNestedDomains().size() > 0) {
for ( String nestedDomain : record.getNestedDomains()) {
List<String> nestedDomains=modelAccessionNestsModelAccession.get(record.getModelAc());
if (nestedDomains == null) {
nestedDomains=new ArrayList<String>();
}
nestedDomains.add(nestedDomain);
modelAccessionNestsModelAccession.put(record.getModelAc(),nestedDomains);
}
}
}
}
| For a single record parsed from the flat file, builds the required objects and stores them in the PfamClanData object. |
public synchronized void write(int b) throws IOException {
while (pos >= buffer.length) push();
buffer[pos++]=(byte)b;
}
| Write a byte over connection. |
public byte[] encode(StunStack stunStack) throws IllegalStateException {
prepareForEncoding();
validateAttributePresentity();
final char dataLength;
dataLength=getDataLength();
byte binMsg[]=new byte[HEADER_LENGTH + dataLength];
int offset=0;
binMsg[offset++]=(byte)(getMessageType() >> 8);
binMsg[offset++]=(byte)(getMessageType() & 0xFF);
final int messageLengthOffset=offset;
offset+=2;
byte tranID[]=getTransactionID();
if (tranID.length == 12) {
System.arraycopy(MAGIC_COOKIE,0,binMsg,offset,4);
offset+=4;
System.arraycopy(tranID,0,binMsg,offset,TRANSACTION_ID_LENGTH);
offset+=TRANSACTION_ID_LENGTH;
}
else {
System.arraycopy(tranID,0,binMsg,offset,RFC3489_TRANSACTION_ID_LENGTH);
offset+=RFC3489_TRANSACTION_ID_LENGTH;
}
Vector<Map.Entry<Character,Attribute>> v=new Vector<>();
Iterator<Map.Entry<Character,Attribute>> iter=null;
char dataLengthForContentDependentAttribute=0;
synchronized (attributes) {
v.addAll(attributes.entrySet());
}
iter=v.iterator();
while (iter.hasNext()) {
Attribute attribute=iter.next().getValue();
int attributeLength=attribute.getDataLength() + Attribute.HEADER_LENGTH;
attributeLength+=(4 - attributeLength % 4) % 4;
dataLengthForContentDependentAttribute+=attributeLength;
byte[] binAtt;
if (attribute instanceof ContentDependentAttribute) {
binMsg[messageLengthOffset]=(byte)(dataLengthForContentDependentAttribute >> 8);
binMsg[messageLengthOffset + 1]=(byte)(dataLengthForContentDependentAttribute & 0xFF);
binAtt=((ContentDependentAttribute)attribute).encode(stunStack,binMsg,0,offset);
}
else {
binAtt=attribute.encode();
}
System.arraycopy(binAtt,0,binMsg,offset,binAtt.length);
offset+=attributeLength;
}
binMsg[messageLengthOffset]=(byte)(dataLength >> 8);
binMsg[messageLengthOffset + 1]=(byte)(dataLength & 0xFF);
return binMsg;
}
| Returns a binary representation of this message. |
public static byte[] decodeWebSafe(byte[] source) throws Base64DecoderException {
return decodeWebSafe(source,0,source.length);
}
| Decodes web safe Base64 content in byte array format and returns the decoded data. Web safe encoding uses '-' instead of '+', '_' instead of '/' |
protected Total applyTaxToCartItemsAndCalculateItemTotal(final MutableShoppingCart cart){
final ShoppingContext ctx=cart.getShoppingContext();
final String currency=cart.getCurrencyCode();
final CartItemPrices prices=new CartItemPrices();
final List<CartItem> items=cart.getCartItemList();
if (items != null) {
for ( final CartItem item : cart.getCartItemList()) {
if (!item.isGift() && !MoneyUtils.isFirstBiggerThanOrEqualToSecond(BigDecimal.ZERO,item.getQty()) && item.getPrice() != null) {
final TaxProvider.Tax tax=taxProvider.determineTax(ctx.getShopCode(),currency,ctx.getCountryCode(),ctx.getStateCode(),item.getProductSkuCode());
final BigDecimal price=item.getPrice();
final MoneyUtils.Money money=calculateMoney(price,tax.getRate(),!tax.isExcluded());
final BigDecimal netPrice=money.getNet();
final BigDecimal grossPrice=money.getGross();
cart.setProductSkuTax(item.getProductSkuCode(),netPrice,grossPrice,tax.getRate(),tax.getCode(),tax.isExcluded());
}
prices.add(new CartItemPrices(item));
}
}
return new TotalImpl(prices.listPrice,prices.salePrice,prices.nonSalePrice,prices.finalPrice,false,null,prices.finalPrice,prices.finalTax,prices.grossFinalPrice,Total.ZERO,Total.ZERO,false,null,Total.ZERO,Total.ZERO,prices.finalPrice,prices.finalTax,prices.grossListPrice,prices.grossFinalPrice);
}
| Calculate sub total of cart items. |
private static void shutdown(){
log.trace("shutdown()");
actorSystem.shutdown();
}
| Shutdown configuration proxy components. |
private void writeEncoded(String str){
for (int i=0; i < str.length(); i++) {
char c=str.charAt(i);
switch (c) {
case 0x0A:
this.writer.print(c);
break;
case '<':
this.writer.print("<");
break;
case '>':
this.writer.print(">");
break;
case '&':
this.writer.print("&");
break;
case '\'':
this.writer.print("'");
break;
case '"':
this.writer.print(""");
break;
default :
if ((c < ' ') || (c > 0x7E)) {
this.writer.print("&#x");
this.writer.print(Integer.toString(c,16));
this.writer.print(';');
}
else {
this.writer.print(c);
}
}
}
}
| Writes a string encoding reserved characters. |
public AnimatableNumberOptionalNumberValue(AnimationTarget target,float n){
super(target);
number=n;
}
| Creates a new AnimatableNumberOptionalNumberValue with one number. |
public void addTaskEventListener(HeadlessJsTaskEventListener listener){
mHeadlessJsTaskEventListeners.add(listener);
}
| Register a task lifecycle event listener. |
public void buildLayout(){
final HorizontalLayout horizontalLayout=new HorizontalLayout();
upload=new Upload();
upload.setEnabled(false);
upload.setButtonCaption("Bulk Upload");
upload.setReceiver(this);
upload.setImmediate(true);
upload.setWidthUndefined();
upload.addSucceededListener(this);
upload.addFailedListener(this);
upload.addStartedListener(this);
horizontalLayout.addComponent(upload);
horizontalLayout.setComponentAlignment(upload,Alignment.BOTTOM_RIGHT);
setCompositionRoot(horizontalLayout);
}
| Intialize layout. |
protected static com.bbn.openmap.corba.CSpecialist.MouseEvent constructGesture(MapGesture gest){
com.bbn.openmap.corba.CSpecialist.Mouse mouse=new com.bbn.openmap.corba.CSpecialist.Mouse();
mouse.point=new com.bbn.openmap.corba.CSpecialist.XYPoint((short)gest.point.x,(short)gest.point.y);
mouse.llpoint=new com.bbn.openmap.corba.CSpecialist.LLPoint(gest.llpoint.getLatitude(),gest.llpoint.getLongitude());
mouse.press=gest.press;
mouse.mousebutton=gest.mousebutton;
mouse.modifiers=new com.bbn.openmap.corba.CSpecialist.key_modifiers(gest.alt,gest.shift,gest.control);
com.bbn.openmap.corba.CSpecialist.MouseEvent event=new com.bbn.openmap.corba.CSpecialist.MouseEvent();
switch (gest.event_type) {
case com.bbn.openmap.corba.CSpecialist.MouseType._ClickEvent:
event.click(mouse);
break;
case com.bbn.openmap.corba.CSpecialist.MouseType._MotionEvent:
event.motion(mouse);
break;
case com.bbn.openmap.corba.CSpecialist.MouseType._KeyEvent:
event.keypress(new com.bbn.openmap.corba.CSpecialist.Keypress(mouse.point,gest.key,mouse.modifiers));
break;
default :
System.err.println("JGraphic.constructGesture() - invalid type");
}
return event;
}
| constructGesture() - constructs a CSpecialist.MouseEvent from a MapGesture |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-03-25 14:38:21.775 -0400",hash_original_method="5FCAC44BDC2A7F1CC8FB3837FD1118B9",hash_generated_method="211D4B144F9A7E0B9FE154FE655316F1") public void stop(){
SR_RecognizerStop(mRecognizer);
SR_RecognizerDeactivateRule(mRecognizer,mActiveGrammar.mGrammar,"trash");
}
| Stop the <code>Recognizer</code>. |
public static InputStream toInputStream(String input,Charset encoding){
return new ByteArrayInputStream(input.getBytes(Charsets.toCharset(encoding)));
}
| Convert the specified string to an input stream, encoded as bytes using the specified character encoding. |
private Object conditionalCopy(Object o){
return o;
}
| Makes a copy, if copy-on-get is enabled, of the specified object. |
void sendByte5Baud(int address) throws IOException {
long start=System.currentTimeMillis();
sendBit5Baud(false);
for (int i=0; i < 8; i++) {
sendBit5Baud((address & (1 << i)) != 0);
}
sendBit5Baud(true);
log.debug(String.format("TX-5Baud:%02X finished after %dms",address,System.currentTimeMillis() - start));
}
| send a byte with 5 baud line speed this version sends out timed line break bits w/o changing the nominal baud rate |
public static NameMatcher<TriggerKey> triggerNameEquals(String compareTo){
return NameMatcher.nameEquals(compareTo);
}
| Create a NameMatcher that matches trigger names equaling the given string. |
public static void main(String... args) throws Exception {
new XMLChecker().run(args);
}
| This method is called when executing this application from the command line. |
public static int findKeyCode(KeyID keyID){
return (idCode[keyID.ordinal()]);
}
| Find the key code given its enumeration. |
public double deltaLongitude(){
return this.maxLongitude - this.minLongitude;
}
| Returns the angle between this sector's minimum and maximum longitudes. |
public void shutdown(){
log.info("Interrupting server thread");
this.interrupt();
try {
this.join();
}
catch ( InterruptedException e) {
return;
}
}
| Shutdown the server and wait for the server main thread to complete |
public static Image reflectionImage(Image source,float mirrorRatio,int alphaRatio){
return reflectionImage(source,mirrorRatio,alphaRatio,0);
}
| Takes the given image and appends an effect of reflection below it that is similar to the way elements appear in water beneath them. This method shouldn't be used when numAlpha is very low. |
public boolean isKeyRotating(ECKey key){
long time=vKeyRotationTimestamp;
return time != 0 && key.getCreationTimeSeconds() < time;
}
| Returns whether the keys creation time is before the key rotation time, if one was set. |
public MailOperationException(String message,Throwable cause){
super(message,cause);
}
| Constructs a new exception with the specified detail message and cause. |
public byte[] createImage(Projection proj,int scaledWidth,int scaledHeight,int includedLayerMask,Paint background){
logger.fine("using the new ProjectionPainter interface! createImage with layer mask.");
if (formatter == null) {
logger.warning("no formatter set! Can't create image.");
return new byte[0];
}
ImageFormatter imageFormatter=formatter.makeClone();
Graphics graphics=createGraphics(imageFormatter,proj.getWidth(),proj.getHeight());
if (graphics == null) {
return new byte[0];
}
((Proj)proj).drawBackground((Graphics2D)graphics,background);
if (logger.isLoggable(Level.FINE)) {
logger.fine("considering " + layers.length + " for image...");
}
if (layers != null) {
for (int i=layers.length - 1; i >= 0; i--) {
if ((includedLayerMask & (0x00000001 << i)) != 0) {
if (logger.isLoggable(Level.FINE)) {
logger.fine("image request adding layer graphics from : " + layers[i].getName());
}
layers[i].renderDataForProjection(proj,graphics);
}
else {
if (logger.isLoggable(Level.FINE)) {
logger.fine("skipping layer graphics from : " + layers[i].getName());
}
}
}
}
else {
if (logger.isLoggable(Level.FINE)) {
logger.fine("no layers available");
}
}
byte[] formattedImage=getFormattedImage(imageFormatter,scaledWidth,scaledHeight);
graphics.dispose();
return formattedImage;
}
| Use the ProjectionPainter interface of the layers to create an image. This approach avoids some of the timing issues that the thread model of the MapBean and Layers that seem to pop up from time to time. They are Swing components, you know. They were designed to be part of a GUI. So, this is a serialized, safe way to do things. |
public ConfigPackage(File file) throws IOException, ZipException {
super(file);
Manifest manifest=getManifest();
if (manifest == null) {
throw new IOException("Not a valid config package. MANIFEST.MF is not present.");
}
Attributes attr=manifest.getMainAttributes();
configPackageName=attr.getValue(ATTRIBUTE_DT_CONF_PACKAGE_NAME);
appPackageName=attr.getValue(ATTRIBUTE_DT_APP_PACKAGE_NAME);
appPackageGroupId=attr.getValue(ATTRIBUTE_DT_APP_PACKAGE_GROUP_ID);
appPackageMinVersion=attr.getValue(ATTRIBUTE_DT_APP_PACKAGE_MIN_VERSION);
appPackageMaxVersion=attr.getValue(ATTRIBUTE_DT_APP_PACKAGE_MAX_VERSION);
configPackageDescription=attr.getValue(ATTRIBUTE_DT_CONF_PACKAGE_DESCRIPTION);
String classPathString=attr.getValue(ATTRIBUTE_CLASS_PATH);
String filesString=attr.getValue(ATTRIBUTE_FILES);
if (configPackageName == null) {
throw new IOException("Not a valid config package. DT-Conf-Package-Name is missing from MANIFEST.MF");
}
if (!StringUtils.isBlank(classPathString)) {
classPath.addAll(Arrays.asList(StringUtils.split(classPathString," ")));
}
if (!StringUtils.isBlank(filesString)) {
files.addAll(Arrays.asList(StringUtils.split(filesString," ")));
}
ZipFile zipFile=new ZipFile(file);
if (zipFile.isEncrypted()) {
throw new ZipException("Encrypted conf package not supported yet");
}
File newDirectory=Files.createTempDirectory("dt-configPackage-").toFile();
newDirectory.mkdirs();
directory=newDirectory.getAbsolutePath();
zipFile.extractAll(directory);
processPropertiesXml();
processAppDirectory(new File(directory,"app"));
}
| Creates an Config Package object. |
public static HashtagEntity createHashtagEntity(final int start,final int end,final String text){
return new HashtagEntityJSONImpl(start,end,text);
}
| static factory method for twitter-text-java |
public static boolean verify(PublicKey publicKey,String signedData,String signature){
Signature sig;
try {
sig=Signature.getInstance(SIGNATURE_ALGORITHM);
sig.initVerify(publicKey);
sig.update(signedData.getBytes());
if (!sig.verify(Base64.decode(signature))) {
Log.e(TAG,"Signature verification failed.");
return false;
}
return true;
}
catch ( NoSuchAlgorithmException e) {
Log.e(TAG,"NoSuchAlgorithmException.");
}
catch ( InvalidKeyException e) {
Log.e(TAG,"Invalid key specification.");
}
catch ( SignatureException e) {
Log.e(TAG,"Signature exception.");
}
catch ( Base64DecoderException e) {
Log.e(TAG,"Base64 decoding failed.");
}
return false;
}
| Verifies that the signature from the server matches the computed signature on the data. Returns true if the data is correctly signed. |
private int parseKeyProviderId(final byte[] b,final int off) throws ParseException {
final int bytesToParseLen=b.length - off;
if (bytesToParseLen >= keyProviderIdLen_) {
keyProviderId_=Arrays.copyOfRange(b,off,off + keyProviderIdLen_);
return keyProviderIdLen_;
}
else {
throw new ParseException("Not enough bytes to parse key provider id");
}
}
| Parse the key provider identifier in the provided bytes. It looks for bytes of size defined by the key provider identifier length in the provided bytes starting at the specified off. <p> If successful, it returns the size of the parsed bytes which is the key provider identifier length. On failure, it throws a parse exception. |
public static Handling suppress(){
return suppress;
}
| Suppresses errors entirely. |
public Card popCard(int i){
return cards.remove(i);
}
| Removes and returns the card with the given index. |
public static Pointer to(NativePointerObject... pointers){
if (pointers == null) {
throw new IllegalArgumentException("Pointer may not point to null objects");
}
return new Pointer(pointers);
}
| Creates a new Pointer to the given Pointers. The array of pointers may not be <code>null</code>, and may not contain <code>null</code> elements. |
public IElementType captureHereDoc(boolean afterEmptyCloser){
popState();
final PerlHeredocQueueElement heredocQueueElement=heredocQueue.remove(0);
final String heredocMarker=heredocQueueElement.getMarker();
final int oldState=heredocQueueElement.getState();
IElementType tokenType=HEREDOC;
if (oldState == LEX_HEREDOC_WAITING_QQ) {
tokenType=HEREDOC_QQ;
}
else if (oldState == LEX_HEREDOC_WAITING_QX) {
tokenType=HEREDOC_QX;
}
CharSequence buffer=getBuffer();
int tokenStart=getTokenEnd();
if (!afterEmptyCloser) {
pushPreparsedToken(tokenStart++,tokenStart,TokenType.NEW_LINE_INDENT);
}
int bufferEnd=getBufferEnd();
int currentPosition=tokenStart;
int linePos=currentPosition;
while (true) {
while (linePos < bufferEnd && buffer.charAt(linePos) != '\n' && buffer.charAt(linePos) != '\r') {
linePos++;
}
int lineContentsEnd=linePos;
if (linePos < bufferEnd && buffer.charAt(linePos) == '\r') {
linePos++;
}
if (linePos < bufferEnd && buffer.charAt(linePos) == '\n') {
linePos++;
}
if (heredocMarker.isEmpty() && lineContentsEnd == currentPosition && linePos > lineContentsEnd) {
if (currentPosition > tokenStart) {
pushPreparsedToken(tokenStart,currentPosition,tokenType);
}
pushPreparsedToken(currentPosition,lineContentsEnd + 1,HEREDOC_END);
if (!heredocQueue.isEmpty() && bufferEnd > lineContentsEnd + 1) {
setTokenEnd(lineContentsEnd + 1);
return captureHereDoc(true);
}
else {
return getPreParsedToken();
}
}
else if (StringUtil.equals(heredocMarker,buffer.subSequence(currentPosition,lineContentsEnd))) {
if (currentPosition > tokenStart) {
pushPreparsedToken(tokenStart,currentPosition,tokenType);
}
pushPreparsedToken(currentPosition,lineContentsEnd,HEREDOC_END);
return getPreParsedToken();
}
else if (linePos == bufferEnd) {
if (linePos > tokenStart) {
pushPreparsedToken(tokenStart,linePos,tokenType);
}
return getPreParsedToken();
}
currentPosition=linePos;
}
}
| Captures HereDoc document and returns appropriate token type |
public static List<Point> SpatialKnnQueryUsingIndex(PointRDD pointRDD,Point queryCenter,Integer k){
if (pointRDD.indexedRDDNoId == null) {
throw new NullPointerException("Need to invoke buildIndex() first, indexedRDDNoId is null");
}
JavaRDD<Point> tmp=pointRDD.indexedRDDNoId.mapPartitions(new PointKnnJudgementUsingIndex(queryCenter,k));
return tmp.takeOrdered(k,new PointDistanceComparator(queryCenter));
}
| Spatial K Nearest Neighbors query using index |
public void testEdgeCase(){
final int bits=3;
final int size=1 << bits;
final ByteIndex ix0=new ByteChunks(size - 1,bits);
ix0.integrity();
final ByteIndex ix1=new ByteChunks(size,bits);
ix1.integrity();
final ByteIndex ix2=new ByteChunks(size + 1,bits);
ix2.integrity();
}
| Tests allocations of chunks and fomula for computing how many chunks there are. |
public VCardTempXUpdatePresenceExtension(byte[] imageBytes){
this.computeXML();
this.updateImage(imageBytes);
}
| Creates a new instance of this presence extension with the avatar image given in parameter. |
public List<JCCompilationUnit> enterTreesIfNeeded(List<JCCompilationUnit> roots){
if (shouldStop(CompileState.ATTR)) return List.nil();
return enterTrees(roots);
}
| Enter the symbols found in a list of parse trees if the compilation is expected to proceed beyond anno processing into attr. As a side-effect, this puts elements on the "todo" list. Also stores a list of all top level classes in rootClasses. |
public KeyBuilder action(){
modifiers|=ModifierKeys.ACTION;
return this;
}
| Add ACTION modifier. Action is abstraction for the primary modifier used for chording shortcuts in IDE. To stay consistent with native OS shortcuts, this will be set if CTRL is pressed on Linux or Windows, or if CMD is pressed on Mac. |
public static UniqueString uniqueStringOf(String str){
return internTbl.put(str);
}
| Returns a unique object associated with string str. That is, the first time uniqueStringOf("foo") is called, it returns a new object o. Subsequent invocations of uniqueStringOf("foo") return the same object o. This is a convenience method for a table put. |
public void addSystemConsistencyGroup(String systemUri,String cgName){
if (systemConsistencyGroups == null) {
setSystemConsistencyGroups(new StringSetMap());
}
if (!systemConsistencyGroups.containsKey(systemUri)) {
systemConsistencyGroups.put(systemUri,new StringSet());
}
StringSet systemCgNames=systemConsistencyGroups.get(systemUri);
systemCgNames.add(cgName);
}
| Add a mapping of storage systems to consistency group names. |
public Word loadWord(){
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED);
return null;
}
| Loads a word value from the memory location pointed to by the current instance. |
private void startThundering(){
int delay=Rand.randExponential(THUNDER_DELAY) + 1;
SingletonRepository.getTurnNotifier().notifyInSeconds(delay,thunderer);
}
| Schedule the next lightning. |
private void writeTypicalAndMinimumActivityDurations(final String configFile){
Config config=new Config();
config.addCoreModules();
ConfigReader reader=new ConfigReader(config);
reader.readFile(configFile);
SortedMap<String,Double> act2TypDur=new TreeMap<>();
SortedMap<String,Double> act2MinDur=new TreeMap<>();
for ( String actTyp : config.planCalcScore().getActivityTypes()) {
act2TypDur.put(actTyp,config.planCalcScore().getActivityParams(actTyp).getTypicalDuration());
act2MinDur.put(actTyp,config.planCalcScore().getActivityParams(actTyp).getMinimalDuration());
}
String fileName=outputDir + "/analysis/actTyp2TypicalAndMinimumActDurations.txt";
BufferedWriter writer=IOUtils.getBufferedWriter(fileName);
try {
writer.write("actType \t typicalActDuration \t minimumActDuration \n");
for ( String actTyp : act2MinDur.keySet()) {
writer.write(actTyp + "\t" + act2TypDur.get(actTyp)+ "\t"+ act2MinDur.get(actTyp)+ "\n");
}
writer.close();
}
catch ( Exception e) {
throw new RuntimeException("Data is not written. Reason - " + e);
}
ActivityType2DurationHandler.LOG.info("Data is written to file " + fileName);
}
| writes activity type to typical activity duration to file. |
void doReps(ObjectOutputStream oout,ObjectInputStream oin,StreamBuffer sbuf,Node[] trees,int nbatches) throws Exception {
int ncycles=trees.length;
for (int i=0; i < nbatches; i++) {
sbuf.reset();
oout.reset();
for (int j=0; j < ncycles; j++) {
oout.writeObject(trees[j]);
}
oout.flush();
for (int j=0; j < ncycles; j++) {
oin.readObject();
}
}
}
| Run benchmark for given number of batches, with each batch containing the given number of cycles. |
static Point translateCoordinates(long src,long dst,Point p){
Point translated=null;
XToolkit.awtLock();
try {
XTranslateCoordinates xtc=new XTranslateCoordinates(src,dst,p.x,p.y);
try {
int status=xtc.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
if ((status != 0) && ((XErrorHandlerUtil.saved_error == null) || (XErrorHandlerUtil.saved_error.get_error_code() == XConstants.Success))) {
translated=new Point(xtc.get_dest_x(),xtc.get_dest_y());
}
}
finally {
xtc.dispose();
}
}
finally {
XToolkit.awtUnlock();
}
return translated;
}
| Translates the given point from one window to another. Returns null if the translation is failed |
public void addSeriesRenderer(SimpleSeriesRenderer renderer){
mRenderers.add(renderer);
}
| Adds a simple renderer to the multiple renderer. |
public void updateFromChild(){
double[] fis=update(m_childNode);
if (fis == null) {
m_fiChild=null;
}
else {
m_fiChild=fis;
double sum=0;
for (int iPos=0; iPos < m_nCardinality; iPos++) {
sum+=m_fiChild[iPos];
}
for (int iPos=0; iPos < m_nCardinality; iPos++) {
m_fiChild[iPos]/=sum;
}
}
}
| marginalize junciontTreeNode node over all nodes outside the separator set of the child clique |
public static CacheHeader readHeader(InputStream is) throws IOException {
CacheHeader entry=new CacheHeader();
int magic=IOUtils.readInt(is);
if (magic != CACHE_MAGIC) {
throw new IOException();
}
entry.key=IOUtils.readString(is);
entry.etag=IOUtils.readString(is);
if (entry.etag.equals("")) {
entry.etag=null;
}
entry.serverDate=IOUtils.readLong(is);
entry.lastModified=IOUtils.readLong(is);
entry.ttl=IOUtils.readLong(is);
entry.softTtl=IOUtils.readLong(is);
entry.responseHeaders=IOUtils.readStringStringMap(is);
return entry;
}
| Reads the header off of an InputStream and returns a CacheHeader object. |
protected void containsBox(int column,int row,int width,int height){
if (column < 0 || column + width > columns || row < 0 || row + height > rows) throw new IndexOutOfBoundsException("column:" + column + ", row:"+ row+ " ,width:"+ width+ ", height:"+ height);
}
| Checks whether the receiver contains the given box. |
@Override protected EClass eStaticClass(){
return UmplePackage.eINSTANCE.getTraceCaseDef_();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static int UTF16toUTF8(CharSequence s,int offset,int len,byte[] result,int resultOffset){
final int end=offset + len;
int upto=resultOffset;
for (int i=offset; i < end; i++) {
final int code=(int)s.charAt(i);
if (code < 0x80) result[upto++]=(byte)code;
else if (code < 0x800) {
result[upto++]=(byte)(0xC0 | (code >> 6));
result[upto++]=(byte)(0x80 | (code & 0x3F));
}
else if (code < 0xD800 || code > 0xDFFF) {
result[upto++]=(byte)(0xE0 | (code >> 12));
result[upto++]=(byte)(0x80 | ((code >> 6) & 0x3F));
result[upto++]=(byte)(0x80 | (code & 0x3F));
}
else {
if (code < 0xDC00 && (i < end - 1)) {
int utf32=(int)s.charAt(i + 1);
if (utf32 >= 0xDC00 && utf32 <= 0xDFFF) {
utf32=((code - 0xD7C0) << 10) + (utf32 & 0x3FF);
i++;
result[upto++]=(byte)(0xF0 | (utf32 >> 18));
result[upto++]=(byte)(0x80 | ((utf32 >> 12) & 0x3F));
result[upto++]=(byte)(0x80 | ((utf32 >> 6) & 0x3F));
result[upto++]=(byte)(0x80 | (utf32 & 0x3F));
continue;
}
}
result[upto++]=(byte)0xEF;
result[upto++]=(byte)0xBF;
result[upto++]=(byte)0xBD;
}
}
return upto - resultOffset;
}
| Writes UTF8 into the byte array, starting at offset. The caller should ensure that there is enough space for the worst-case scenario. |
public ByteVector putByte(final int b){
int length=this.length;
if (length + 1 > data.length) {
enlarge(1);
}
data[length++]=(byte)b;
this.length=length;
return this;
}
| Puts a byte into this byte vector. The byte vector is automatically enlarged if necessary. |
@Override public void logError(final String message,final Throwable throwable){
switch (mLevel) {
default :
case Debug:
case Error:
Log.e(getTag(),message,throwable);
}
}
| Logs an error message with throwable. |
@Override public boolean isEmpty(){
return size == 0;
}
| Returns whether this IdentityHashMap has no elements. |
public boolean supportsBatchUpdates() throws SQLException {
return true;
}
| Indicates whether the driver supports batch updates. |
public double eval(double params[]){
return (Math.asin(1.0 / params[0]));
}
| Evaluate the arcosecant of a single parameter. |
private void updateFixedCircleRadius(){
if (mTouchedDotView == null) {
return;
}
final float deltaLength=Math.max(mTouchedDotView.getMaxStretchLength() - getLengthBetweenCenter(),0);
final float fraction=deltaLength / mTouchedDotView.getMaxStretchLength();
mFollowCircle.radius=fraction * mTouchCircle.radius;
}
| the fixed circle's radius is depend on the distance from fixedCircle's center to DragCircle's center. you need invoke this method to update the fixedCircle's radius when the distance is changed. |
protected void processElement(String defaultNamespace,Properties namespaces) throws Exception {
String fullName=XMLUtil.scanIdentifier(this.reader);
String name=fullName;
XMLUtil.skipWhitespace(this.reader,null);
String prefix=null;
int colonIndex=name.indexOf(':');
if (colonIndex > 0) {
prefix=name.substring(0,colonIndex);
name=name.substring(colonIndex + 1);
}
Vector attrNames=new Vector();
Vector attrValues=new Vector();
Vector attrTypes=new Vector();
this.validator.elementStarted(fullName,this.reader.getSystemID(),this.reader.getLineNr());
char ch;
for (; ; ) {
ch=this.reader.read();
if ((ch == '/') || (ch == '>')) {
break;
}
this.reader.unread(ch);
this.processAttribute(attrNames,attrValues,attrTypes);
XMLUtil.skipWhitespace(this.reader,null);
}
Properties extraAttributes=new Properties();
this.validator.elementAttributesProcessed(fullName,extraAttributes,this.reader.getSystemID(),this.reader.getLineNr());
Enumeration enm=extraAttributes.keys();
while (enm.hasMoreElements()) {
String key=(String)enm.nextElement();
String value=extraAttributes.getProperty(key);
attrNames.addElement(key);
attrValues.addElement(value);
attrTypes.addElement("CDATA");
}
for (int i=0; i < attrNames.size(); i++) {
String key=(String)attrNames.elementAt(i);
String value=(String)attrValues.elementAt(i);
String type=(String)attrTypes.elementAt(i);
if (key.equals("xmlns")) {
defaultNamespace=value;
}
else if (key.startsWith("xmlns:")) {
namespaces.put(key.substring(6),value);
}
}
if (prefix == null) {
this.builder.startElement(name,prefix,defaultNamespace,this.reader.getSystemID(),this.reader.getLineNr());
}
else {
this.builder.startElement(name,prefix,namespaces.getProperty(prefix),this.reader.getSystemID(),this.reader.getLineNr());
}
for (int i=0; i < attrNames.size(); i++) {
String key=(String)attrNames.elementAt(i);
if (key.startsWith("xmlns")) {
continue;
}
String value=(String)attrValues.elementAt(i);
String type=(String)attrTypes.elementAt(i);
colonIndex=key.indexOf(':');
if (colonIndex > 0) {
String attPrefix=key.substring(0,colonIndex);
key=key.substring(colonIndex + 1);
this.builder.addAttribute(key,attPrefix,namespaces.getProperty(attPrefix),value,type);
}
else {
this.builder.addAttribute(key,null,null,value,type);
}
}
if (prefix == null) {
this.builder.elementAttributesProcessed(name,prefix,defaultNamespace);
}
else {
this.builder.elementAttributesProcessed(name,prefix,namespaces.getProperty(prefix));
}
if (ch == '/') {
if (this.reader.read() != '>') {
XMLUtil.errorExpectedInput(reader.getSystemID(),reader.getLineNr(),"`>'");
}
this.validator.elementEnded(name,this.reader.getSystemID(),this.reader.getLineNr());
if (prefix == null) {
this.builder.endElement(name,prefix,defaultNamespace);
}
else {
this.builder.endElement(name,prefix,namespaces.getProperty(prefix));
}
return;
}
StringBuffer buffer=new StringBuffer(16);
for (; ; ) {
buffer.setLength(0);
String str;
for (; ; ) {
XMLUtil.skipWhitespace(this.reader,buffer);
str=XMLUtil.read(this.reader,'&');
if ((str.charAt(0) == '&') && (str.charAt(1) != '#')) {
XMLUtil.processEntity(str,this.reader,this.entityResolver);
}
else {
break;
}
}
if (str.charAt(0) == '<') {
str=XMLUtil.read(this.reader,'\0');
if (str.charAt(0) == '/') {
XMLUtil.skipWhitespace(this.reader,null);
str=XMLUtil.scanIdentifier(this.reader);
if (!str.equals(fullName)) {
XMLUtil.errorWrongClosingTag(reader.getSystemID(),reader.getLineNr(),name,str);
}
XMLUtil.skipWhitespace(this.reader,null);
if (this.reader.read() != '>') {
XMLUtil.errorClosingTagNotEmpty(reader.getSystemID(),reader.getLineNr());
}
this.validator.elementEnded(fullName,this.reader.getSystemID(),this.reader.getLineNr());
if (prefix == null) {
this.builder.endElement(name,prefix,defaultNamespace);
}
else {
this.builder.endElement(name,prefix,namespaces.getProperty(prefix));
}
break;
}
else {
this.reader.unread(str.charAt(0));
this.scanSomeTag(true,defaultNamespace,(Properties)namespaces.clone());
}
}
else {
if (str.charAt(0) == '&') {
ch=XMLUtil.processCharLiteral(str);
buffer.append(ch);
}
else {
reader.unread(str.charAt(0));
}
this.validator.PCDataAdded(this.reader.getSystemID(),this.reader.getLineNr());
Reader r=new ContentReader(this.reader,this.entityResolver,buffer.toString());
this.builder.addPCData(r,this.reader.getSystemID(),this.reader.getLineNr());
r.close();
}
}
}
| Processes a regular element. |
@Override protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
GoogleBaseService service=RecipeUtil.getGoogleBaseService(request,this.getServletContext());
String id=request.getParameter(RecipeUtil.ID_PARAMETER);
recipeDisplay(request,response,service,id);
}
| Shows the page for displaying a Recipe. |
public void executeASync(ProcessInfo pi){
}
| Method to be executed async. Called from the Worker |
static void __gl_meshZapFace(GLUface fZap){
GLUhalfEdge eStart=fZap.anEdge;
GLUhalfEdge e, eNext, eSym;
GLUface fPrev, fNext;
eNext=eStart.Lnext;
do {
e=eNext;
eNext=e.Lnext;
e.Lface=null;
if (e.Sym.Lface == null) {
if (e.Onext == e) {
KillVertex(e.Org,null);
}
else {
e.Org.anEdge=e.Onext;
Splice(e,e.Sym.Lnext);
}
eSym=e.Sym;
if (eSym.Onext == eSym) {
KillVertex(eSym.Org,null);
}
else {
eSym.Org.anEdge=eSym.Onext;
Splice(eSym,eSym.Sym.Lnext);
}
KillEdge(e);
}
}
while (e != eStart);
fPrev=fZap.prev;
fNext=fZap.next;
fNext.prev=fPrev;
fPrev.next=fNext;
}
| Other Operations |
public void runTest() throws Throwable {
Document doc;
NodeList elementList;
Node employeeNode;
Node clonedNode;
Node parentNode;
doc=(Document)load("hc_staff",true);
elementList=doc.getElementsByTagName("p");
employeeNode=elementList.item(1);
clonedNode=employeeNode.cloneNode(false);
parentNode=clonedNode.getParentNode();
assertNull("nodeCloneGetParentNullAssert1",parentNode);
}
| Runs the test case. |
public static ExtendedBlockState extendBlockstateContainer(ExtendedBlockState original,IProperty[] newProperties,IUnlistedProperty[] newUnlistedProperties){
Collection<IProperty> properties=new ArrayList<IProperty>();
properties.addAll(original.getProperties());
properties.addAll(Arrays.asList(newProperties));
Collection<IUnlistedProperty> unlistedProperties=new ArrayList<IUnlistedProperty>();
unlistedProperties.addAll(original.getUnlistedProperties());
unlistedProperties.addAll(Arrays.asList(newUnlistedProperties));
return new ExtendedBlockState(original.getBlock(),properties.toArray(new IProperty[0]),unlistedProperties.toArray(new IUnlistedProperty[0]));
}
| Combines the new properties with the properties of the original block state |
public static Typeface androidNation(Context context){
sAndroidNation=getFontFromRes(R.raw.androidnation,context);
return sAndroidNation;
}
| Android Nation font face |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.