code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public boolean addTriangle(Triangle triangle){
return getTriangles().add(triangle);
}
| Add a triangle in relationship with the edge. |
public String invertSelectionTipText(){
return "Set attribute selection mode. If false, only selected " + "attributes in the range will be worked on; if " + "true, only non-selected attributes will be processed.";
}
| Returns the tip text for this property. |
public static ActiveMQConnectionFactory createConnectionFactoryWithHA(final DiscoveryGroupConfiguration groupConfiguration,JMSFactoryType jmsFactoryType){
ActiveMQConnectionFactory factory=null;
if (jmsFactoryType.equals(JMSFactoryType.CF)) {
factory=new ActiveMQJMSConnectionFactory(true,groupConfiguration);
... | Creates an ActiveMQConnectionFactory that receives cluster topology updates from the cluster as servers leave or join and new backups are appointed or removed. <p> The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP broadcasts which contain connection information for members of t... |
public UnicastServerRef2(){
}
| Create a new (empty) Unicast server remote reference. |
public static boolean isPaddyWithWater(IBlockAccess world,int x,int y,int z,int amount){
final Block block=world.getBlock(x,y,z);
if (isPaddy(block)) {
final int meta=world.getBlockMetadata(x,y,z);
return meta >= amount;
}
return false;
}
| Determines if the block at the location is a paddy (with water) |
public boolean isDistinct(){
return isDistinct;
}
| Returns indictor whether distinct or not. |
private void childInv(Node r){
Edge e;
Node s;
for (int noa=0; (e=r.getChild(noa)) != null; noa++) {
s=e.getTarget();
s.setVisible(false);
childInv(s);
}
}
| Recursively goes through the tree and sets all the children to invisible, Not the parent though. |
@Override public void resize(int width,int height){
float aspectRatio=1.0f * width / height;
camera.setToOrtho(false,width,height);
trackSatellite(camera,aspectRatio);
}
| The resize callback gets called after create, and any time the screen size changes, which could be because a mobile device rotated, or because we're running the desktop app, and the user changed the window size by dragging around the corner. When the screen size changes, we need to make sure our camera is updated. If t... |
private void compileIllegal(final IGame game,final Entity entity,final MoveStep prev){
final MoveStepType stepType=getType();
final boolean isInfantry=entity instanceof Infantry;
Coords curPos=getPosition();
Coords lastPos=prev.getPosition();
boolean isUnjammingRAC=entity.isUnjammingRAC();
prevStepOnPavemen... | This function checks that a step is legal. And adjust the movement type. This only checks for things that can make this step by itself illegal. Things that can make a step illegal as part of a movement path are considered in MovePath.addStep. |
public Point2D pointAtLength(float length){
int upperIndex=findUpperIndex(length);
if (upperIndex == -1) {
return null;
}
PathSegment upper=(PathSegment)segments.get(upperIndex);
if (upperIndex == 0) {
return new Point2D.Float(upper.getX(),upper.getY());
}
PathSegment lower=(PathSegment)segments.g... | Returns the point that is at the given length along the path. |
public CompiledST lookupTemplate(String name){
if (name.charAt(0) != '/') name="/" + name;
if (verbose) System.out.println(getName() + ".lookupTemplate(" + name+ ")");
CompiledST code=rawGetTemplate(name);
if (code == NOT_FOUND_ST) {
if (verbose) System.out.println(name + " previously seen as not fo... | Look up a fully-qualified name. |
protected boolean beforeSave(boolean newRecord){
if (newRecord || is_ValueChanged("C_BP_Group_ID")) {
MBPGroup grp=getBPGroup();
if (grp == null) {
log.saveWarning("Error",Msg.parseTranslation(getCtx(),"@NotFound@: @C_BP_Group_ID@"));
return false;
}
setBPGroup(grp);
}
return true;
}
| Before Save |
public void append(Selector item){
if (length == list.length) {
Selector[] tmp=list;
list=new Selector[1 + list.length + list.length / 2];
System.arraycopy(tmp,0,list,0,tmp.length);
}
list[length++]=item;
}
| Appends an item to the list. |
public synchronized int hashCode(){
int h=0;
if (count == 0 || loadFactor < 0) return h;
loadFactor=-loadFactor;
Entry<?,?>[] tab=table;
for ( Entry<?,?> entry : tab) {
while (entry != null) {
h+=entry.hashCode();
entry=entry.next;
}
}
loadFactor=-loadFactor;
return h;
}
| Returns the hash code value for this Map as per the definition in the Map interface. |
@Override public void mousePressed(GlobalMouseEvent event){
}
| Invoked when a mouse button has been pressed. |
public SexMemo(final SequencesReader reader,final ReferencePloidy ploidy) throws IOException {
final Sex[] sexValues=Sex.values();
mReferences=new ReferenceGenome[sexValues.length];
mParMap=new MyFrickenMap[sexValues.length];
mAutosomes=new HashSet<>();
for ( final Sex sex : sexValues) {
final ReferenceG... | Remember information from command line and reference file to enable ploidy of a sequence to be determined given the sex of a sample. |
private static byte[] lmResponse(final byte[] hash,final byte[] challenge) throws AuthenticationException {
try {
final byte[] keyBytes=new byte[21];
System.arraycopy(hash,0,keyBytes,0,16);
final Key lowKey=createDESKey(keyBytes,0);
final Key middleKey=createDESKey(keyBytes,7);
final Key highKey=c... | Creates the LM Response from the given hash and Type 2 challenge. |
public Calendar addToCalendar(Calendar cal){
cal.add(Calendar.MILLISECOND,this.milliseconds);
cal.add(Calendar.SECOND,this.seconds);
cal.add(Calendar.MINUTE,this.minutes);
cal.add(Calendar.HOUR,this.hours);
cal.add(Calendar.DAY_OF_MONTH,this.days);
cal.add(Calendar.MONTH,this.months);
cal.add(Calendar.YEA... | Add this time duration to a Calendar instance. Returns the original Calendar instance. |
public void replace(String querySQL,String[] columnNames,Session session,boolean recursive,boolean force){
String oldQuerySQL=this.querySQL;
Column[] oldColumnTemplates=this.columnTemplates;
boolean oldRecursive=this.recursive;
init(querySQL,null,columnTemplates,session,recursive);
DbException e=recompile(ses... | Try to replace the SQL statement of the view and re-compile this and all dependent views. |
private void customEvictionTest(boolean reverse){
int MAP_SIZE=1000;
int WRITES_PER_TYPE=100 * MAP_SIZE;
int ACCEPTABLE_NON_PREMIUM_RATE=11;
Builder<Integer,CustomerType> builder=TCacheFactory.standardFactory().builder();
builder.setId("customEviction-reverse=" + reverse).setExpectedMapSize(MAP_SIZE);
build... | Tests that elements are evicted in the correct order, when using a custom eviction implementation. |
public StreamingJsonBuilder(Writer writer,Object content,JsonGenerator generator) throws IOException {
this.writer=writer;
this.generator=generator;
if (content != null) {
writer.write(generator.toJson(content));
}
}
| Instantiates a JSON builder, possibly with some existing data structure and the given generator. |
public MinRowExpression add(Expression expression){
this.getChildren().add(expression);
return this;
}
| Add an expression to include in the computation. |
public InputStream openInputStream(String file) throws IOException {
return Util.getImplementation().openFileInputStream(file);
}
| Opens an input stream to the given file |
private void validateConfig(int expDataCfgs,GridClientConfiguration cfg){
assertEquals(GridClientRandomBalancer.class,cfg.getBalancer().getClass());
assertEquals(10000,cfg.getConnectTimeout());
assertEquals(null,cfg.getSecurityCredentialsProvider());
assertEquals(expDataCfgs,cfg.getDataConfigurations().size());... | Validate loaded configuration. |
private HashMap<String,String> readConfig(String configPath) throws Exception {
log.debug("LdapLoginmanagement.readConfig : " + configPath);
File configFile=new File(configPath);
if (!configFile.isFile()) return null;
ConfigReader reader=new ConfigReader();
reader.readConfig(configPath);
return reader.get... | Reading Ldap Config via ConfigReader |
@Override public void onDraw(Canvas c,RecyclerView parent,RecyclerView.State state){
if (this.mOrientation == VERTICAL_LIST) {
drawVertical(c,parent);
}
else {
drawHorizontal(c,parent);
}
}
| Draw any appropriate decorations into the Canvas supplied to the RecyclerView. Any content drawn by this method will be drawn before the item views are drawn, and will thus appear underneath the views. |
public static void main(final String[] args) throws Exception {
if (args.length != 1) {
System.err.println("Verifies the given class.");
System.err.println("Usage: CheckClassAdapter " + "<fully qualified class name or class file name>");
return;
}
ClassReader cr;
if (args[0].endsWith(".class")) {
... | Checks a given class. <p> Usage: CheckClassAdapter <binary class name or class file name> |
public static long spooky4(final BitVector bv,final long seed){
long h0, h1, h2, h3;
h0=seed;
h1=seed;
h2=ARBITRARY_BITS;
h3=ARBITRARY_BITS;
final int length=(int)bv.length();
int remaining=length;
int pos=0;
while (remaining >= Long.SIZE * 4) {
h2+=bv.getLong(pos + 0 * Long.SIZE,pos + 1 * Long.SI... | SpookyHash 4-word-state (up to four values produced). |
public static DirectedAcyclicGraph<Action,DefaultEdge> buildWorkflowGraph(Workflow workflow,Config config,String outputDir,boolean generateGraphviz,String graphvizFormat) throws WorkflowGraphException {
forkCount=0;
Map<String,Action> actionsByName=new HashMap<>();
List<Action> workflowActions=workflow.getActions... | Build a workflow graph from the workflow definition, inserting fork/join pairs as appropriate for parallel |
public void onWatched(ChunkDataBase chunkStorage,EntityPlayerMP player){
this.watchers.add(player);
}
| Called when a player starts watching this shared storage |
public Object resolveRemote(String type,String url) throws IOException {
HessianRemoteResolver resolver=getRemoteResolver();
if (resolver != null) return resolver.lookup(type,url);
else return new HessianRemote(type,url);
}
| Resolves a remote object. |
@Override public boolean eIsSet(int featureID){
switch (featureID) {
case UmplePackage.INTERFACE_DEFINITION___NAME_1:
return NAME_1_EDEFAULT == null ? name_1 != null : !NAME_1_EDEFAULT.equals(name_1);
case UmplePackage.INTERFACE_DEFINITION___DEPEND_1:
return depend_1 != null && !depend_1.isEmpty();
case UmplePack... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public boolean canImport(JComponent comp,DataFlavor[] flavors){
JTextComponent c=(JTextComponent)comp;
if (!(c.isEditable() && c.isEnabled())) return false;
return (getImportFlavor(flavors,c) != null);
}
| This method indicates if a component would accept an import of the given set of data flavors prior to actually attempting to import it. |
protected void onPrepareRequest(HttpUriRequest request) throws IOException {
}
| Called before the request is executed using the underlying HttpClient. <p> Overwrite in subclasses to augment the request. </p> |
public URL toURL() throws MalformedURLException {
if (!absolute) {
throw new IllegalArgumentException("URI is not absolute: " + toString());
}
return new URL(toString());
}
| Converts this URI instance to a URL. |
public void clear(){
Node<T> node=head.next, next;
size=0;
head.reset();
tail=head;
iterator.currentNode=head;
while (node != null) {
next=node.next;
node.free(pool);
node=next;
}
}
| Removes all elements of the list. Frees all nodes to the pool. |
public static Object[] replaceKey(final Object[] keyValues,final Object oldKey,final Object newKey){
final Object[] kvs=new Object[keyValues.length];
for (int i=0; i < keyValues.length; i=i + 2) {
if (keyValues[i].equals(oldKey)) kvs[i]=newKey;
else kvs[i]=keyValues[i];
kvs[i + 1]=keyValues[i + 1];... | Replaces one key with a different key. |
private Assert(){
}
| Prevent instantiation. |
@Action(value="/receipts/challan-saveOnCancel") @SkipValidation public String saveOnCancel(){
boolean isInstrumentDeposited=false;
setSourcePage(CollectionConstants.CANCELRECEIPT);
for ( InstrumentHeader instrumentHeader : receiptHeader.getReceiptInstrument()) if (instrumentHeader.getInstrumentType().getType()... | This method is invoked when receipt is cancelled |
public void listenOn(String channel){
this.pcClient.listenOn(channel);
}
| Subscribe to a channel using PubNub to listen for calls. |
public ScaleAndIndex index(int index){
return new ScaleAndIndex(scale,index);
}
| Specifies a single quantile index to be calculated, i.e. the k in the kth q-quantile. |
public HttpCookie(String name,String value){
String ntrim=name.trim();
if (!isValidName(ntrim)) {
throw new IllegalArgumentException("Invalid name: " + name);
}
this.name=ntrim;
this.value=value;
}
| Creates a new cookie. |
@Override public Map<double[],Double> discretise(int nbBuckets){
return points;
}
| Returns the points for this distribution. |
public static String readURLConnection(URLConnection uc) throws Exception {
StringBuffer buffer=new StringBuffer();
BufferedReader reader=null;
try {
reader=new BufferedReader(new InputStreamReader(uc.getInputStream()));
int letter=0;
while ((letter=reader.read()) != -1) {
buffer.append((char)le... | This method read all of the data from a URL connection to a String |
static public Pair<List<PastCourse>,List<PastCourse>> separateByDistinction(List<PastCourse> pastCourseList){
List<PastCourse> regularList=new ArrayList<>();
List<PastCourse> honorList=new ArrayList<>();
for ( PastCourse c : pastCourseList) {
if (c.isHonor()) honorList.add(c);
else regularList.add(c... | separate courses by honor distinction |
public byte[] encode() throws UnsupportedOperationException {
throw new UnsupportedOperationException("ContentDependentAttributes should be encoded " + "through the contend-dependent encode method");
}
| Returns a binary representation of this attribute. |
public ConstantScoreQuery(Query query){
this.query=Objects.requireNonNull(query,"Query must not be null");
}
| Strips off scores from the passed in Query. The hits will get a constant score of 1. |
private Geometry unionSafe(Geometry g0,Geometry g1){
if (g0 == null && g1 == null) return null;
if (g0 == null) return (Geometry)g1.clone();
if (g1 == null) return (Geometry)g0.clone();
return unionOptimized(g0,g1);
}
| Computes the union of two geometries, either or both of which may be null. |
public synchronized <T extends EventListener>void remove(Class<T> t,T l){
if (l == null) {
return;
}
if (!t.isInstance(l)) {
throw new IllegalArgumentException("Listener " + l + " is not of type "+ t);
}
int index=-1;
for (int i=listenerList.length - 2; i >= 0; i-=2) {
if ((listenerList[i] == t)... | Removes the listener as a listener of the specified type. |
@SuppressWarnings("UnnecessaryLocalVariable") public boolean intersects(Viewport viewport){
if (viewport == null) {
throw new IllegalArgumentException(Logger.logMessage(Logger.ERROR,"Viewport","intersects","missingViewport"));
}
Viewport that=viewport;
return this.width > 0 && this.height > 0 && that.width ... | Indicates whether this viewport intersects a specified viewport. Two viewport intersect when both overlap by a non-zero amount. An empty viewport never intersects another viewport. |
private boolean isIncluded(final HttpServletRequest request){
String uri=(String)request.getAttribute("javax.servlet.include.request_uri");
boolean includeRequest=!(uri == null);
if (includeRequest && log.isDebugEnabled()) {
log.debug("{} resulted in an include request. This is unusable, because" + "the respo... | Checks if the request uri is an include. These cannot be gzipped. |
private void constructLopsCtable() throws HopsException, LopsException {
if (_op != OpOp3.CTABLE) throw new HopsException("Unexpected operation: " + _op + ", expecting "+ OpOp3.CTABLE);
DataType dt1=getInput().get(0).getDataType();
DataType dt2=getInput().get(1).getDataType();
DataType dt3=getInput().get(2).g... | Method to construct LOPs when op = CTABLE. |
public static boolean isConfigured(){
return System.getProperty("java.util.logging.config.file") != null;
}
| Checks if logger is already configured within this VM or not. |
@SuppressLint("NewApi") public static void tryAccessibilityAnnounce(View view,CharSequence text){
if (isJellybeanOrLater() && view != null && text != null) {
view.announceForAccessibility(text);
}
}
| Try to speak the specified text, for accessibility. Only available on JB or later. |
public boolean equals(Object obj2){
if (null == obj2) return false;
if (obj2 instanceof XNumber) return obj2.equals(this);
else if (obj2 instanceof XNodeSet) return obj2.equals(this);
else if (obj2 instanceof XStringForFSB) return equals((XMLString)obj2);
else return equals(obj2.toString());
}
| Compares this string to the specified object. The result is <code>true</code> if and only if the argument is not <code>null</code> and is a <code>String</code> object that represents the same sequence of characters as this object. |
public void clearStatus(){
Iterator<Timer> i=m_timers.values().iterator();
while (i.hasNext()) {
i.next().stop();
}
m_timers.clear();
m_tableIndexes.clear();
while (m_tableModel.getRowCount() > 0) {
m_tableModel.removeRow(0);
}
}
| Clear the status area. |
private void animateFollowSanta(LatLng futurePosition){
if (futurePosition == null) {
return;
}
mCameraUpdate=CameraUpdateFactory.newLatLng(futurePosition);
executeRunnable(mThreadAnimate);
}
| Animate at current zoom level to center on the position. |
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 |
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 int sendMessageAsync(Message message){
if (mParticipant instanceof Contact) {
OtrChatManager cm=OtrChatManager.getInstance();
SessionID sId=cm.getSessionId(message.getFrom().getAddress(),mParticipant.getAddress().getAddress());
SessionStatus otrStatus=cm.getSessionStatus(sId);
message.setTo(new... | Sends a message to other participant(s) in this session asynchronously and adds the message to the history. TODO: more docs on async callbacks. |
private void releaseWaiters(int phase){
QNode q;
Thread t;
AtomicReference<QNode> head=(phase & 1) == 0 ? evenQ : oddQ;
while ((q=head.get()) != null && q.phase != (int)(root.state >>> PHASE_SHIFT)) {
if (head.compareAndSet(q,q.next) && (t=q.thread) != null) {
q.thread=null;
LockSupport.unpark(t... | Removes and signals threads from queue for phase. |
public ClusteringContentEvent(long index,Instance instance){
this.instance=instance;
this.setKey(Long.toString(index));
}
| Instantiates a new clustering event. |
public CVCertificate(ASN1InputStream aIS) throws IOException {
initFrom(aIS);
}
| Create an iso7816Certificate structure from an ASN1InputStream. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:36.457 -0500",hash_original_method="5FD28FD097FA7AFD0A367EAC6C59D766",hash_generated_method="D479575CB2424DCD39BA62A902BB6AA3") public static Date parseDate(final String dateValue,String[] dateFormats) throws DateParseException {
... | Parses the date value using the given date formats. |
public ClusterException(String message){
super(message);
}
| Creates a new instance with the specified error message. |
public static <A>SetTValue<A> of(final AnyMValue<? extends Set<A>> monads){
return new SetTValue<>(monads);
}
| Construct an SetT from an AnyM that wraps a monad containing Sets |
public static boolean restartSpringboard(String message){
int inputData=-1;
BufferedReader keyboardInput=null;
Process p=null;
boolean ret=false;
try {
String[] cmd={"ssh","-p","2222","root@localhost","launchctl","stop","com.apple.SpringBoard"};
p=Runtime.getRuntime().exec(cmd);
p.waitFor();
S... | Restarts the springboard. Hopefully someday we can bypass the swipe! |
public static boolean defDoublesAsUse(Operand d,Instruction s){
for (Enumeration<Operand> u=s.getUses(); u.hasMoreElements(); ) {
Operand use=u.nextElement();
if (use != null) {
if (use.similar(d)) return true;
}
}
return false;
}
| Is the operand d, which is a def in instruction s, also a use in instruction s? That is, is this operand defined as a DU operand in InstructionFormatList.dat. <p> TODO!!: This implementation is slow. Think about adding some IR support for this functionality; possibly add methods like enumeratePureDefs(), enumerateImp... |
private void accesBreakpointInstruction(ArrayList<Instruction> instructions,int lineNumber,int op,BPINSTRUCTION_STATUS status){
for (int i=0; i < instructions.size(); i++) {
Instruction currInst=instructions.get(i);
if (op == 0) {
if (currInst instanceof MRJobInstruction) {
MRJobInstruction curr... | Access breakpoint instruction at specified line number in set of instructions (if valid) |
public static InputStream open(final Context context,final String assetFilePath){
try {
return context.getAssets().open(assetFilePath);
}
catch ( IOException e) {
return null;
}
}
| opean a file in assets path |
public void testCompareToDiffSigns1(){
byte aBytes[]={12,56,100,-2,-76,89,45,91,3,-15,35,26,3,91};
byte bBytes[]={10,20,30,40,50,60,70,10,20,30};
int aSign=1;
int bSign=-1;
BigInteger aNumber=new BigInteger(aSign,aBytes);
BigInteger bNumber=new BigInteger(bSign,bBytes);
assertEquals(1,aNumber.compareTo(bN... | compareTo(BigInteger a). Compare two numbers of different signs. The first is positive. |
public Value createBlob(InputStream x,long length){
if (x == null) {
return ValueNull.INSTANCE;
}
if (length <= 0) {
length=-1;
}
Value v=ValueLobDb.createTempBlob(x,length);
session.addTemporaryLob(v);
return v;
}
| Create a Blob value from this input stream. |
@Override public String toString(){
if (eIsProxy()) return super.toString();
StringBuffer result=new StringBuffer(super.toString());
result.append(" (builtInFacetKey: ");
result.append(builtInFacetKey);
result.append(')');
return result.toString();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public AggregationPopulationPlotter(ExampleSet originalExampleSet,Attribute[] allAttributes,FeatureGenerator generator){
this.originalExampleSet=originalExampleSet;
this.allAttributes=allAttributes;
this.generator=generator;
}
| Creates plotter panel which is repainted every generation. |
@Override public void processFinished() throws OperatorException {
super.processFinished();
Iterator i=getListenerListCopy().iterator();
while (i.hasNext()) {
((ProcessListener)i.next()).processEnded(this.process);
}
}
| Called at the end of the process. Notifies all listeners and the children operators (super method). |
public void testEmptySet(){
assertEquals(0,CharArraySet.EMPTY_SET.size());
assertTrue(CharArraySet.EMPTY_SET.isEmpty());
for ( String stopword : TEST_STOP_WORDS) {
assertFalse(CharArraySet.EMPTY_SET.contains(stopword));
}
assertFalse(CharArraySet.EMPTY_SET.contains("foo"));
assertFalse(CharArraySet.EMP... | Smoketests the static empty set |
private void returnData(Object ret){
if (myHost != null) {
myHost.returnData(ret);
}
}
| Used to communicate a return object from a plugin tool to the main Whitebox user-interface. |
public VecWithNorm(Vec base,double norm){
this.base=base;
this.normSqrd=norm * norm;
}
| Creates a wrapper around the base vector that will update the norm of the vector |
static int applyMaskPenaltyRule4(ByteMatrix matrix){
int numDarkCells=0;
byte[][] array=matrix.getArray();
int width=matrix.getWidth();
int height=matrix.getHeight();
for (int y=0; y < height; y++) {
byte[] arrayY=array[y];
for (int x=0; x < width; x++) {
if (arrayY[x] == 1) {
numDarkCel... | Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance. |
public boolean uninstallActiveVersion(){
File file=findFile(selectedVersion);
if (file != null && file.exists()) {
file.delete();
}
installedVersions.remove(selectedVersion);
selectedVersion=null;
active=false;
if (installedVersions.isEmpty()) {
MANAGED_EXTENSIONS.remove(this.getPackageId());
}
... | Returns true if uninstall was successful. |
public Map<String,String> retrievePop(String user) throws IllegalArgumentException, IOException, ServiceException {
if (isBlankOrNullString(user)) {
throw new IllegalArgumentException();
}
logger.log(Level.INFO,"Getting POP settings for user " + user + " ...");
GenericEntry popEntry=retrieveSettingsEntry(us... | Retrieves POP3 settings |
public Map<ICloud.MBSFile,Outcome> write(ByteString signature,IOFunction<OutputStream,Long> writer) throws IOException, InterruptedException {
logger.trace("<< write() < signature: {}",Bytes.hex(signature));
lock.lockInterruptibly();
try {
Map<ICloud.MBSFile,Outcome> outcomes=new HashMap<>();
Set<ICloud.M... | Writes the files referenced by the specified signature. <p> If encrypted, attempts to decrypt the file. Optionally set's the last-modified timestamp. <p> The writer is not closed. |
private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
| Defend against malicious streams. |
public double maxDist(SpatialComparable mbr1,SpatialComparable mbr2){
final int dim1=mbr1.getDimensionality(), dim2=mbr2.getDimensionality();
final int mindim=(dim1 < dim2) ? dim1 : dim2;
double agg=0.;
for (int d=0; d < mindim; d++) {
double d1=mbr1.getMax(d) - mbr2.getMin(d);
double d2=mbr2.getMax(d) ... | Maximum distance of two objects. |
public IDialogSettings removeSection(String sectionName){
return sections.remove(sectionName);
}
| Remove a section by name in the receiver. If the given section does not exist, nothing is done. |
@NotNull public PsiQuery parents(@NotNull final Class<? extends PsiElement> clazz){
final List<PsiElement> result=new ArrayList<PsiElement>();
for ( final PsiElement element : myPsiElements) {
final PsiElement parent=PsiTreeUtil.getParentOfType(element,clazz);
if (parent != null) {
result.add(parent)... | Filter parents by name and class |
private final void prevToken(){
if (m_queueMark > 0) {
m_queueMark--;
m_token=(String)m_ops.m_tokenQueue.elementAt(m_queueMark);
m_tokenChar=m_token.charAt(0);
}
else {
m_token=null;
m_tokenChar=0;
}
}
| Retrieve the previous token from the command and store it in m_token string. |
public boolean isStateActive(State state){
switch (state) {
case goto_abstract:
return stateVector[0] == State.goto_abstract;
case goto_boolean:
return stateVector[0] == State.goto_boolean;
case goto_void:
return stateVector[0].ordinal() >= State.goto_void.ordinal() && stateVector[0].ordinal() <= State.goto_void_... | Returns true if the given state is currently active otherwise false. |
public Editor edit() throws IOException {
return DiskLruCache.this.edit(key,sequenceNumber);
}
| Returns an editor for this snapshot's entry, or null if either the entry has changed since this snapshot was created or if another edit is in progress. |
public void addEntry(Label start,Label end,Label handler,CP cat){
addEntry(new CatchEntry(start,end,handler,cat));
}
| add an entry to the catch table |
public AppletAudioClip(URL url){
this.url=url;
try {
InputStream in=url.openStream();
createAppletAudioClip(in);
}
catch ( IOException e) {
if (DEBUG) {
System.err.println("IOException creating AppletAudioClip" + e);
}
}
}
| Constructs an AppletAudioClip from an URL. |
private static int appendCaptureTypeSignature(char[] string,int start,boolean fullyQualifyTypeNames,StringBuffer buffer){
if (start >= string.length - 1) {
throw new IllegalArgumentException();
}
char c=string[start];
if (c != C_CAPTURE) {
throw new IllegalArgumentException();
}
buffer.append(CAPTUR... | Scans the given string for an capture type signature starting at the given index and appends it to the given buffer, and returns the index of the last character. |
public ConditionalTransferEntropyCalculatorGaussian() throws InstantiationException, IllegalAccessException, ClassNotFoundException {
super(COND_MI_CALCULATOR_GAUSSIAN);
}
| Creates a new instance of the Gaussian-estimate style conditional transfer entropy calculator |
public static JsonValue parse(String string){
if (string == null) {
throw new NullPointerException("string is null");
}
try {
return new JsonParser(string).parse();
}
catch ( IOException exception) {
throw new RuntimeException(exception);
}
}
| Parses the given input string as JSON. The input must contain a valid JSON value, optionally padded with whitespace. |
public ContainsCondition docValues(Boolean docValues){
this.docValues=docValues;
return this;
}
| Sets if the generated query should use doc values. Doc values queries are typically slower, but they can be faster in the dense case where most rows match the search. |
protected PacketWriter(XMPPConnection connection){
this.queue=new ArrayBlockingQueue<Packet>(500,true);
this.connection=connection;
init();
}
| Creates a new packet writer with the specified connection. |
@Override protected RemoteOperationResult run(OwnCloudClient client){
RemoteOperationResult result;
if (mTargetParentPath.startsWith(mSrcPath)) {
return new RemoteOperationResult(ResultCode.INVALID_COPY_INTO_DESCENDANT);
}
mFile=getStorageManager().getFileByPath(mSrcPath);
if (mFile == null) {
return ... | Performs the operation. |
protected boolean hasOutstandingChanges(){
return (fDocumentNo.hasChanged() || fDescription.hasChanged() || fPOReference.hasChanged()|| fIsSOTrx.hasChanged()|| fBPartner_ID.hasChanged()|| fShipper_ID.hasChanged()|| fDateFrom.hasChanged()|| fDateTo.hasChanged());
}
| Does the parameter panel have outstanding changes that have not been used in a query? |
public String customPropsFileTipText(){
return "The custom properties that the user can use to override the default ones.";
}
| The tip text for this property. |
public static boolean moveFile(Context context,@NonNull final File source,@NonNull final File targetDir){
File target=new File(targetDir,source.getName());
boolean success=source.renameTo(target);
if (!success) {
success=copyFile(context,source,targetDir);
if (success) {
success=deleteFile(context,s... | Move a file. The target file may even be on external SD card. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.