code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
protected void update(MyHeap upper_bound,double new_bound) throws Exception {
upper_bound.putBySubstitute(new_bound);
}
| Replaces the current top/max value in the heap with the new one. The new max value should be <= the old one. |
public void write(ClassFile classFile,File f) throws IOException {
FileOutputStream f_out=new FileOutputStream(f);
try {
write(classFile,f_out);
}
finally {
f_out.close();
}
}
| Write a ClassFile data structure to a file. |
@Override public void fromBytes(ByteBuf buf){
pos=BlockPos.fromLong(buf.readLong());
hasFacing=buf.readBoolean();
if (hasFacing) {
facing=EnumFacing.getFront(buf.readUnsignedByte());
}
}
| Convert from the supplied buffer into your specific message type |
public Object delete(String re){
Object o=null;
RegexpNode p=prefixMachine;
RegexpNode best=p;
int len=re.length() - 1;
int i;
boolean prefix=true;
if (!re.startsWith("*") || !re.endsWith("*")) len++;
if (len <= 0) return null;
for (i=0; p != null; i++) {
if (p.result != null && p.depth < BIG ... | Delete the regular expression and its target. |
@Override public boolean supportsSchemasInDataManipulation(){
debugCodeCall("supportsSchemasInDataManipulation");
return true;
}
| Returns whether the schema name in INSERT, UPDATE, DELETE is supported. |
public MLet(URL[] urls){
this(urls,true);
}
| Constructs a new MLet for the specified URLs using the default delegation parent ClassLoader. The URLs will be searched in the order specified for classes and resources after first searching in the parent class loader. |
public void testSemver(){
ascending("0.1.2","0.1.11","0.1.11-2","1.0.0-alpha","1.0.0-alpha.1","1.0.0-beta","1.0.0-beta.2","1.0.0-beta.11","1.0.0-rc.1","1.0.0");
}
| See http://semver.org/ |
public Resources interpret(final Set<ClassResult> classResults){
resources=new Resources();
resources.setBasePath(PathNormalizer.getApplicationPath(classResults));
javaTypeAnalyzer=new JavaTypeAnalyzer(resources.getTypeRepresentations());
dynamicTypeAnalyzer=new DynamicTypeAnalyzer(resources.getTypeRepresentati... | Interprets the class results. |
public GetMovieDetails(int movieId,String... properties){
super();
addParameterToRequest("movieid",movieId);
addParameterToRequest("properties",properties);
}
| Retrieve details about a specific movie |
public long insert(ContentValues values){
return insertInternal(values,false);
}
| Performs an insert, adding a new row with the given values. If the table contains conflicting rows, an error is returned. |
public Map<Installment,Map<String,BigDecimal>> prepareRsnWiseDemandForOldProp(final Property property){
LOGGER.debug("Entered into prepareRsnWiseDemandForOldProp, property: " + property);
Installment inst=null;
final Map<Installment,Map<String,BigDecimal>> instWiseDmd=new HashMap<Installment,Map<String,BigDecimal... | Prepares a map of installment and respective reason wise demand for each installment |
public CSVReader(Reader reader,char separator,char quotechar,char escape,int line){
this(reader,separator,quotechar,escape,line,CSVParser.DEFAULT_STRICT_QUOTES);
}
| Constructs CSVReader. |
@Override public void playShowAnimation(){
showAnimation.play();
}
| Plays the implemented show animation |
public ClusterOrder run(){
for (DBIDIter iditer=ids.iter(); iditer.valid(); iditer.advance()) {
if (!processedIDs.contains(iditer)) {
assert (heap.isEmpty());
expandClusterOrder(iditer);
}
}
LOG.ensureCompleted(progress);
return clusterOrder;
}
| Process the data set. |
public boolean isLenient(){
return lenient;
}
| Returns true if this parser is liberal in what it accepts. |
protected void addHistory(String s){
if (s.equals("")) {
return;
}
if (m_History.contains(s)) {
m_History.removeElement(s);
}
m_History.add(0,s);
notifyHistoryChangedListeners();
}
| adds the given string to the history (removes duplicates). |
public static Grid newGridLayout(){
Grid grid=new Grid();
grid.makeNoStrip();
return grid;
}
| New instance of grid for form layout |
@Override protected void onDeleteComplete(int token,Object cookie,int result){
if (token == mDeleteToken) {
synchronized (sDeletingThreadsLock) {
sDeletingThreads=false;
if (DELETEDEBUG) {
Log.v(TAG,"Conversation onDeleteComplete sDeletingThreads: " + sDeletingThreads);
}
sDeletingThre... | Always call this super method from your overridden onDeleteComplete function. |
private static void assertRegisterPresent(final HLL hll,final int registerIndex,final int registerValue){
final IntByteHashMap sparseProbabilisticStorage=hll.sparseProbabilisticStorage;
assertEquals(sparseProbabilisticStorage.get(registerIndex),registerValue);
}
| Asserts that the register at the specified index is set to the specified value. |
public static Map<String,Integer> createIdxFromKey(String line,String fieldSeparator){
String[] keys=line.split(fieldSeparator);
Map<String,Integer> idxFromKey=new HashMap<String,Integer>();
for (int ii=0; ii < keys.length; ii++) {
idxFromKey.put(keys[ii],ii);
}
return idxFromKey;
}
| This is used to parse a header line from a tab-delimited urbansim header and generate a Map that allows to look up column numbers (starting from 0) by giving the header line. I.e. if you have a header "from_id <tab> to_id <tab> travel_time", then idxFromKey.get("to_id") will return "1". This makes the reading of column... |
private OpenSSLMessageDigestJDK(String algorithm,long evp_md,int size) throws NoSuchAlgorithmException {
super(algorithm);
this.evp_md=evp_md;
this.size=size;
}
| Creates a new OpenSSLMessageDigest instance for the given algorithm name. |
public <T extends DataObject>T findById(URI id){
if (id == null) {
throw new DataAccessException("ID provided was null");
}
Class<T> modelClass=getModelClass(id);
if (modelClass != null) {
return of(modelClass).findById(id);
}
else {
return null;
}
}
| Finds an object by ID. |
public MUserMail(MMailText parent,int AD_User_ID,EMail mail){
this(parent.getCtx(),0,parent.get_TrxName());
setClientOrg(parent);
setAD_User_ID(AD_User_ID);
setR_MailText_ID(parent.getR_MailText_ID());
if (mail.isSentOK()) setMessageID(mail.getMessageID());
else {
setMessageID(mail.getSentMsg());
s... | User Mail |
public void dispose(){
if (frameProvider != null) {
((CRFPClient)frameProvider).dispose();
}
}
| When the layer is deleted, it should sign off from the server, so that it can free up it's cache for it. |
public Handle(int tag,String owner,String name,String desc){
this.tag=tag;
this.owner=owner;
this.name=name;
this.desc=desc;
}
| Constructs a new field or method handle. |
@Deprecated public static TypesafeConfigModule fromConfig(Config config){
return fromConfigWithPackage(config,"");
}
| Essentially calls fromConfigWithPackage with a package name of "" to construct a TypesafeConfigModule. |
public boolean adjustValue(int key,float amount){
int index=index(key);
if (index < 0) {
return false;
}
else {
_values[index]+=amount;
return true;
}
}
| Adjusts the primitive value mapped to key. |
public T caseDictionaryPropertyType(DictionaryPropertyType object){
return null;
}
| Returns the result of interpreting the object as an instance of '<em>Dictionary Property Type</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc --> |
private void concatBlocks(OutputFileMetadata outputFileMetadata) throws IOException {
Path outputFilePath=new Path(filePath,outputFileMetadata.getRelativePath());
int numBlocks=outputFileMetadata.getNumberOfBlocks();
long[] blocksArray=outputFileMetadata.getBlockIds();
Path firstBlock=new Path(blocksDirectoryPa... | Fast merge using HDFS block concat |
public final void shuffle(int[] array){
int l=array.length;
for (int i=0; i < l; i++) {
int index=nextInt(l - i) + i;
int temp=array[index];
array[index]=array[i];
array[i]=temp;
}
}
| Shuffles an array. |
public void testLRUMap(){
LRUMap<String,String> map=new LRUMap<String,String>(5);
map.put("one","one");
map.put("two","two");
map.put("three","three");
String[] control={"three","two","one"};
int count=3;
display(control.clone(),map);
for ( String s : map.keySet()) {
assertEquals(control[--count],s... | Ensure that LRUMap works as advertised. |
public void testComputeLocationWhenEjbPackaging() throws Exception {
Deployable deployableElement=new Deployable();
deployableElement.setGroupId("projectGroupId");
deployableElement.setArtifactId("projectArtifactId");
deployableElement.setType("ejb");
String location=deployableElement.computeLocation(createDe... | Test compute location for EJBs. |
public static final Token newToken(int ofKind){
switch (ofKind) {
case JavaParserConstants.RUNSIGNEDSHIFT:
case JavaParserConstants.RSIGNEDSHIFT:
case JavaParserConstants.GT:
return new GTToken();
default :
return new Token();
}
}
| Returns a new Token object, by default. However, if you want, you can create and return subclass objects based on the value of ofKind. Simply add the cases to the switch for all those special cases. For example, if you have a subclass of Token called IDToken that you want to create if ofKind is ID, simlpy add something... |
public WorkerThread(Object kmlSource,AppFrame appFrame){
this.kmlSource=kmlSource;
this.appFrame=appFrame;
}
| Creates a new worker thread from a specified <code>kmlSource</code> and <code>appFrame</code>. |
public static void touch(IPath path) throws IOException {
Preconditions.checkArgument(path.isAbsolute());
makeDir(path.removeLastSegments(1));
Path file=FileSystems.getDefault().getPath(path.toOSString());
Files.createFile(file);
}
| Creates the named file, creating parent directories if needed. |
@Override public boolean validateDrop(Object target,int operation,TransferData transferType){
if (!(target instanceof GefaehrdungsUmsetzung)) {
return false;
}
return true;
}
| Returns true, if drop is allowed (which is only the case if the target is a GefaehrdungsUmsetzung). |
private static String tableElementToHtml(TableElement td){
StringBuilder result=new StringBuilder();
result.append("Row: " + td.getRow() + " Col: "+ td.getCol()+ "\n");
if (td.nrOfSections() == 1 && td.getSection(0).getTitleElement() == null) {
result.append(sectionCCLToHtml(td.getSection(0)));
}
else {
... | Generates HTML Output for a TableElement. |
private boolean inPolyline(ArrayList<Double> ob,double x,double y){
int countx=0;
double vecx, vecy;
double change;
double x1, y1, x2, y2;
for (int noa=1; noa < ob.size() - 4; noa+=2) {
y1=ob.get(noa + 1).doubleValue();
y2=ob.get(noa + 3).doubleValue();
x1=ob.get(noa).doubleValue();
x2=ob.get(... | Checks to see if the coordinate passed is inside the ployline passed, Note that this is done using attribute values and not there respective screen values. |
public UserProjectExample(UserProjectObject sample){
oredCriteria=new ArrayList<Criteria>();
Criteria criteria=this.or();
if (sample.getUserId() != null) {
criteria.andUserIdEqualTo(sample.getUserId());
}
if (sample.getProjectId() != null) {
criteria.andProjectIdEqualTo(sample.getProjectId());
}
i... | This method was generated by MyBatis Generator. This method corresponds to the database table user_project |
public static int geometric(double p){
if (!(p >= 0.0 && p <= 1.0)) throw new IllegalArgumentException("Probability must be between 0.0 and 1.0");
return (int)Math.ceil(Math.log(uniform()) / Math.log(1.0 - p));
}
| Returns an integer with a geometric distribution with mean 1/p. |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
int i=0;
if (args.length <= 0) {
showFeedback("Plugin parameters have not been set.");
return;
}
for (i=0; i < args.length; i++) {
if (i == 0) {
inputHeader=args[i];
}
else if (i == 1... | Used to execute this plugin tool. |
protected void addTextIndicator(final String text,final NotificationType type){
textIndicators.add(new TextIndicator(text,type));
fireChange(PROP_TEXT_INDICATORS);
}
| Create/add a text indicator message. |
public boolean waitForAcquireQuietly(){
boolean success=false;
try {
success=Await.result(acquireFuture);
}
catch ( InterruptedException ie) {
Thread.currentThread().interrupt();
}
catch ( LockTimeoutException lte) {
logger.debug("Timeout on lock acquiring",lte);
}
catch ( Exception e) {
l... | Wait for the acquire result. |
public SAML2AuthnRequestException(String message,ReasonEnum reason){
super(message);
bean.setReason(reason);
setMessageKey(getMessageKey() + "." + reason.toString());
}
| Constructs a new exception with the specified detail message and reason. |
public static void errorLogOnly(final ErrorType type,final String... params){
if (type != null && type.getNumberOfParameters() == params.length) {
final ErrorEvent event=new ErrorEvent(type,params);
userLog(event.getMessage());
}
}
| Convenience method to report an error to the log only. If the <code>type</code> is <code>null</code> or if the parameter count does not match the expected number of parameters then the notification is ignored. |
private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
s.defaultWriteObject();
}
| Save the state of the <tt>Vector</tt> instance to a stream (that is, serialize it). This method is present merely for synchronization. It just calls the default readObject method. |
@Override public boolean ownDeletesAreVisible(int type){
debugCodeCall("ownDeletesAreVisible",type);
return false;
}
| Returns whether own deletes are visible. |
public void testTxLocalPessimisticReadCommitted() throws Exception {
checkTx(LOCAL,PESSIMISTIC,READ_COMMITTED);
}
| Test TRANSACTIONAL LOCAL cache with PESSIMISTIC/READ_COMMITTED transaction. |
public void addChild(AccessibilityNodeInfo child){
if (mChildren == null) {
mChildren=new LinkedList<>();
}
mChildren.add(child);
((ShadowAccessibilityNodeInfo)ShadowExtractor.extract(child)).mParent=mRealAccessibilityNodeInfo;
}
| Add a child node to this one. Also initializes the parent field of the child. |
private void processAnsiCommand_H(){
}
| This method sets the cursor to a position specified by the escape sequence parameters (default is the upper left corner of the screen). |
@Override public int eDerivedStructuralFeatureID(int baseFeatureID,Class<?> baseClass){
if (baseClass == ParameterizedAccess.class) {
switch (baseFeatureID) {
case N4JSPackage.PARAMETERIZED_ACCESS__TYPE_ARGS:
return N4JSPackage.PARAMETERIZED_CALL_EXPRESSION__TYPE_ARGS;
default :
return -1;
}
}
return super.... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public void addSrcClass(SootClass clz){
srcClasses.add(clz.getName());
}
| Add a generated class to the list of src classes. |
public void testUnsizedIntsCountSeq(){
LongAdder counter=new LongAdder();
SplittableRandom r=new SplittableRandom();
long size=100;
r.ints().limit(size).forEach(null);
assertEquals(size,counter.sum());
}
| A sequential unsized stream of ints generates at least 100 values |
public void requestPreviewFrame(Handler handler,int message){
if (camera != null && previewing) {
previewCallback.setHandler(handler,message);
if (useOneShotPreviewCallback) {
camera.setOneShotPreviewCallback(previewCallback);
}
else {
camera.setPreviewCallback(previewCallback);
}
}
}
| A single preview frame will be returned to the handler supplied. The data will arrive as byte[] in the message.obj field, with width and height encoded as message.arg1 and message.arg2, respectively. |
protected static String quoteTimestamp(java.sql.Timestamp x){
if (x == null) {
return "null";
}
return "Timestamp.valueOf(\"" + x.toString() + "\")";
}
| Format a timestamp to the Java source code that represents this object. |
public void append(String str){
if (str == null) return;
int restLength=buffer.length - pos;
if (str.length() < restLength) {
str.getChars(0,str.length(),buffer,pos);
pos+=str.length();
}
else {
str.getChars(0,restLength,buffer,pos);
curr.next=new Entity(buffer);
curr=curr.next;
lengt... | Method to append a string to char buffer |
@Override public void run(){
amIActive=true;
String streamsHeader=null;
String pointerHeader=null;
String outputHeader=null;
int row, col, x, y;
float progress=0;
double z;
int i, c;
int d, x2, y2;
int[] dX=new int[]{1,1,1,0,-1,-1,-1,0};
int[] dY=new int[]{-1,0,1,1,1,0,-1,-1};
double[] inflowing... | Used to execute this plugin tool. |
synchronized private void startWorker(final Writer out){
if (f != null && !f.isDone()) return;
Runnable r=new AsyncWriterRunnable(out);
f=e.submit(r,out);
}
| Starts a new worker thread |
public static void main(String[] args){
DNACompiler dnaCompiler=new DNACompiler();
dnaCompiler.run(args);
}
| Cello main: this is the function that is called to run Cello |
public void testDeployFile(){
this.fileHandler.createFile("ram:///test.extension");
File file=(File)factory.createDeployable("jonas5x","ram:///test.extension",DeployableType.FILE);
deployer.deploy(file);
assertTrue(fileHandler.exists(deployer.getDeployableDir(file) + "/test.extension"));
}
| Test file deployment. |
public static void sort(byte[] array){
sort(0,array.length,array);
}
| Sorts the specified array in ascending numerical order. |
public UGraphic[] fillRectangle(com.bbn.openmap.corba.CSpecialist.CProjection p,com.bbn.openmap.corba.CSpecialist.LLPoint ll1,com.bbn.openmap.corba.CSpecialist.LLPoint ll2,java.lang.String staticArgs,org.omg.CORBA.StringHolder dynamicArgs,com.bbn.openmap.corba.CSpecialist.GraphicChange notifyOnChange,String uniqueID){
... | The CSpecialist function. |
public static <T>LazyPStackX<T> fromPublisher(Publisher<? extends T> publisher){
return fromStreamS(ReactiveSeq.fromPublisher((Publisher<T>)publisher));
}
| Construct a LazyPStackX from an Publisher |
public boolean containsId(T t){
return t2imap.containsKey(t);
}
| Checks whether the structure contains this element. |
public static Bitmap makeRoundUserPicture(Bitmap bitmap){
if (bitmap == null) return null;
Bitmap output=Bitmap.createBitmap(bitmap.getWidth(),bitmap.getHeight(),Config.ARGB_8888);
Canvas canvas=new Canvas(output);
final Paint paint=new Paint();
final Rect rect=new Rect(0,0,bitmap.getWidth(),bitmap.getHeigh... | Converts a square user picture to a round user picture. |
public byte[] evaluateChallenge(byte[] challengeData) throws SaslException {
if (completed) {
throw new IllegalStateException("GSSAPI authentication already complete");
}
if (finalHandshake) {
return doFinalHandshake(challengeData);
}
else {
try {
byte[] gssOutToken=secCtx.initSecContext(chal... | Processes the challenge data. The server sends a challenge data using which the client must process using GSS_Init_sec_context. As per RFC 2222, when GSS_S_COMPLETE is returned, we do an extra handshake to determine the negotiated security protection and buffer sizes. |
private boolean shouldStartMapActivity(){
return bus.getStickyEvent(DbInitializedEvent.class) != null && bus.getStickyEvent(SplashScreenTimerFinishedEvent.class) != null && bus.getStickyEvent(ArpiBitmapsPrecomputedEvent.class) != null && bus.getStickyEvent(LoginInitializedEvent.class) != null;
}
| Check whether all the initialization finished response events are there and we should start MapActivity. |
public void receiveImageData(byte[] imageBytes){
writeDataFile(outputFileName,imageBytes);
complete=true;
iMaster.doNext();
}
| Receive the bytes from a image. ImageReceiver interface function. |
public void runActions(Context context,boolean onlyIfScreenIsOn){
assert mServiceRunnable != null;
assert mPowerManagerHelper != null;
if (!onlyIfScreenIsOn || mPowerManagerHelper.isScreenOn(context)) {
if (mNeedToRunActions.getAndSet(false)) {
unregisterReceiver(context);
mHandler.postDelayed(mSe... | Posts a task to run the necessary actions. The task is delayed to prevent spin-locking in ChromeTabbedActivity.onResume(): http://b/issue?id=5864891&query=5864891 |
public int count(){
return count;
}
| Returns the number of strong components. |
protected void createSideGeometry(ShapeData shapeData){
int vertexCoordCount=this.totalFaceCount * 4 * 3;
if (shapeData.sideVertexBuffer != null && shapeData.sideVertexBuffer.capacity() >= vertexCoordCount) shapeData.sideVertexBuffer.clear();
else shapeData.sideVertexBuffer=Buffers.newDirectFloatBuffer(vertexC... | Constructs the Cartesian geometry of this shape's sides and sets it in the specified shape data. |
public AutoImports(DependencyManager mgr){
this.mgr=requireNonNull(mgr);
}
| Initializes the <code>AutoImports</code>. |
public RosterExchange(){
super();
}
| Creates a new empty roster exchange package. |
@Override public boolean hasPermission(Authentication authentication,Serializable targetId,String targetType,Object permission){
throw new UnsupportedOperationException("hasPermission() by ID is not supported");
}
| We need to override this method as well. To keep things simple, Let's not use this, throwing exception is someone uses it. |
protected final String stopInfo(){
return "SPI stopped ok.";
}
| Gets uniformly format message for SPI stop. |
public void zoom(){
if (getSelectedRowKey() != null && getSelectedRowKey() > 0) {
MQuery zoomQuery=new MQuery();
String column=getKeyColumn();
if (column.indexOf(".") > 0) column=column.substring(column.indexOf(".") + 1);
zoomQuery.addRestriction(column,MQuery.EQUAL,getSelectedRowKey());
zoomQ... | Zoom action To be overwritten by concrete classes |
@Override public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
| Called when the activity is first created. |
public SVGPath relativeMoveTo(double x,double y){
if (x > Double.NEGATIVE_INFINITY && x < Double.POSITIVE_INFINITY && y > Double.NEGATIVE_INFINITY && y < Double.POSITIVE_INFINITY) {
append(PATH_MOVE_RELATIVE,x,y);
}
return this;
}
| Move to the given relative coordinates. |
@Override protected TypeSet specialCasesIntersectedWith(TypeSet s2){
if (s2 instanceof EnumeratedTypeSet) {
EnumeratedTypeSet result=new EnumeratedTypeSet(getTypeSetEnvironment());
result.addAll(this);
result.retainAll(s2);
if (result.size() > 0) return result;
else return getTypeSetEnvironme... | Computes and returns a <em>new</em> EnumeratedTypeSet representing the intersection of the receiver with s2. Does not modify the receiver. |
@DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED}) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:08.600 -0500",hash_original_method="A36333A6F745F23182438BFF478F971C",hash_generated_method="3E83C3693072E036EE6283AD07E42258") public String encode(){
return encode(new StringBuff... | Encode a list of sip headers. Headers are returned in cannonical form. |
public final boolean canGetBoolean(String field){
Column col=getColumn(field);
return (col == null ? false : col.canGetBoolean());
}
| Check if the given data field can return primitive <code>boolean</code> values. |
private static int findNalStartCode(byte[] data,int index){
int endIndex=data.length - NAL_START_CODE.length;
for (int i=index; i <= endIndex; i++) {
if (isNalStartCode(data,i)) {
return i;
}
}
return -1;
}
| Finds the next occurrence of the NAL start code from a given index. |
private void notExists(String configuration,DataSourceFixture dataSourceFixture) throws Exception {
XMLAssert.assertXpathNotExists("//resource-ref[res-ref-name='" + dataSourceFixture.jndiLocation + "']",configuration);
}
| Check that XML path doesn't exist for a datasource fixture. |
public Long deleteUserIDSelf(String SID){
Long users_id=sessionManagement.checkSession(SID);
long user_level=userManagement.getUserLevelByID(users_id);
if (user_level >= 1) {
userManagement.logout(SID,users_id);
return usersDao.deleteUserID(users_id);
}
else {
return new Long(-10);
}
}
| logs a user out and deletes his account |
void deliver(Message message){
message.setThread(threadID);
for ( MessageListener listener : listeners) {
listener.processMessage(this,message);
}
}
| Delivers a message directly to this chat, which will add the message to the collector and deliver it to all listeners registered with the Chat. This is used by the Connection class to deliver messages without a thread ID. |
public final synchronized String readLine(int timeoutMillis){
if (closed) return null;
try {
if (lines.isEmpty()) {
if (timeoutMillis > 0) wait(timeoutMillis);
else wait();
}
if (lines.isEmpty()) return closed ? null : "";
String ret=lines.get(0);
lines.remove(0);
re... | Read a line from the pipe. Returns null on failure. Returns empty string on timeout. |
@Override public int applyIntersections(){
intersections=detector.intersections(items);
return intersections.size();
}
| This example is the simplest, where the entities are themselves line segments so there is no transformation required. |
public static boolean isPossiblePhoneNumberCanDoFileAccess(String query){
String currentCountry=QKSMSApp.getApplication().getCurrentCountryIso().toUpperCase();
if (mPhoneNumberUtil == null) {
mPhoneNumberUtil=PhoneNumberUtil.getInstance();
}
return mPhoneNumberUtil.isPossibleNumber(query,currentCountry);
}
| isPossiblePhoneNumberCanDoFileAccess does a more accurate test if the input is a phone number, but it can do file access to load country prefixes and other info, so it's not safe to call from the UI thread. |
public static void main(String argv[]){
Debug.init();
Debug.put("Lambert");
LambertConformal proj=null;
proj=new LambertConformal(new LatLonPoint.Double(50.679572292f,5.807370150f),100000.0f,620,480,4.3569395237f,-49.833333109f,-51.166666321f,90.0f,150000.01f,5400088.44f,Ellipsoid.WGS_84);
Debug.message("Lamb... | test method |
public ListRowPresenter(int focusZoomFactor){
this(focusZoomFactor,false);
}
| Constructs a ListRowPresenter with the given parameters. |
@Override public boolean isOutboundDone(){
return isOutboundDone;
}
| This method works according to the specification of implemented class. |
public static String exists(EventType type,String fieldName){
Class clazz=getClass(type,fieldName);
if (clazz == null) {
return "Parent view does not contain a field named '" + fieldName + '\'';
}
return null;
}
| Check if the field identified by the field name exists according to the schema. |
void addChangesRecursively(Server server,List<MaterialRevision> outChanges) throws MalformedURLException, IOException {
if (!changed) {
return;
}
if (!isPipeline()) {
if (!outChanges.contains(this)) outChanges.add(this);
}
else {
for ( Modification m : modifications) {
Matcher matcher=... | Collect all changed MaterialRevision objects, walking changed "Pipeline" objects recursively instead of including them directly. |
public DebugGraphics(Graphics graphics){
this();
this.graphics=graphics;
}
| Constructs a debug graphics context from an existing graphics context that supports slowed down drawing. |
public com.wipro.ats.bdre.imcrawler.mr.Contents.Builder clearDocid(){
fieldSetFlags()[0]=false;
return this;
}
| Clears the value of the 'docid' field |
@Override public int compare(Map.Entry<String,HierarchicalAggregateEntity> e1,Map.Entry<String,HierarchicalAggregateEntity> e2){
int r=0;
String key1=e1.getKey();
List<Double> valueList1=e1.getValue().getValues();
String key2=e2.getKey();
List<Double> valueList2=e2.getValue().getValues();
for ( SortOption ... | default to sort by all groupby fields |
public static void logConsumerRunning(final Logger logger){
logger.logMessage(Level.INFO,"Consumer is up and running");
}
| Logs the start of a consumer. |
@Override public float floatValue(){
return (float)value;
}
| Returns the value of this MutableDouble as a float. |
ByteVector encodeUTF8(final String s,int i,int maxByteLength){
int charLength=s.length();
int byteLength=i;
char c;
for (int j=i; j < charLength; ++j) {
c=s.charAt(j);
if (c >= '\001' && c <= '\177') {
byteLength++;
}
else if (c > '\u07FF') {
byteLength+=3;
}
else {
byteL... | Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if necessary. The string length is encoded in two bytes before the encoded characters, if there is space for that (i.e. if this.length - i - 2 >= 0). |
public static ExecutorServiceCloser of(ExecutorService executorService){
return new ExecutorServiceCloser(executorService,Optional.empty());
}
| Create an ExecutorServiceCloser for the supplied ExecutorService. This closer will not have an associated timeout. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.