code
stringlengths
10
174k
nl
stringlengths
3
129k
public static MethodAnnotation fromMethodDescriptor(MethodDescriptor methodDescriptor){ return fromForeignMethod(methodDescriptor.getSlashedClassName(),methodDescriptor.getName(),methodDescriptor.getSignature(),methodDescriptor.isStatic()); }
Create a MethodAnnotation from a MethodDescriptor.
public long optLong(int index){ return this.optLong(index,0); }
Get the optional long value associated with an index. Zero is returned if there is no value for the index, or if the value is not a number and cannot be converted to a number.
public static Tiling singleTile(String name){ Tiling ret=new Tiling(1,1); ret.setAt(0,0,name); return ret; }
Convenience factory method for tests
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:29:10.765 -0500",hash_original_method="1E17DF4D2E642F9316AB5D83170D1374",hash_generated_method="781E6B54E01322E06173924A59BC3BEB") static public MotionEvent obtain(long downTime,long eventTime,int action,float ...
Create a new MotionEvent, filling in all of the basic values that define the motion.
public int hash(char[] buffer,int offset,int length){ int code=0; for (int i=0; i < length; i++) { code=code * 37 + buffer[offset + i]; } return code & 0x7FFFFFF; }
Returns a hashcode value for the specified symbol information. The value returned by this method must be identical to the value returned by the <code>hash(String)</code> method when called with the string object created from the symbol information.
public boolean isShowGridX(){ return mShowGridX; }
Returns if the X axis grid should be visible.
public WebSocket flush(){ synchronized (mStateManager) { WebSocketState state=mStateManager.getState(); if (state != OPEN && state != CLOSING) { return this; } } WritingThread wt=mWritingThread; if (wt != null) { wt.queueFlush(); } return this; }
Flush frames to the server. Flush is performed asynchronously.
@Override public void inc(ScoreMap<E> map){ if (map == null) return; for ( E entry : map) { int count=map.get(entry); if (count > 0) this.inc(entry,count); } }
apply all E/int mappings from an external ScoreMap to this ScoreMap
public ByteVector putLong(final long l){ int length=this.length; if (length + 8 > data.length) { enlarge(8); } byte[] data=this.data; int i=(int)(l >>> 32); data[length++]=(byte)(i >>> 24); data[length++]=(byte)(i >>> 16); data[length++]=(byte)(i >>> 8); data[length++]=(byte)i; i=(int)l; data[...
Puts a long into this byte vector. The byte vector is automatically enlarged if necessary.
private UIComponent newInstance(TreeNode n) throws FacesException { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST,"FaceletFullStateManagementStrategy.newInstance",n.componentType); } try { Class<?> t=((classMap != null) ? classMap.get(n.componentType) : null); if (t == null) { t...
Create a new component instance.
private void updateProgress(int progress){ if (myHost != null && progress != previousProgress) { myHost.updateProgress(progress); } previousProgress=progress; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
public final void testValidateSucceeds(){ IPv4AddressValidator iPv4AddressValidator=new IPv4AddressValidator("foo"); assertTrue(iPv4AddressValidator.validate("")); assertTrue(iPv4AddressValidator.validate("1.1.1.1")); assertTrue(iPv4AddressValidator.validate("255.255.255.255")); assertTrue(iPv4AddressValidato...
Tests the functionality of the validate-method, if it succeeds.
public boolean isEmpty(){ return warnings.isEmpty(); }
Determines whether there are any validation warnings.
public static String escape(String s){ return JSONValue.escape(s); }
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F). It's the same as JSONValue.escape() only for compatibility here.
public Sound(File file,SoundType type) throws IOException { super(file,type); }
Creates a sound property.
private XPathFactory loadFromServicesFile(String uri,String resourceName,InputStream in){ if (debug) debugPrintln("Reading " + resourceName); BufferedReader rd; try { rd=new BufferedReader(new InputStreamReader(in,"UTF-8"),DEFAULT_LINE_LENGTH); } catch ( java.io.UnsupportedEncodingException e) { rd=...
Searches for a XPathFactory for a given uri in a META-INF/services file.
private boolean hasAccess(StorageOSUser storageOSUser,StringSetMap acls){ if (acls == null || acls.isEmpty()) { log.debug("acls is empty, pass"); return true; } List<ACLEntry> aclEntries=_permissionsHelper.convertToACLEntries(acls); String username=storageOSUser.getName(); for ( ACLEntry entry : aclE...
check if specified acls permission user to access
public boolean isReplaceHtmlLinefeeds(){ return replaceHtmlLinefeeds; }
Returns replaceHtmlLinefeeds
@LargeTest public void testThumbnailWithCorruptedVideoPart() throws Exception { final String videoItemFilename=INPUT_FILE_PATH + "corrupted_H264_BP_640x480_12.5fps_256kbps_AACLC_16khz_24kbps_s_0_26.mp4"; final int renderingMode=MediaItem.RENDERING_MODE_BLACK_BORDER; boolean flagForException=false; try { fin...
To test ThumbnailList for file which has video part corrupted
public String prepareIt(){ log.info(toString()); m_processMsg=ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_PREPARE); if (m_processMsg != null) return DocAction.STATUS_Invalid; MDocType dt=MDocType.get(getCtx(),getC_DocType_ID()); if (!MPeriod.isOpen(getCtx(),getDateOrdered()...
Prepare Document
protected JBZipEntry(String name,JBZipFile file){ this.name=name; myFile=file; }
Creates a new zip entry with the specified name.
private void bol(){ column=0; collectingIndent=(maxIndent != 0); indent=0; }
Indicates that output is at the beginning of a line.
public void addImplicit(ObjectType type){ add(type,false); }
Add an implicit exception.
public Slf4jLogger(){ impl=LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); }
Creates new logger.
public static void directOutput(String filename,boolean append,boolean alsoToOutStream){ try { directOutput(new FileOutputStream(filename,append),alsoToOutStream); } catch ( IOException ioe) { notifyOut=true; out=System.out; error("Debug: can't set up <" + filename + "> for log file! \n"+ ioe); ...
Provide a file to log output. This can be in conjunction with the output stream, or instead of it.
protected boolean haveSharedCellsRaw(ObjectMatrix1D other){ if (other instanceof SelectedSparseObjectMatrix1D) { SelectedSparseObjectMatrix1D otherMatrix=(SelectedSparseObjectMatrix1D)other; return this.elements == otherMatrix.elements; } else if (other instanceof SparseObjectMatrix1D) { SparseObject...
Returns <tt>true</tt> if both matrices share at least one identical cell.
@Override public void flush() throws IOException { super.flush(); }
Flushes this stream to ensure all pending data is sent out to the target stream. This implementation then also flushes the target stream.
public Object jjtAccept(SyntaxTreeBuilderVisitor visitor,Object data) throws VisitorException { return visitor.visit(this,data); }
Accept the visitor.
public static String addVisibleNewLineChars(String string){ return string.replaceAll("\r",CARRIAGE_RETURN_SYMBOL + "\r").replaceAll("\n",LINE_FEED_SYMBOL + "\n"); }
Returns a string with visible new line characters, shown along the invisible ones.
private void readCode(final MethodVisitor mv,final Context context,int u){ byte[] b=this.b; char[] c=context.buffer; int maxStack=readUnsignedShort(u); int maxLocals=readUnsignedShort(u + 2); int codeLength=readInt(u + 4); u+=8; int codeStart=u; int codeEnd=u + codeLength; Label[] labels=context.label...
Reads the bytecode of a method and makes the given visitor visit it.
public void testTwoStatements() throws IOException { final InputStream stream=this.getStream(R.raw.two_statements); List<String> commands=SqlParser.parse(stream); assertEquals(2,commands.size()); assertEquals(sql1,commands.get(0)); assertEquals(sql2,commands.get(1)); }
Should be able to parse a script with two multi-line statments, even if the last statement is not terminated by a semicolon.
public void scrollTo(WebView view,int x,int y){ view.getEngine().executeScript("window.scrollTo(" + x + ", "+ y+ ")"); }
Scrolls to the specified position.
@Override public Request<Workspace> create(Workspace workspaceReference){ checkNotNull(workspaceReference); final Invocation request=getWebTarget().request().accept(APPLICATION_JSON).buildPost(json(workspaceReference)); return new SimpleRequest<Workspace>(request,DefaultWorkspace.class,getAuthenticationManager())...
Creates the given workspace.
private static URL fixEmbeddedParams(URL base,String target) throws MalformedURLException { if (target.indexOf(';') >= 0 || base.toString().indexOf(';') == -1) { return new URL(base,target); } String baseURL=base.toString(); int startParams=baseURL.indexOf(';'); String params=baseURL.substring(startParams...
Handles cases where the url param information is encoded into the base url as opposed to the target. <p> If the taget contains params (i.e. ';xxxx') information then the target params information is assumed to be correct and any base params information is ignored. If the base contains params information but the tareget...
private byte[] lookupClassData(String className) throws ClassNotFoundException { byte[] data=null; for ( String path : pathItems) { String fileName=className.replace('.','/') + ".class"; if (isJar(path)) data=loadJarData(path,fileName); else data=loadFileData(path,fileName); if (data != null) ...
Search for a class file, and return class data if found.
public void dropTable(Database database,Table table,StringBuilder ddl){ for (int idx=database.getTableCount() - 1; idx >= 0; idx--) { Table otherTable=database.getTable(idx); ForeignKey[] fks=otherTable.getForeignKeys(); for (int fkIdx=0; (fks != null) && (fkIdx < fks.length); fkIdx++) { if (fks[fkI...
Outputs the DDL required to drop the given table. This method also drops foreign keys to the table.
public Integer limit(){ return limit; }
Gets the limit.
public void undo(){ EditItem edit=mEditHistory.getPrevious(); if (edit == null) { return; } Editable text=mEditText.getEditableText(); int start=edit.mmStart; int end=start + (edit.mmAfter != null ? edit.mmAfter.length() : 0); mIsUndoOrRedo=true; text.replace(start,end,edit.mmBefore); mIsUndoOrRed...
Perform undo.
public void moveToPrevious(){ checkWidget(); final int index=this.selection - 1; if (index < 0) { return; } changeSelectionTo(index); }
Move selection to the previous control
public static ContigField parseContigLine(String line){ return new ContigField(line); }
Convert <code>contig</code> line into <code>ContigField</code> object
protected String parseGameEvents(String inboundMessage){ containedStyle12=false; if (inboundMessage.length() > MAX_GAME_MESSAGE) { return inboundMessage; } else { if (LOG.isDebugEnabled()) { LOG.debug("Raw message in " + connector.getContext().getShortName() + ": "+ inboundMessage); } boole...
Parses and removes all of the game events from inboundEvent. Adjusts the games in service. Returns a String with the game events removed.
private double[] averageStackValues(double[] stack1,double[] stack2){ double[] result=new double[2]; result[0]=(stack1[0] + stack2[0]) / 2.0; result[1]=(stack1[1] + stack2[1]) / 2.0; return result; }
Returns a pair of "stack" values calculated as the mean of the two specified stack value pairs.
@Override public void receive(Event[] events){ String policyName=context.getPolicyDefinition().getName(); CompositePolicyHandler handler=((PolicyGroupEvaluatorImpl)context.getPolicyEvaluator()).getPolicyHandler(policyName); if (LOG.isDebugEnabled()) { LOG.debug("Generated {} alerts from policy '{}' in {}, ind...
Possibly more than one event will be triggered for alerting.
public void memoryReallocate(long memPtr,int cap){ enter(); try { PlatformCallbackUtils.memoryReallocate(envPtr,memPtr,cap); } finally { leave(); } }
Re-allocate external memory chunk.
@SuppressWarnings("rawtypes") public static Task createDummy(){ return new Task(TaskTypes.DUMMY); }
Creates a dummy task without data.
protected int entityIndex(Entity entity){ return Arrays.binarySearch(entities,entity); }
Check whether the device contains the specified entity
private void updateProgress(String progressLabel,int progress){ if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) { myHost.updateProgress(progressLabel,progress); } previousProgress=progress; previousProgressLabel=progressLabel; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
public static String makeValidFileName(String fileName){ return fileName.replaceAll("[^a-zA-Z0-9_\\-\\.]","-"); }
Replace all invalid file characters with valid ones. example: himom(*).txt becomes himom---.txt Note some characters that will be replaced wouldn't really be invalid (' ' for example) but a conservative approach is taken.
public void writeTo(ChannelBuffer data){ super.writeTo(data); data.writeByte(tableIndex); data.writeByte(pad1); data.writeByte(pad2); data.writeByte(pad3); data.writeInt(netMask); }
Write the vendor data to the channel buffer
public static Object[] toArray(List<?> list){ Iterator<?> it=list.iterator(); Class clazz=null; while (it.hasNext()) { Object v=it.next(); if (v == null) continue; if (clazz == null) clazz=v.getClass(); else if (clazz != v.getClass()) return list.toArray(); } if (clazz == Object.c...
creates a native array out of the input list, if all values are from the same type, this type is used for the array, otherwise object
public int size(){ if (tail == null) { return 1; } return 1 + tail.size(); }
Retuns the size of this IntList
private <N extends Oplet<P,P>>ExecutableVertex<N,P,P> newInternalVertex(N op,int nInputs,int nOutputs){ ExecutableVertex<N,P,P> vertex=graph().insert(op,nInputs,nOutputs); for ( EtiaoConnector<P> connector : vertex.getConnectors()) { connector.state=state; } return vertex; }
Create a new vertex for internal use (with shared connector state)
public Bits(){ this(false); }
Construct an initially empty set.
public DateMidnight minus(long duration){ return withDurationAdded(duration,-1); }
Returns a copy of this date with the specified duration taken away. <p> If the amount is zero or null, then <code>this</code> is returned.
@Override public void run(){ while (!mDie) { synchronized (mJobSync) { if (hasJob()) { final Runnable job=mJob; try { job.run(); } catch ( final Throwable t) { Diagnostic.error(ErrorType.SLIM_ERROR); Diagnostic.userLog(t); } synchronized (mCo...
Runs jobs in the job queue
public static List<List<String>> chunkRelativePaths(List<String> files){ ArrayList<List<String>> rc=new ArrayList<List<String>>(); int start=0; int size=0; int i=0; for (; i < files.size(); i++) { String p=files.get(i); if (size + p.length() > FILE_PATH_LIMIT) { if (start == i) { rc.add(...
Chunk paths on the command line
public final void alignSwitch(){ if (VM.VerifyAssertions) { VM._assert(opcode == JBC_tableswitch || opcode == JBC_lookupswitch); } int align=bcIndex & 3; if (align != 0) bcIndex+=4 - align; }
Skips the padding of a switch instruction.<p> Used for tableswitch, lookupswitch
public static _Fields findByName(String name){ return byName.get(name); }
Find the _Fields constant that matches name, or null if its not found.
public static PGPPublicKey readPublicKey(InputStream instr) throws PGPException { PGPPublicKeyRingCollection pgpPub; try { instr=org.bouncycastle.openpgp.PGPUtil.getDecoderStream(instr); pgpPub=new PGPPublicKeyRingCollection(instr,new JcaKeyFingerprintCalculator()); } catch ( IOException|PGPException ex...
***************************************** A simple routine that opens a key ring file and loads the first available key suitable for encryption.
private void executeCreate(String[] args) throws IOException, MalformedURLException, ServiceException, DocumentListException { if (args.length == 3) { printDocumentEntry(documentList.createNew(args[2],args[1])); } else { printMessage(COMMAND_HELP_CREATE); } }
Executes the "create" command.
public Value createClob(Reader x,long length){ if (x == null) { return ValueNull.INSTANCE; } if (length <= 0) { length=-1; } Value v=session.getDataHandler().getLobStorage().createClob(x,length); session.addTemporaryLob(v); return v; }
Create a Clob value from this reader.
public void testStringUnion(){ List<BytesRef> strings=new ArrayList<>(); for (int i=RandomNumbers.randomIntBetween(random(),0,1000); --i >= 0; ) { strings.add(new BytesRef(TestUtil.randomUnicodeString(random()))); } Collections.sort(strings); Automaton union=Automata.makeStringUnion(strings); assertTrue...
Test string union.
public AutoDeskewTransform(){ this(true,defaultList); }
Creates a new AutoDeskew transform
public boolean isContent(){ return state.equals(CONTENT); }
Check if content is shown
public boolean isAccessibleChildSelected(int i){ if (i == 0) { Object[] rootPath=new Object[1]; rootPath[0]=treeModel.getRoot(); if (rootPath[0] == null) return false; TreePath childPath=new TreePath(rootPath); return JTree.this.isPathSelected(childPath); } else { return false; } }
Returns true if the current child of this object is selected.
private static void generateNewData(){ for (int i=0; i < categoryNames.length; i++) { newList[i]=new int[10]; } storeNewData(); if (newListCount[BMP][categoryNames.length - 1] != 1) { System.err.println("This should not happen. Unicode data which belongs to an undefined category exists"); System.exi...
Makes CategoryMap in newer format which is used by JDK 1.5.0.
public T caseCoordinate_(Coordinate_ object){ return null; }
Returns the result of interpreting the object as an instance of '<em>Coordinate </em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
private List<AnnotatedTypeMirror> arrayAllComponents(AnnotatedArrayType atype){ LinkedList<AnnotatedTypeMirror> arrays=new LinkedList<AnnotatedTypeMirror>(); AnnotatedTypeMirror type=atype; while (type.getKind() == TypeKind.ARRAY) { arrays.addFirst(type); type=((AnnotatedArrayType)type).getComponentType()...
List of all array component types. Example input: int[][] Example output: int, int[], int[][]
private void processMenuKeyEvent(MenuKeyEvent e){ switch (e.getID()) { case KeyEvent.KEY_PRESSED: fireMenuKeyPressed(e); break; case KeyEvent.KEY_RELEASED: fireMenuKeyReleased(e); break; case KeyEvent.KEY_TYPED: fireMenuKeyTyped(e); break; default : break; } }
Handles a keystroke in a menu.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:30:01.362 -0500",hash_original_method="757FC08885175457E85C9AB1294F9204",hash_generated_method="60EC476456FAA597E0E3D6EF5D2BCBF4") public DrmInputStream(DrmRights rights){ isClosed=false; offset=0; b=new byte[1]; }
Construct a DrmInputStream instance.
static String add_escapes(String str){ StringBuffer retval=new StringBuffer(); char ch; for (int i=0; i < str.length(); i++) { switch (str.charAt(i)) { case '\b': retval.append("\\b"); continue; case '\t': retval.append("\\t"); continue; case '\n': retval.append("\\n"); continue; case '\f': retval.app...
Used to convert raw characters to their escaped version when these raw version cannot be used as part of an ASCII string literal.
@SuppressWarnings("unchecked") public ManagedArray(final T[] array){ if (array == null) throw new IllegalArgumentException(); this.elementClass=(Class<? extends T>)array.getClass().getComponentType(); this.buf=array; }
Create a view wrapping the entire array. <p> Note: the caller's reference will be used until and unless the array is grown, at which point the caller's reference will be replaced by a larger array having the same data.
public void actionPerformed(ActionEvent e){ if (e.getSource() == bImport) cmd_import(); else if (e.getSource() == bExport) cmd_export(); else if (e.getActionCommand().equals(ConfirmPanel.A_OK)) { m_text=editorPane.getText(); dispose(); } else if (e.getActionCommand().equals(ConfirmPanel.A_CANCE...
Action Listener
private boolean split(Register r1,Register r2){ for (Enumeration<RegisterOperand> e=DefUse.defs(r1); e.hasMoreElements(); ) { RegisterOperand def=e.nextElement(); Instruction s=def.instruction; if (s.operator() == SPLIT) { Operand rhs=Unary.getVal(s); if (rhs.similar(def)) return true; ...
Is there an instruction r1 = split r2 or r2 = split r1??
public static void main(String[] args) throws Exception { Http http=new Http(); http.setConf(NutchConfiguration.create()); main(http,args); }
Main method.
public JSONException syntaxError(String message){ return new JSONException(message + this.toString()); }
Make a JSONException to signal a syntax error.
protected void sequence_AnnotatedExportableElement_AsyncNoTrailingLineBreak_FunctionBody_FunctionHeader_FunctionImpl_StrictFormalParameters_TypeVariables(ISerializationContext context,FunctionDeclaration semanticObject){ genericSequencer.createSequence(context,semanticObject); }
Contexts: AnnotatedExportableElement<Yield> returns FunctionDeclaration AnnotatedExportableElement returns FunctionDeclaration Constraint: ( annotationList=AnnotatedExportableElement_FunctionDeclaration_1_0_0 declaredModifiers+=N4Modifier* declaredAsync?='async'? generator?='*'? (typeVars+=TypeVariable typeVars+=Ty...
public static boolean isSupplemental(int c){ return (c >= 0x10000 && c <= 0x10FFFF); }
Returns true if the specified character is a supplemental character.
@Override public void run(){ amIActive=true; if (args.length < 2) { showFeedback("Plugin parameters have not been set properly."); return; } String inputHeader=args[0]; String outputHeader=args[1]; if ((inputHeader == null) || (outputHeader == null)) { showFeedback("One or more of the input para...
Used to execute this plugin tool.
private int find(int k){ if (offsets != null) { int lo=0; int hi=size - 1; while (lo <= hi) { int i=(lo + hi) / 2; int m=offsets[i]; if (k > m) lo=i + 1; else if (k < m) hi=i - 1; else return i; } return -(lo + 1); } else { return k; } }
perform a binary search to find the requested offset.
public boolean hasValue(){ return super.hasTextValue(); }
Returns whether it has the value.
public static Object distArchiveEvent(String sessionID,String eventId,ScrDistreg scrDistReg,String entidad) throws DistributionException, SessionException, ValidationException { Object result=null; if (log.isDebugEnabled()) { log.debug("distributionEx eventId [" + eventId + "]"); } Validator.validate_String...
Llamada al evento que se lanza cuando un registro distribuido pasa al estado archivado
private static boolean haveSetCompressedSize(){ checkSCS(); return setCompressedSizeMethod != null; }
Are we running JDK 1.2 or higher?
public RandomDecisionTree(int numFeatures){ setRandomFeatureCount(numFeatures); }
Creates a new Random Decision Tree
public void test_restart() throws Exception { final boolean doYouWantMeToBreak=true; final URI SYSTAP=new URIImpl("http://bigdata.com/elm#a479c37c-407e-4f4a-be30-5a643a54561f"); final URI ORGANIZATION=new URIImpl("http://bigdata.com/domain#Organization"); final URI ENTITY=new URIImpl("http://bigdata.com/system#...
Unit test used to track down a commit problem.
public BitOutputStream(OutputStream out){ this.out=out; }
Use an OutputStream to produce a BitWriter. The BitWriter will send its bits to the OutputStream as each byte is filled.
private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix,namespace); x...
Util method to write an attribute with the ns prefix
public static void addDependency(Dependency depend,ClassLoader loader){ for (; loader != null; loader=loader.getParent()) { if (loader instanceof EnvironmentClassLoader) { ((EnvironmentClassLoader)loader).addDependency(depend); return; } } }
Adds a dependency to the current environment.
public script addElement(String hashcode,String element){ addElementToRegistry(hashcode,element); return (this); }
Adds an Element to the element.
public void addHeaderView(View v){ addHeaderView(v,null,true); }
Add a fixed view to appear at the top of the list. If addHeaderView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want. <p/> NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that will a...
public static <T>ArrayList<T> arrayList(int initialCapacity){ return new ArrayList<T>(initialCapacity); }
Create a new ArrayList.
public static InputStream toInputStream(final CharSequence input,final String encoding) throws IOException { return IOUtils.toInputStream(input,Charsets.toCharset(encoding)); }
Convert the specified CharSequence to an input stream, encoded as bytes using the specified character encoding. <p> Character encoding names can be found at <a href="http://www.iana.org/assignments/character-sets">IANA</a>.
public String objectToString(final Object productSkuObject){ return String.valueOf(((ProductSku)productSkuObject).getSkuId()); }
Object to string conversion.
public NBTTagCompound loadFile(File saveDirectory,String filename){ return loadFile(new File(saveDirectory,filename + ".dat")); }
Reads NBT data from the world folder.
@Override public boolean equals(Object obj){ if (this == obj) { return true; } if (obj instanceof YearMonth) { YearMonth other=(YearMonth)obj; return year == other.year && month == other.month; } return false; }
Checks if this year-month is equal to another year-month. <p> The comparison is based on the time-line position of the year-months.
static long toLong(String v){ String buildPart="1"; long buildType=700; if (v.endsWith("-SNAPSHOT")) { buildPart=""; v=v.substring(0,v.indexOf("-SNAPSHOT")); buildType=0; } else if (v.contains("-alpha-")) { buildPart=v.substring(v.lastIndexOf('-') + 1); v=v.substring(0,v.indexOf("-alpha-"...
Converts a version string on the form x.y.z into an integer which can be compared to other versions converted into integers.
private String token(final String code) throws IOException { return new JdkRequest(new Href(this.gauth).path("o").path("oauth2").path("token").toString()).body().formParam("client_id",this.app).formParam("redirect_uri",this.redir).formParam("client_secret",this.key).formParam("grant_type","authorization_code").formPa...
Retrieve Google access token.
public void addStateValueAsDouble(String name,double doubleValue){ addStateValueAsDouble(null,name,doubleValue); }
Adds a new StateObject with the specified <code>name</code> and Double <code>value</code>. The new StateObject is placed beneath the document root. If a StateObject with this name already exists, a new one is still created.
@Override public void run(){ amIActive=true; String streamsHeader=null; String pointerHeader=null; String outputHeader=null; WhiteboxRaster output; int[] dX=new int[]{1,1,1,0,-1,-1,-1,0}; int[] dY=new int[]{-1,0,1,1,1,0,-1,-1}; final double LnOf2=0.693147180559945; int row, col, x, y; float progress...
Used to execute this plugin tool.
protected void paintTrack(SynthContext context,Graphics g,Rectangle trackBounds){ int orientation=slider.getOrientation(); SynthLookAndFeel.updateSubregion(context,g,trackBounds); context.getPainter().paintSliderTrackBackground(context,g,trackBounds.x,trackBounds.y,trackBounds.width,trackBounds.height,orientation...
Paints the slider track.