code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static GalleryCursorFragment newInstance(){
GalleryCursorFragment fragment=new GalleryCursorFragment();
Bundle args=new Bundle();
fragment.setArguments(args);
return fragment;
}
| Use this factory method to create a new instance of this fragment using the provided parameters. |
public void runInjectorPipeline(Pipeline injectorPipeline){
PipelineResult result=injectorPipeline.run();
if (result instanceof DataflowPipelineJob) {
jobsToCancel.add(((DataflowPipelineJob)result));
}
}
| Runs the provided pipeline to inject data into the PubSubIO input topic. |
public String toString(){
StringBuffer sb=new StringBuffer("MColumn[");
sb.append(get_ID()).append("-").append(getColumnName()).append("]");
return sb.toString();
}
| String Representation |
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 int murmurhash3_x86_32(byte[] data,int offset,int len,int seed){
final int c1=0xcc9e2d51;
final int c2=0x1b873593;
int h1=seed;
int roundedEnd=offset + (len & 0xfffffffc);
for (int i=offset; i < roundedEnd; i+=4) {
int k1=(data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) | ((data[i + 2] & 0xff)... | Returns the MurmurHash3_x86_32 hash. Original source/tests at https://github.com/yonik/java_util/ |
public void clearSounds(){
mSoundMap.clear();
}
| Clears all of the previously set sounds and events. |
public AffinityKey(K key,Object affKey){
A.notNull(key,"key");
this.key=key;
this.affKey=affKey;
}
| Initializes key together with its affinity key counter-part. |
public void updateSynapseNodePositions(){
for ( Object node : outlinedObjects.getChildrenReference()) {
if (node instanceof NeuronGroupNode) {
((NeuronGroupNode)node).updateSynapseNodePositions();
}
}
}
| Call update synapse node positions on all constituent neuron group nodes, which does the same on all constituent neuron nodes. Ensures synapse nodes are updated properly when this is moved. |
public final Node lastWeightedChild(){
final List<Node> children=getChildren();
Node weightedChild=null;
for ( final Node child : children) {
if (child.getWeight() > 0.0) {
weightedChild=child;
}
}
return weightedChild;
}
| Convenience method that returns the last child whose weight is > 0.0. |
public boolean closeIt(){
log.info(toString());
m_processMsg=ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
if (m_processMsg != null) return false;
setDocAction(DOCACTION_None);
m_processMsg=ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_C... | Close Document. Cancel not delivered Quantities |
public static <T>Iterable<T> takeWhile(final Predicate<Object> predicate,final Iterable<T> iterable){
return XUtils.takeWhile(predicate,iterable);
}
| Makes an iterable that contains elements from the input iterable as long as the predicate is true. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-06 08:48:10.264 -0400",hash_original_method="BFC6FDCDD15FDA47B15A63C97E605E05",hash_generated_method="E7FAAFC0A00F060C36DADC3B1DED7FE6") public MediaSize(String id,String label,int widthMils,int heightMils){
if (TextUtils.isEmpty(id)) {
... | Creates a new instance. |
public static void startServices(ServiceHost host,Class... services) throws InstantiationException, IllegalAccessException {
checkArgument(services != null,"services cannot be null");
for ( Class service : services) {
startService(host,service);
}
}
| Starts the list of services on the host. |
public AbstractInsnNode[] toArray(){
int i=0;
AbstractInsnNode elem=first;
AbstractInsnNode[] insns=new AbstractInsnNode[size];
while (elem != null) {
insns[i]=elem;
elem.index=i++;
elem=elem.next;
}
return insns;
}
| Returns an array containing all of the instructions in this list. |
public void resetScore(View v){
scoreTeamA=0;
scoreTeamB=0;
displayForTeamA(scoreTeamA);
displayForTeamB(scoreTeamB);
}
| Resets the score for both teams back to 0. |
@Override public void close(){
synchronized (mLock) {
mClosed=true;
clear();
}
}
| Removes any existing callbacks. Once closed, no more callbacks will be registered. |
public static String stringFor(int n){
switch (n) {
case CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE:
return "CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE";
case CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE:
return "CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE";
case CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE:
return "CU_SHARED_MEM_... | Returns the String identifying the given CUsharedconfig |
public void multiplyByScalar(float scalar){
this.points[0]*=scalar;
this.points[1]*=scalar;
this.points[2]*=scalar;
}
| Multiply by scalar. |
private void processMoovAtom(ContainerAtom moov) throws ParserException {
List<Mp4Track> tracks=new ArrayList<>();
long earliestSampleOffset=Long.MAX_VALUE;
GaplessInfo gaplessInfo=null;
Atom.LeafAtom udta=moov.getLeafAtomOfType(Atom.TYPE_udta);
if (udta != null) {
gaplessInfo=AtomParsers.parseUdta(udta,i... | Updates the stored track metadata to reflect the contents of the specified moov atom. |
public void addNFSShare(String fsName,String qtreeName,String mountPath,String exportPath,int anonymousUid,List<String> roHosts,List<String> rwHosts,List<String> rootHosts,List<NFSSecurityStyle> securityStyle){
FlexFileShare share=new FlexFileShare(server.getNaServer(),mountPath);
share.addNFSShare(fsName,qtreeName... | Adds a new NFS share. |
public Cursor queryAllContacts(ContentResolver cr){
final String columnsToQuery[]=new String[]{ContactsContract.Contacts._ID,ContactsContract.Contacts.DISPLAY_NAME,ContactsContract.Contacts.STARRED};
final String selection="((" + Contacts.DISPLAY_NAME + " NOTNULL) AND ("+ Contacts.DISPLAY_NAME+ " != '' ) AND ("+ Co... | Synchronously query for contacts in the Contacts ContentProvider. |
public void stop(boolean cancel){
if (srvEndpoint == null) return;
U.cancel(acceptWorker);
U.join(acceptWorker,log);
try {
hnd.stop();
}
catch ( IgniteCheckedException e) {
U.error(log,"Failed to stop IGFS server handler (will close client connections anyway).",e);
}
for ( ClientWorker worker... | Stops this server. |
public boolean isPreAssignedPCIUnitNumbersSupported(){
return preAssignedPCIUnitNumbersSupported;
}
| Gets the value of the preAssignedPCIUnitNumbersSupported property. |
public void onDestroy(){
if (mAdapter != null) {
mAdapter.onDestroy();
}
}
| Performs cleanup when the Activity/Fragment using the adapter is destroyed. |
public ItemStack mergeWithSlotsStack(@Nonnull IInventory inv,@Nullable ItemStack stack){
if (stack == null) return null;
for (int i=0; i < inv.getSizeInventory(); ++i) {
if (stack.stackSize <= 0) break;
mergeWithSlot(inv,stack,i);
}
return stack.stackSize <= 0 ? null : stack;
}
| Attempts to merge the given ItemStack into the inventory |
public DSignCsr(JFrame parent,Spkac spkacCsr,File csrFile,PrivateKey signPrivateKey,KeyPairType signKeyPairType,X509Certificate verificationCertificate,Provider provider) throws CryptoException {
super(parent,Dialog.ModalityType.DOCUMENT_MODAL);
this.spkacCsr=spkacCsr;
this.csrFile=csrFile;
this.signPrivateKey=... | Creates a new DSignCsr dialog for a SPKAC formatted CSR. |
@Override public void run(MessageLogger logger){
logger.log("<simulation-log>");
try {
while (!env.isDone() && !frame.simulationPaused()) {
Thread.sleep(500);
env.step();
}
}
catch ( InterruptedException e) {
}
logger.log("Performance: " + env.getPerformanceMeasure(agent));
logger.log(... | Starts simulation. |
public static Comparator<Long> inverseLongComparator(){
return INVERSE_LONG_COMPARATOR;
}
| Instance assessor for the inverse <code>Comparator</code> for <code>Long</code>s. This is necessary because the <code>Long</code> class did not implement <code>Comparable</code> in Java 1.1.8. This is an instance because the <code>LongComparator</code> has no state, allowing a single instance to be used whenever a ... |
protected float avgFieldLength(CollectionStatistics collectionStats){
final long sumTotalTermFreq=collectionStats.sumTotalTermFreq();
if (sumTotalTermFreq <= 0) {
return 1f;
}
else {
final long docCount=collectionStats.docCount() == -1 ? collectionStats.maxDoc() : collectionStats.docCount();
return (... | The default implementation computes the average as <code>sumTotalTermFreq / docCount</code>, or returns <code>1</code> if the index does not store sumTotalTermFreq: any field that omits frequency information). |
@Override public int[] addInstance(BallNode node,Instance inst) throws Exception {
double leftDist, rightDist;
if (node.m_Left != null && node.m_Right != null) {
leftDist=m_DistanceFunction.distance(inst,node.m_Left.getPivot(),Double.POSITIVE_INFINITY);
rightDist=m_DistanceFunction.distance(inst,node.m_Righ... | Adds an instance to the ball tree. |
public static long addMonths(long timeMillis,int months){
if (isNotTime(timeMillis)) {
return NO_TIME_MILLIS;
}
DateOnlyCalendar calendar=DateOnlyCalendar.fromTime(timeMillis);
calendar.add(Calendar.MONTH,months);
long result=calendar.getTimeInMillis();
calendar.recycle();
return result;
}
| Adds months to given month |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public static String formatSimpleDecimalWithZeros(double d){
return simpleFormatForceZero.format(d);
}
| returns string from double formatted to DecimalFormat("###.00") |
@Override public void service(Mail mail) throws MessagingException {
if (!mail.getState().equals(Mail.GHOST)) {
sieveMailet.service(mail);
}
}
| Delivers a mail to a local mailbox in a given folder. |
public final boolean solvePositionConstraints(){
float minSeparation=0.0f;
for (int i=0; i < m_count; ++i) {
ContactPositionConstraint pc=m_positionConstraints[i];
int indexA=pc.indexA;
int indexB=pc.indexB;
float mA=pc.invMassA;
float iA=pc.invIA;
Vec2 localCenterA=pc.localCenterA;
fina... | Sequential solver. |
private void preProcessNetwork(){
XY2Links xY2Links=new XY2Links(network,null);
this.links=network.getLinks();
}
| pre-processes the network for astar, and associating acts with links |
public static <T>Iterator<T> tail(Iterator<T> self){
if (!self.hasNext()) {
throw new NoSuchElementException("Cannot access tail() for an empty Iterator");
}
self.next();
return self;
}
| Returns the original iterator after throwing away the first element. |
public Device(RandomAccessFile raf) throws IOException {
startSize=raf.readUnsignedShort();
endSize=raf.readUnsignedShort();
deltaFormat=raf.readUnsignedShort();
int size=startSize - endSize;
switch (deltaFormat) {
case 1:
size=(size % 8 == 0) ? size / 8 : size / 8 + 1;
break;
case 2:
size=(size % 4 == 0)... | Creates new Device |
public static AndroidHttpClient newInstance(String userAgent,Context context){
HttpParams params=new BasicHttpParams();
HttpConnectionParams.setStaleCheckingEnabled(params,false);
HttpConnectionParams.setConnectionTimeout(params,SOCKET_OPERATION_TIMEOUT);
HttpConnectionParams.setSoTimeout(params,SOCKET_OPERATIO... | Create a new HttpClient with reasonable defaults (which you can update). |
@Override public String globalInfo(){
return "Bayesian Classifier Chains (BCC).\n" + "Creates a maximum spanning tree based on marginal label dependence. Then employs CC.\n" + "For more information see:\n"+ getTechnicalInformation().toString();
}
| Description to display in the GUI. |
public JSONObject put(String key,Object value) throws JSONException {
if (key == null) {
throw new JSONException("Null key.");
}
if (value != null) {
testValidity(value);
this.map.put(key,value);
}
else {
remove(key);
}
return this;
}
| Put a key/value pair in the JSONObject. If the value is null, then the key will be removed from the JSONObject if it is present. |
public int classIndex(){
return m_ClassIndex;
}
| Returns the class attribute's index. Returns negative number if it's undefined. |
public ListBuffer(){
clear();
}
| Create a new initially empty list buffer. |
private CourseInfoModel srtStream(String url,boolean preferCache) throws Exception {
Bundle p=new Bundle();
p.putString("format","json");
String json=null;
if (NetworkUtil.isConnected(context) && !preferCache) {
String urlWithAppendedParams=HttpManager.toGetUrl(url,p);
logger.debug("Url " + urlWithAppen... | Returns Stream object from the given URL. |
public static <T>T map(final JBBPFieldStruct root,final String structPath,final Class<T> mappingClass,final JBBPMapperCustomFieldProcessor customFieldProcessor){
return map(root,structPath,mappingClass,customFieldProcessor,0);
}
| Create a class instance, map binary data of a structure for its path to its fields and return the instance. |
protected boolean close(LRUCacheEntry entry){
IBuffer buffer=(IBuffer)entry.value;
if (!((Openable)buffer.getOwner()).canBufferBeRemovedFromCache(buffer)) {
return false;
}
else {
ArrayList buffers=(ArrayList)this.buffersToClose.get();
if (buffers == null) {
buffers=new ArrayList();
this.... | Returns true if the buffer is successfully closed and removed from the cache, otherwise false. <p/> <p>NOTE: this triggers an external removal of this buffer by closing the buffer. |
boolean onBackPressed(){
if (mDelegate != null && mDelegate.isSelectionEnabled()) {
mDelegate.clearSelection();
return true;
}
return false;
}
| Handles the event when user clicks back button and the UI is in selection mode. |
void addWrittenBytesTime(long writtenBytes,long writeTime){
IgniteBiTuple<LongAdder8,LongAdder8> bytesWritten0=bytesWritten;
bytesWritten0.get1().add(writtenBytes);
bytesWritten0.get2().add(writeTime);
}
| Adds given numbers to written bytes and write time. |
public void reset(ICompletionCallback<T> callback,Object state){
this.error=null;
this.result=null;
this.callback=callback;
this.state=state;
}
| Resets a promises state.<br> This can be used to reuse a promise.<br> This may only be used if it's guaranteed that the promise and the associated future is no longer used by anyone else. |
protected String evaluate(String str){
StrSubstitutor substitutor=new StrSubstitutor(variables);
return substitutor.replace(str);
}
| Evaluates the given string for variable references. |
public void init(){
this.leading=0;
while (this.leading < this.value.length() && this.value.charAt(this.leading) == ' ') {
this.leading++;
}
if (this.leading == this.value.length()) {
this.setEmpty();
}
else {
this.isEmpty=false;
this.trailing=0;
while (this.value.charAt(this.value.length... | Calculates leading and trailing spaces. Also sets empty if needed. |
@Override public void drawAnnotations(Graphics2D g2,Rectangle2D dataArea,ValueAxis domainAxis,ValueAxis rangeAxis,Layer layer,PlotRenderingInfo info){
Iterator iterator=null;
if (layer.equals(Layer.FOREGROUND)) {
iterator=this.foregroundAnnotations.iterator();
}
else if (layer.equals(Layer.BACKGROUND)) {
... | Draws all the annotations for the specified layer. |
public void write(char[] cbuf,int off,int len) throws java.io.IOException {
write(new String(cbuf,off,len));
}
| Write a portion of an array of characters. |
private void addDV(Integer iw,DistinctValue dv,ArrayList<Pair<Integer,DistinctValue>> list) throws IOException {
if (dv != null) list.add(new Pair<Integer,DistinctValue>(iw,dv));
}
| Applicable when running on SPARK. Helper function to output transformation metadata into shuffle. |
public static DecodeReturn checkPreamble(String preamble,final EvolutionState state,final LineNumberReader reader){
int linenumber=0;
try {
String s="";
while (s != null && s.trim().equals("")) {
linenumber=reader.getLineNumber();
s=reader.readLine();
}
if (s == null || !(s=s.trim()).sta... | Finds the next nonblank line, then trims the line and checks the preamble. Returns a DecodeReturn on the line if successful, else posts a fatal error. Sets the DecodeReturn's line number. The DecodeReturn has not yet been decoded. You'll need to do that with Code.decode(...) |
private static boolean isHistoryTypeToShow(int historyType){
return historyType == HistoryReference.TYPE_PROXIED || historyType == HistoryReference.TYPE_ZAP_USER || historyType == HistoryReference.TYPE_AUTHENTICATION || historyType == HistoryReference.TYPE_PROXY_CONNECT;
}
| Tells whether or not the messages with the given history type should be shown in the History tab. |
protected void writeRequest(final NextFilter nextFilter,final SocksProxyRequest request){
try {
boolean isV4ARequest=Arrays.equals(request.getIpAddress(),SocksProxyConstants.FAKE_IP);
byte[] userID=request.getUserName().getBytes("ASCII");
byte[] host=isV4ARequest ? request.getHost().getBytes("ASCII") : nu... | Encode a SOCKS4/SOCKS4a request and writes it to the next filter so it can be sent to the proxy server. |
public int diff_xIndex(LinkedList<Diff> diffs,int loc){
int chars1=0;
int chars2=0;
int last_chars1=0;
int last_chars2=0;
Diff lastDiff=null;
for ( Diff aDiff : diffs) {
if (aDiff.operation != Operation.INSERT) {
chars1+=aDiff.text.length();
}
if (aDiff.operation != Operation.DELETE) {
... | loc is a location in text1, compute and return the equivalent location in text2. e.g. "The cat" vs "The big cat", 1->1, 5->8 |
public ValuePortrayal3D(){
this(SHAPE_CUBE);
}
| Creates a ValuePortrayal3D with a cube shape. |
public final boolean isInfoEnabled(){
return isLevelEnabled(SimpleLog.LOG_LEVEL_INFO);
}
| <p> Are info messages currently enabled? </p> <p> This allows expensive operations such as <code>String</code> concatenation to be avoided when the message will be ignored by the logger. </p> |
public int modulus(int operand){
return count % operand;
}
| Calculates modulus of current count. |
public boolean isDiscountPrinted(){
Object oo=get_Value(COLUMNNAME_IsDiscountPrinted);
if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
| Get Discount Printed. |
int decrypt(byte[] cipher,int cipherOffset,int cipherLen,byte[] plain,int plainOffset){
if ((cipherLen % blockSize) != 0) {
throw new ProviderException("Internal error in input buffering");
}
int endIndex=cipherOffset + cipherLen;
for (; cipherOffset < endIndex; cipherOffset+=blockSize, plainOffset+=blockSi... | Performs decryption operation. <p>The input cipher text <code>cipher</code>, starting at <code>cipherOffset</code> and ending at <code>(cipherOffset + cipherLen - 1)</code>, is decrypted. The result is stored in <code>plain</code>, starting at <code>plainOffset</code>. <p>It is also the application's responsibility to ... |
public double dualRow(int i){
validate(i);
return px[i];
}
| Returns the dual optimal value for the specified row. |
public CFilterPanel(final IFilterFactory<T> filterFactory,final IHelpInformation filterHelp){
super(new BorderLayout());
m_filterFactory=filterFactory;
m_inputField=new CHelpTextField(filterHelp);
m_inputField.addMouseListener(m_internalMouseListener);
add(m_inputField);
m_inputField.getDocument().addDocume... | Creates a new panel object. |
public static List<double[]> toDoubles(Shape s){
List<double[]> coordLists=new ArrayList<double[]>();
PathIterator pi2=s.getPathIterator(null);
FlatteningPathIterator pi=new FlatteningPathIterator(pi2,.25);
double[] coords=new double[6];
double lastMovedToPntX=Double.NaN;
double lastMovedToPntY=Double.NaN;
... | Convert a Shape object into a List of double[]. Separate double[] are created in case there's a moveTo in the order of coordinates in Shape. |
@Override public void load(Element element,Object o){
Editor ed=(Editor)o;
LocoLabel ll=new LocoLabel(ed);
Element elem=element.getChild("size");
ll.setWidth(getInt(elem,"width"));
ll.setHeight(getInt(elem,"height"));
if (elem != null && elem.getAttribute("systemName") != null) {
String name=elem.getAtt... | Create a PositionableShape, then add to a target JLayeredPane |
public static Map<String,Object> updateContactMech(DispatchContext ctx,Map<String,? extends Object> context){
Map<String,Object> result=FastMap.newInstance();
Delegator delegator=ctx.getDelegator();
Security security=ctx.getSecurity();
GenericValue userLogin=(GenericValue)context.get("userLogin");
Locale loca... | Updates a ContactMech <b>security check</b>: userLogin partyId must equal partyId, or must have PARTYMGR_UPDATE permission |
@Override public void registerBooze(@Nonnull Fluid fluid){
ensureFluidIsValid(fluid);
if (!isFluidBooze(fluid)) {
logger.debug("Registering booze %s",fluid.getName());
registerBooze(fluid,new BoozeEntry(fluid));
}
else {
throw new IllegalArgumentException("[Growthcraft|Cellar] The fluid being registe... | Registers a Booze to the CellarRegistry. Example Usage: CellarRegistry.instance().registerBooze(new Booze().setColor(0xFFAABB)); |
public JsonObject broadlinkInitNetwork(){
return broadlinkExecuteCommand(BroadlinkConstants.CMD_NETWORK_INIT_ID,BroadlinkConstants.CMD_NETWORK_INIT);
}
| Initialize Broadlink SDK |
public String findMatch(Pattern pattern,String text){
return findMatch(pattern,text,1);
}
| Finds the first match of the specified pattern and returns the first group. |
public ConcurrentModificationException(String type,int version){
super("Outdated " + type + " in version "+ version);
}
| Constructs a new exception with a pre-defined detail message that includes the given parameter values. |
@Override public void logLevelChange(Level level){
Level debugLevel=bot.getDebugLevel();
int logLevel=SessionLog.INFO;
if (debugLevel == Level.ALL) {
logLevel=SessionLog.FINEST;
}
else if (debugLevel == Level.FINEST) {
logLevel=SessionLog.FINE;
}
else if (debugLevel == Level.FINE) {
logLevel... | Notify a logging level change. |
protected void readZ(ByteBuffer buffer){
this.zRange=ShapefileUtils.readDoubleArray(buffer,2);
this.zValues=ShapefileUtils.readDoubleArray(buffer,this.getNumberOfPoints());
}
| Read's the shape's Z values from the record buffer. |
private IBoard createBoard(StringMultiMap p) throws ScenarioLoaderException {
int mapWidth=16, mapHeight=17;
if (null == p.getString(PARAM_MAP_WIDTH)) {
System.out.println(String.format("No map width specified; using %d",mapWidth));
}
else {
mapWidth=Integer.parseInt(p.getString(PARAM_MAP_WIDTH));
}
... | Load board files and create the megaboard. |
@Override public boolean handle(IGame.Phase phase,Vector<Report> vPhaseReport){
if (game.getOptions().booleanOption("aero_sanity")) {
return handleAeroSanity(phase,vPhaseReport);
}
Entity entityTarget=(target.getTargetType() == Targetable.TYPE_ENTITY) ? (Entity)target : null;
if ((((null == entityTarget) ||... | Sigh, according to the ruling linked below, when weapon bays are fired at ground targets, they should make one to-hit roll, but the AV of each weapon should be applied separately as damage - that needs a special handler |
protected void onHit(Object readerCoreKey,Query query){
assert lock.isHeldByCurrentThread();
hitCount+=1;
}
| Expert: callback when there is a cache hit on a given query. Implementing this method is typically useful in order to compute more fine-grained statistics about the query cache. |
protected DateTimeConverter makeConverter(Object defaultValue){
return new DateConverter(defaultValue);
}
| Create the Converter with a default value. |
public boolean remove(String classname){
String pkgname;
HashSet<String> names;
classname=cleanUp(classname);
pkgname=extractPackage(classname);
names=m_Cache.get(pkgname);
if (names != null) {
return names.remove(classname);
}
else {
return false;
}
}
| Removes the classname from the cache. |
public RequestHandle post(Context context,String url,HttpEntity entity,String contentType,ResponseHandlerInterface responseHandler){
return sendRequest(httpClient,httpContext,addEntityToRequestBase(new HttpPost(URI.create(url).normalize()),entity),contentType,responseHandler,context);
}
| Perform a HTTP POST request and track the Android Context which initiated the request. |
public void startBlockChainDownload(PeerDataEventListener listener){
lock.lock();
try {
if (downloadPeer != null) {
if (this.downloadListener != null) {
removeDataEventListenerFromPeer(downloadPeer,this.downloadListener);
}
if (listener != null) {
addDataEventListenerToPeer(Thr... | <p>Start downloading the blockchain from the first available peer.</p> <p>If no peers are currently connected, the download will be started once a peer starts. If the peer dies, the download will resume with another peer.</p> |
private String nextUnquotedValue(){
int i=position;
findNonLiteralCharacter: for (; i < limit; i++) {
switch (in.charAt(i)) {
case '/':
case '\\':
case ';':
case '#':
case '=':
checkLenient();
case '{':
case '}':
case '[':
case ']':
case ':':
case ',':
case ' ':
case '\t':
case '\f':
case '\r':
case '\n':
... | Returns an unquoted value as a string. |
public void runTo(int index){
if (!m_cacheNodes) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_INDEX,null));
if ((index >= 0) && (m_next < m_firstFree)) m_next=index;
else m_next=m_firstFree - 1;
}
| If an index is requested, NodeSetDTM will call this method to run the iterator to the index. By default this sets m_next to the index. If the index argument is -1, this signals that the iterator should be run to the end. |
public ClientBuilder defaultResponseTimeoutMillis(long defaultResponseTimeoutMillis){
return option(ClientOption.DEFAULT_RESPONSE_TIMEOUT_MILLIS,defaultResponseTimeoutMillis);
}
| Sets the default timeout of a response in milliseconds. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:50.995 -0500",hash_original_method="86F26DE68AB39CE9DEE1E486630D72BD",hash_generated_method="1D832A1960BD04E82C364D5311BD5FAE") public String byteStringNoSemicolon(){
StringBuffer retval=new StringBuffer();
try {
while (true... | Return a substring containing no semicolons. |
private void updateSelectionRectKoordinates(double x1,double x2,double y1,double y2,ModifiableHyperBoundingBox ranges){
final int dims=proj.getVisibleDimensions();
int minaxis=dims + 1;
int maxaxis=-1;
{
int i=0;
while (i < dims) {
double axx=getVisibleAxisX(i);
if (x1 < axx || x2 < axx) {
... | Set the selected ranges and the mask for the actual dimensions in the context |
public DirectoryScannerConfig removeScan(String name){
return this.directoryScanners.remove(name);
}
| Removes the named directory scanner from the list. |
public void elementAdded(CnATreeElement element){
try {
addToCache(element,checkChildren(element));
updateParentInCache(element);
}
catch ( RuntimeException re) {
LOG.error("RuntimeException in elementAdded",re);
throw re;
}
catch ( Exception e) {
LOG.error("Exception in elementAdded",e);
... | Method is called when an element was added. |
@Override public void fillRect(int x,int y,int width,int height){
if (width == m_extent.width && height == m_extent.height) {
clearRect(x,y,width,height);
}
else {
if (DEBUG) {
m_printstream.println("% fillRect");
}
setStateToLocal();
m_printstream.println(xTransform(xScale(x)) + " " + yT... | Draw a filled rectangle in current pen color. |
public PdfEntry(){
super();
getCategories().remove(DocumentListEntry.CATEGORY);
getCategories().add(CATEGORY);
}
| Constructs a new uninitialized entry, to be populated by the GData parsers. |
public ZDT6(){
this(10);
}
| Constructs a ZDT6 test problem with 10 decision variables. |
public DatagramSocket socket(){
return _mySocket;
}
| get the datagram socket of the UDP client. more info at java.net.DatagramSocket |
private void updateOptionPaneState(){
int type=-2;
boolean closable=wasClosable;
Object obj=frame.getClientProperty("JInternalFrame.messageType");
if (obj == null) {
return;
}
if (obj instanceof Integer) {
type=((Integer)obj).intValue();
}
switch (type) {
case JOptionPane.ERROR_MESSAGE:
select... | Updates any state dependant upon the JInternalFrame being shown in a <code>JOptionPane</code>. |
public Alignment parseDataBlock(TaxonList taxonList) throws ImportException, IOException {
return readDataBlock();
}
| Parses a 'DATA' block. |
public R proceed3(final T3 param){
return fn.apply(param1,param2,param);
}
| Proceed and execute wrapped TriFunction with it's first and second input parameters as a captured and the replacement parameter as provided |
public void testGetRandomNonAccentColor(){
List<Integer> nonAccentColorList=new ArrayList<>();
try {
for ( String name : MaterialPalettes.ALL_COLOR_NAMES) {
nonAccentColorList.addAll(MaterialPalettes.getColorsByName(name,false));
}
int randomColor=MaterialPalettes.getRandomNonAccentColor();
... | Tests that the color returned by getRandomNonAccent color exists in the non accent colors. |
public h6 addElement(String hashcode,Element element){
addElementToRegistry(hashcode,element);
return (this);
}
| Adds an Element to the element. |
public Object contents(){
return m_Contents;
}
| Returns the contents in the node. |
public void reset(){
this.getUpstairs().clear();
this.getDownstairs().clear();
this.fireProjectorDataChanged();
}
| Reset the projector. Clear the underlying datasets. |
@Override public void onCreate(SQLiteDatabase db){
db.execSQL("CREATE TABLE " + ServerConstants.TABLE_NAME + " ( "+ ServerConstants._ID+ " INTEGER PRIMARY KEY AUTOINCREMENT, "+ ServerConstants.TITLE+ " TEXT NOT NULL, "+ ServerConstants.HOST+ " TEXT NOT NULL, "+ ServerConstants.PORT+ " INTEGER, "+ ServerConstants.PASS... | Create all needed tables on first start |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.