code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static <T>T[] newSameSize(List<?> list,Class<T> cpType){
if (list == null) return create(cpType,0);
else return create(cpType,list.size());
}
| Creates an array with the same size as the given list. If the list is null, a zero-length array is created. |
public void addPaintListener(PaintListener pl){
if (m_painters == null) {
m_painters=new CopyOnWriteArrayList();
}
m_painters.add(pl);
}
| Add a PaintListener to this Display to receive notifications about paint events. |
@Override public boolean isNamed(){
return (flags & NO_NAME) == 0;
}
| Returns true if this method is anonymous. |
public CopyOnWriteMap(){
internalMap=new HashMap<K,V>();
}
| Creates a new instance of CopyOnWriteMap. |
public static void runTrialParallel(int size,TrialSuite set,IPoint[] pts,IPivotIndex selector,int numThreads,int ratio){
Integer[] ar=new Integer[size];
for (int i=0, idx=0; i < pts.length; i++) {
ar[idx++]=(int)(pts[i].getX() * BASE);
ar[idx++]=(int)(pts[i].getY() * BASE);
}
MultiThreadQuickSort<Intege... | Change the number of helper threads inside to try different configurations. <p> Set to NUM_THREADS by default. |
private void initResumableMediaRequest(GDataRequest request,MediaFileSource file,String title){
initMediaRequest(request,title);
request.setHeader(GDataProtocol.Header.X_UPLOAD_CONTENT_TYPE,file.getContentType());
request.setHeader(GDataProtocol.Header.X_UPLOAD_CONTENT_LENGTH,new Long(file.getContentLength()).toS... | Initialize a resumable media upload request. |
public static short[] toShortArray(Short[] array){
short[] result=new short[array.length];
for (int i=0; i < array.length; i++) {
result[i]=array[i];
}
return result;
}
| Coverts given shorts array to array of shorts. |
public static void createTable(SQLiteDatabase db,boolean ifNotExists){
String constraint=ifNotExists ? "IF NOT EXISTS " : "";
db.execSQL("CREATE TABLE " + constraint + "'SIMPLE_ADDRESS_ITEM' ("+ "'_id' INTEGER PRIMARY KEY ,"+ "'NAME' TEXT,"+ "'ADDRESS' TEXT,"+ "'CITY' TEXT,"+ "'STATE' TEXT,"+ "'PHONE' INTEGER);");
... | Creates the underlying database table. |
@Override public NotificationChain eInverseRemove(InternalEObject otherEnd,int featureID,NotificationChain msgs){
switch (featureID) {
case UmplePackage.ABSTRACT_METHOD_DECLARATION___METHOD_DECLARATOR_1:
return ((InternalEList<?>)getMethodDeclarator_1()).basicRemove(otherEnd,msgs);
}
return super.eInverseRemove(oth... | <!-- begin-user-doc --> <!-- end-user-doc --> |
protected void emit_N4SetterDeclaration_SemicolonKeyword_5_q(EObject semanticObject,ISynNavigable transition,List<INode> nodes){
acceptNodes(transition,nodes);
}
| Ambiguous syntax: ';'? This ambiguous syntax occurs at: body=Block (ambiguity) (rule end) fpar=FormalParameter ')' (ambiguity) (rule end) |
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 FitsDate(String dStr) throws FitsException {
if (dStr == null || dStr.isEmpty()) {
return;
}
Matcher match=FitsDate.NORMAL_REGEX.matcher(dStr);
if (match.matches()) {
this.year=getInt(match,FitsDate.NEW_FORMAT_YEAR_GROUP);
this.month=getInt(match,FitsDate.NEW_FORMAT_MONTH_GROUP);
this.mda... | Convert a FITS date string to a Java <CODE>Date</CODE> object. |
public static <T>T fromBytes(byte[] value,Class<T> clazz){
try {
Input input=new Input(new ByteArrayInputStream(value));
return clazz.cast(kryo.get().readClassAndObject(input));
}
catch ( Throwable t) {
LOG.error("Unable to deserialize because " + t.getMessage(),t);
throw t;
}
}
| Deserialize a profile measurement's value. The value produced by a Profile definition can be any numeric data type. The data type depends on how the profile is defined by the user. The user should be able to choose the data type that is most suitable for their use case. |
public SequencesWriter(SequenceDataSource source,File outputDir,long sizeLimit,PrereadType type,boolean compressed){
this(source,outputDir,sizeLimit,null,type,compressed,null);
}
| Creates a writer for processing sequences from provided data source. |
public HtmlPolicyBuilder allowStyling(){
allowStyling(CssSchema.DEFAULT);
return this;
}
| Convert <code>style="<CSS>"</code> to sanitized CSS which allows color, font-size, type-face, and other styling using the default schema; but which does not allow content to escape its clipping context. |
private PhoneUtil(){
throw new Error("Do not need instantiate!");
}
| Don't let anyone instantiate this class. |
@Override public void unregisterTap(Tap tap){
mTaps.remove(tap);
}
| Remove instrumentation tap |
public boolean isNavBarTintEnabled(){
return mNavBarTintEnabled;
}
| Is tinting enabled for the system navigation bar? |
@Override public boolean equals(Object other){
if (_map.equals(other)) {
return true;
}
else if (other instanceof Map) {
Map that=(Map)other;
if (that.size() != _map.size()) {
return false;
}
else {
Iterator it=that.entrySet().iterator();
for (int i=that.size(); i-- > 0; ) {
... | Compares this map with another map for equality of their stored entries. |
public boolean becomePrimary(boolean isRebalance){
initializationGate();
long startTime=getPartitionedRegionStats().startPrimaryTransfer(isRebalance);
try {
long waitTime=2000;
while (!isPrimary()) {
this.getAdvisee().getCancelCriterion().checkCancelInProgress(null);
boolean attemptToBecomePri... | Makes this <code>BucketAdvisor</code> become the primary if it is already a secondary. |
private void declareExtensions(){
new BlogCommentFeed().declareExtensions(extProfile);
new BlogFeed().declareExtensions(extProfile);
new BlogPostFeed().declareExtensions(extProfile);
new PostCommentFeed().declareExtensions(extProfile);
}
| Declare the extensions of the feeds for the Blogger service. |
@Override public boolean eIsSet(int featureID){
switch (featureID) {
case UmplePackage.ANONYMOUS_GEN_EXPR_2__INDEX_1:
return INDEX_1_EDEFAULT == null ? index_1 != null : !INDEX_1_EDEFAULT.equals(index_1);
}
return super.eIsSet(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public ReferenceSequence sequence(final String name){
return mReferences.get(name);
}
| Get the <code>ReferenceSequence</code> selected by name. |
private ChainBuilder(JFrame frame){
super(new BorderLayout());
this.frame=frame;
THIS=this;
JPanel customPanel=createCustomizationPanel();
JPanel presetPanel=createPresetPanel();
label=new JLabel("Click the \"Begin Generating\" button" + " to begin generating phrases",JLabel.CENTER);
Border padding=Border... | Creates the GUI shown inside the frame's content pane. |
public String toString(){
return this.materialPackageBO.toString();
}
| A method that returns a string representation of a parsed MaterialPackage object |
protected VirtualBaseTypeImpl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private void removeParserNotices(Parser parser){
if (noticesToHighlights != null) {
RSyntaxTextAreaHighlighter h=(RSyntaxTextAreaHighlighter)textArea.getHighlighter();
for (Iterator i=noticesToHighlights.entrySet().iterator(); i.hasNext(); ) {
Map.Entry entry=(Map.Entry)i.next();
ParserNotice noti... | Removes all parser notices (and clears highlights in the editor) from a particular parser. |
public TextLineDecoder(Charset charset,String delimiter){
this(charset,new LineDelimiter(delimiter));
}
| Creates a new instance with the spcified <tt>charset</tt> and the specified <tt>delimiter</tt>. |
@Override public void resetViewableArea(){
throw new RuntimeException("resetViewableArea called in PdfDecoderFx");
}
| NOT PART OF API turns off the viewable area, scaling the page back to original scaling |
private void postResults(){
this.reportTestCase.host.updateSystemInfo(false);
this.trState.systemInfo=this.reportTestCase.host.getSystemInfo();
Operation factoryPost=Operation.createPost(this.remoteTestResultService).setReferer(this.reportTestCase.host.getReferer()).setBody(this.trState).setCompletion(null);
th... | Send current test state to a remote server, by creating an instance for this particular run. |
static void clear(Iterator<?> iterator){
checkNotNull(iterator);
while (iterator.hasNext()) {
iterator.next();
iterator.remove();
}
}
| Clears the iterator using its remove method. |
@Override public boolean isTop(BitSet fact){
return fact.get(topBit);
}
| Return whether or not given fact is the special TOP value. |
public void eraseMap(){
if (MAP_STORE.getMap(MAP_STORE.getSelectedMapName()) == null) {
return;
}
for ( Route r : MAP_STORE.getMap(MAP_STORE.getSelectedMapName()).getRoutes()) {
eraseRoute(r);
}
}
| Non-destructively erases all displayed content from the map display |
public void doTestTransfer(int size){
Thread.setDefaultUncaughtExceptionHandler(this);
long start, elapsed;
int received;
sendData=createDummyData(size);
sendStreamSize=size;
recvStream=new ByteArrayOutputStream(size);
start=PseudoTCPBase.now();
startClocks();
try {
connect();
}
catch ( IOExce... | Transfers the data of <tt>size</tt> bytes |
protected void sequence_SkillFakeDefinition(ISerializationContext context,SkillFakeDefinition semanticObject){
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject,GamlPackage.Literals.GAML_DEFINITION__NAME) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatu... | Contexts: GamlDefinition returns SkillFakeDefinition SkillFakeDefinition returns SkillFakeDefinition Constraint: name=ID |
public void closeDriver(){
if (camera != null) {
FlashlightManager.disableFlashlight();
camera.release();
camera=null;
}
}
| Closes the camera driver if still in use. |
public void removeSecurityManager(Password password,String id) throws PageException {
checkWriteAccess();
((ConfigServerImpl)ConfigImpl.getConfigServer(config,password)).removeSecurityManager(id);
Element security=_getRootElement("security");
Element[] children=XMLConfigWebFactory.getChildren(security,"accessor... | remove security manager matching given id |
public static void circle(double x,double y,double r){
if (r < 0) throw new IllegalArgumentException("circle radius must be nonnegative");
double xs=scaleX(x);
double ys=scaleY(y);
double ws=factorX(2 * r);
double hs=factorY(2 * r);
if (ws <= 1 && hs <= 1) pixel(x,y);
else offscreen.draw(new Ellipse2... | Draw a circle of radius r, centered on (x, y). |
@Override public void run(){
amIActive=true;
String inputFile=args[0];
if (inputFile.toLowerCase().contains(".dep")) {
calculateRaster();
}
else if (inputFile.toLowerCase().contains(".shp")) {
calculateVector();
}
else {
showFeedback("There was a problem reading the input file.");
}
}
| Used to execute this plugin tool. |
@SuppressWarnings({"unchecked","rawtypes"}) private static <T>T create(Class<T> cls,QName qname){
return (T)Configuration.getBuilderFactory().getBuilder(qname).buildObject(qname);
}
| Create object using OpenSAML's builder system. |
public HttpConnection createHttpConnection(){
return new AndroidHttpConnection();
}
| Create an HTTP connection |
@SuppressWarnings("unchecked") private Map<Integer,float[]> parseWaveformsFromJsonFile(File waveformsFile){
Map<Integer,float[]> waveformsMap;
try {
waveformsMap=(Map<Integer,float[]>)parseJsonFile(waveformsFile);
LOG.info("Loaded waveform images from {}",waveformsFile);
}
catch ( IOException exception)... | Loads the waveforms from a saved file formatted in JSON |
public static final void drawShape(GL2 gl,Shape s,boolean points){
if (s instanceof Circle) {
RenderUtilities.drawCircle(gl,(Circle)s,points,true);
}
else if (s instanceof Rectangle) {
RenderUtilities.drawRectangle(gl,(Rectangle)s,points);
}
else if (s instanceof Polygon) {
RenderUtilities.drawP... | Draws the given shape. |
public void write(Writer writer) throws IOException {
Map<String,Object> map=new HashMap<String,Object>();
map.put("vcards",vcards);
map.put("utils",new TemplateUtils());
map.put("translucentBg",readImage("translucent-bg.png",ImageType.PNG));
map.put("noProfile",readImage("no-profile.png",ImageType.PNG));
m... | Writes the HTML document to a writer. |
@Override public String toString(String field){
StringBuilder buffer=new StringBuilder();
if (!getField().equals(field)) {
buffer.append(getField());
buffer.append(":");
}
buffer.append(includeLower ? '[' : '{');
buffer.append(lowerTerm != null ? ("*".equals(Term.toString(lowerTerm)) ? "\\*" : Term.to... | Prints a user-readable version of this query. |
public void prepare(PluginContext context) throws ReplicatorException, InterruptedException {
logger.info("Import tables from " + this.uri.getPath() + " to the "+ this.getDefaultSchema()+ " schema");
tableNames=new ArrayList<String>();
columnDefinitions=new HashMap<String,ArrayList<ColumnSpec>>();
parser=new CS... | Prepare plug-in for use. This method is assumed to allocate all required resources. It is called before the plug-in performs any operations. |
public void plot(AbstractDrawer draw){
if (!visible) return;
draw.setColor(color);
draw.setFont(font);
draw.setBaseOffset(base_offset);
draw.setTextOffset(cornerE,cornerN);
draw.setTextAngle(angle);
draw.drawText(label,coord);
draw.setBaseOffset(null);
}
| see Text for formatted text output |
public void testShiftRight4(){
byte aBytes[]={1,-128,56,100,-2,-76,89,45,91,3,-15,35,26};
int aSign=1;
int number=45;
byte rBytes[]={12,1,-61,39,-11,-94,-55};
BigInteger aNumber=new BigInteger(aSign,aBytes);
BigInteger result=aNumber.shiftRight(number);
byte resBytes[]=new byte[rBytes.length];
resBytes=... | shiftRight(int n), n > 32 |
public void fixStatsError(int sendCommand){
for (; this.affectedRows.length < sendCommand; ) {
this.affectedRows[currentStat++]=Statement.EXECUTE_FAILED;
}
}
| Add missing information when Exception is thrown. |
public byte[] readRawBytes(final int size) throws IOException {
if (size < 0) {
throw InvalidProtocolBufferNanoException.negativeSize();
}
if (bufferPos + size > currentLimit) {
skipRawBytes(currentLimit - bufferPos);
throw InvalidProtocolBufferNanoException.truncatedMessage();
}
if (size <= buffe... | Read a fixed size of bytes from the input. |
private void resetToXMLSAXHandler(){
this.m_escapeSetting=true;
}
| Reset all of the fields owned by ToXMLSAXHandler class |
public static cuComplex cuCmplx(float r,float i){
cuComplex res=new cuComplex();
res.x=r;
res.y=i;
return res;
}
| Creates a new complex number consisting of the given real and imaginary part. |
public static MethodRepository make(String rawSig,GenericsFactory f){
return new MethodRepository(rawSig,f);
}
| Static factory method. |
public void add(final T object){
mObjects.add(object);
notifyItemInserted(getItemCount() - 1);
}
| Adds the specified object at the end of the array. |
public static String compareHardware(Map<String,String> hwMap,boolean checkDisk){
String localMemSizeStr=ServerProbe.getInstance().getMemorySize();
String localCpuCoreStr=ServerProbe.getInstance().getCpuCoreNum();
hwMap.get(PropertyConstants.PROPERTY_KEY_DISK_CAPACITY);
if (!localMemSizeStr.equals(hwMap.get(Pro... | Check local node hardware (i.e. Memory size, CPU core, Disk Capacity) are the same as in the input map. |
public static void tearDown(SWTWorkbenchBot bot){
SwtBotUtils.print("Tear Down");
bot.resetWorkbench();
SwtBotUtils.print("Tear Down Done");
}
| Performs the necessary tear down work for most SWTBot tests. |
private void handleMessage(byte[] data){
Buffer buffer=new Buffer();
buffer.write(data);
int type=(buffer.readShort() & 0xffff) & ~(APP_MSG_RESPONSE_BIT);
if (type == BeanMessageID.SERIAL_DATA.getRawValue()) {
beanListener.onSerialMessageReceived(buffer.readByteArray());
}
else if (type == BeanMessageI... | Handles incoming messages from the Bean and dispatches them to the proper handlers. |
public static <K,V>HashMap<K,V> newEmptyHashMap(Iterable<?> iterable){
if (iterable instanceof Collection<?>) return Maps.newHashMapWithExpectedSize(((Collection<?>)iterable).size());
return Maps.newHashMap();
}
| Returns an empty map with expected size matching the iterable size if it's of type Collection. Otherwise, an empty map with the default size is returned. |
public int calculateScrollY(int firstVisiblePosition,int visibleItemCount){
mFirstVisiblePosition=firstVisiblePosition;
if (mReferencePosition < 0) {
mReferencePosition=mFirstVisiblePosition;
}
if (visibleItemCount > 0) {
View c=mListView.getListChildAt(0);
int scrollY=-c.getTop();
mListViewItem... | Call from an AbsListView.OnScrollListener to calculate the scrollY (Here we definite as the distance in pixels compared to the position representing the current date). |
public DynamicRegionFactoryImpl(){
}
| create an instance of the factory. This is normally only done by DynamicRegionFactory's static initialization |
public DViewAsymmetricKeyFields(JDialog parent,String title,DSAPublicKey dsaPublicKey){
super(parent,title,Dialog.ModalityType.DOCUMENT_MODAL);
key=dsaPublicKey;
initFields();
}
| Creates new DViewAsymmetricKeyFields dialog. |
public void removeAllActions(CCNode target){
if (target == null) return;
HashElement element=targets.get(target);
if (element != null) {
deleteHashElement(element);
}
else {
}
}
| Removes all actions from a certain target. All the actions that belongs to the target will be removed. |
private static String normalizeName(String name){
name=(name == null) ? "" : name.trim();
return name.isEmpty() ? MISSING_NAME : name;
}
| Normalizes a name to something OpenMRS will accept. |
@Override public Object build(QueryNode queryNode) throws QueryNodeException {
process(queryNode);
return queryNode.getTag(QUERY_TREE_BUILDER_TAGID);
}
| Builds some kind of object from a query tree. Each node in the query tree is built using an specific builder associated to it. |
public boolean isEnableLighting(){
return false;
}
| Returns false. |
protected void prepare(){
ProcessInfoParameter[] para=getParameter();
for (int i=0; i < para.length; i++) {
String name=para[i].getParameterName();
if (para[i].getParameter() == null) ;
else log.log(Level.SEVERE,"prepare - Unknown Parameter: " + name);
}
}
| Prepare - e.g., get Parameters. |
public void fling(int velocityX,int velocityY){
if (getChildCount() > 0) {
int height=getHeight() - getPaddingBottom() - getPaddingTop();
int bottom=getChildAt(0).getHeight();
int width=getWidth() - getPaddingRight() - getPaddingLeft();
int right=getChildAt(0).getWidth();
mScroller.fling(getScroll... | Fling the scroll view |
protected Socket createSocket(){
return new Socket();
}
| Creates a new unconnected Socket instance. Subclasses may use this method to override the default socket implementation. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:36:21.616 -0500",hash_original_method="F5BF0DDF083843E14FDE0C117BAE250E",hash_generated_method="E1C3BB6772CE07721D8608A1E4D81EE1") public static int netmaskIntToPrefixLength(int netmask){
return Integer.bitCount(netmask);
}
| Convert a IPv4 netmask integer to a prefix length |
public WritableRaster createWritableChild(int x,int y,int width,int height,int x0,int y0,int[] bandList){
if (x < this.minX) {
throw new RasterFormatException("x lies outside the raster");
}
if (y < this.minY) {
throw new RasterFormatException("y lies outside the raster");
}
if ((x + width < x) || (x ... | Creates a Writable subRaster given a region of the Raster. The x and y coordinates specify the horizontal and vertical offsets from the upper-left corner of this Raster to the upper-left corner of the subRaster. A subset of the bands of the parent Raster may be specified. If this is null, then all the bands are prese... |
private boolean isBlockCommented(int startLine,int endLine,String[] prefixes,IDocument document){
try {
for (int i=startLine; i <= endLine; i++) {
IRegion line=document.getLineInformation(i);
String text=document.get(line.getOffset(),line.getLength());
int[] found=TextUtilities.indexOf(prefixes,... | Determines whether each line is prefixed by one of the prefixes. |
@Override public void eUnset(int featureID){
switch (featureID) {
case GamlPackage.PARAMETERS__PARAMS:
setParams((ExpressionList)null);
return;
}
super.eUnset(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static void main(String[] args){
String matrixFilename=null;
String coordinateFilename=null;
String externalZonesFilename=null;
String networkFilename=null;
String plansFilename=null;
Double populationFraction=null;
if (args.length != 6) {
throw new IllegalArgumentException("Wrong number of arg... | Class to generate plans files from the Saturn OD-matrices provided by Sanral's modelling consultant, Alan Robinson. |
private int partition(int[] a,int left,int right){
int pivot=a[left + (right - left) / 2];
while (left <= right) {
while (a[left] > pivot) left++;
while (a[right] < pivot) right--;
if (left <= right) {
int temp=a[left];
a[left]=a[right];
a[right]=temp;
left++;
right... | Choose mid value as pivot Move two pointers Swap and move on Return left pointer |
public boolean isDone(){
return one.getHand().empty() || two.getHand().empty();
}
| Returns true if either hand is empty. |
public ClassNotFoundException(@Nullable String s,@Nullable Throwable ex){
super(s,null);
this.ex=ex;
}
| Constructs a <code>ClassNotFoundException</code> with the specified detail message and optional exception that was raised while loading the class. |
@Override public boolean eIsSet(int featureID){
switch (featureID) {
case BasePackage.DOCUMENTED_ELEMENT__DOCUMENTATION:
return DOCUMENTATION_EDEFAULT == null ? documentation != null : !DOCUMENTATION_EDEFAULT.equals(documentation);
}
return super.eIsSet(featureID);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
@Override public void drawRangeLine(Graphics2D g2,CategoryPlot plot,ValueAxis axis,Rectangle2D dataArea,double value,Paint paint,Stroke stroke){
Range range=axis.getRange();
if (!range.contains(value)) {
return;
}
Rectangle2D adjusted=new Rectangle2D.Double(dataArea.getX(),dataArea.getY() + getYOffset(),dat... | Draws a line perpendicular to the range axis. |
void startFading(){
mHandler.removeMessages(MSG_FADE);
scheduleFade();
}
| Start up the pulse to fade the screen, clearing any existing pulse to ensure that we don't have multiple pulses running at a time. |
protected Connection createConnection() throws Exception {
ActiveMQConnectionFactory factory=new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
return factory.createConnection();
}
| Creates a connection. |
protected void drawView(Graphics2D g,Rectangle r,View view,int fontHeight,int y){
float x=r.x;
LayeredHighlighter h=(LayeredHighlighter)host.getHighlighter();
RSyntaxDocument document=(RSyntaxDocument)getDocument();
Element map=getElement();
int p0=view.getStartOffset();
int lineNumber=map.getElementIndex(p... | Draws a single view (i.e., a line of text for a wrapped view), wrapping the text onto multiple lines if necessary. |
@Override public boolean containsKey(Object key){
if (key == null) {
key=NULL_OBJECT;
}
int index=findIndex(key,elementData);
return elementData[index] == key;
}
| Returns whether this map contains the specified key. |
public boolean autoCorrectText(){
return preferences.getBoolean(resources.getString(R.string.key_autocorrect_text),Boolean.parseBoolean(resources.getString(R.string.default_autocorrect_text)));
}
| Whether message text should be autocorrected. |
protected void removeNode(int id) throws Exception {
int idx;
FolderTokenDocTreeNode node=null;
idx=findIndexById(id);
if (idx == -1) {
throw new IeciTdException(FolderBaseError.EC_NOT_FOUND,FolderBaseError.EM_NOT_FOUND);
}
node=(FolderTokenDocTreeNode)m_nodes.get(idx);
if (node.isNew()) m_nodes.rem... | Elimina de la lista de nodos el nodo con el id especificado |
public void deleteAttributes(int[] columnIndices){
((ArffTableModel)getModel()).deleteAttributes(columnIndices);
}
| deletes the attributes at the given indices |
public void onSuccess(int statusCode,Header[] headers,JSONObject response){
Log.w(LOG_TAG,"onSuccess(int, Header[], JSONObject) was not overriden, but callback was received");
}
| Returns when request succeeds |
public int lastIndexOfFromTo(byte element,int from,int to){
if (size == 0) return -1;
checkRangeFromTo(from,to,size);
byte[] theElements=elements;
for (int i=to; i >= from; i--) {
if (element == theElements[i]) {
return i;
}
}
return -1;
}
| Returns the index of the last occurrence of the specified element. Returns <code>-1</code> if the receiver does not contain this element. Searches beginning at <code>to</code>, inclusive until <code>from</code>, inclusive. Tests for identity. |
public void put(final long key){
if (key == FREE_KEY) {
m_hasFreeKey=true;
return;
}
int ptr=(int)((Tools.phiMix(key) & m_mask));
long e=m_data[ptr];
if (e == FREE_KEY) {
m_data[ptr]=key;
if (m_size >= m_threshold) {
rehash(m_data.length * 2);
}
else {
++m_size;
}
retu... | Add a single element to the map |
public PredictiveInfoCalculatorKraskov(String calculatorName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
super(calculatorName);
if (!calculatorName.equalsIgnoreCase(MI_CALCULATOR_KRASKOV1) && !calculatorName.equalsIgnoreCase(MI_CALCULATOR_KRASKOV2)) {
throw new ClassNotFound... | Creates a new instance of the Kraskov-Stoegbauer-Grassberger estimator for PI, with the supplied MI calculator name. |
public DefaultDirectAdjacentSelector(short type,Selector parent,SimpleSelector simple){
super(type,parent,simple);
}
| Creates a new DefaultDirectAdjacentSelector object. |
@Inline public void postCopy(ObjectReference object,boolean majorGC){
initializeHeader(object,false);
if (!HEADER_MARK_BITS) {
testAndSetLiveBit(object);
}
}
| Perform any required post copy (i.e. in-GC allocation) initialization. This is relevant (for example) when MS is used as the mature space in a copying GC. |
public static LinkedHashMap<Pattern,String> parseRulesFile(InputStream is){
LinkedHashMap<Pattern,String> rules=new LinkedHashMap<>();
BufferedReader br=new BufferedReader(IOUtils.getDecodingReader(is,StandardCharsets.UTF_8));
String line;
try {
int linenum=0;
while ((line=br.readLine()) != null) {
... | Parses rule file from stream and returns a Map of all rules found |
public boolean isItemForce(){
return true;
}
| Returns true. |
public Builder document(InputStream document,String mediaType){
documentInputStream=document;
this.mediaType=mediaType;
return this;
}
| Sets the document as an input stream and its media type. |
public final String toString(){
StringBuffer text=new StringBuffer();
text.append("Print statistic values of instances (" + first + "-"+ last+ "\n");
text.append(" Number of instances:\t" + numInstances + "\n");
text.append(" NUmber of instances with unknowns:\t" + missingInstances + "\n");
text.append(... | Converts the stats to a string |
private void scanAndLock(Object key,int hash){
HashEntry<K,V> first=entryForHash(this,hash);
HashEntry<K,V> e=first;
int retries=-1;
while (!tryLock()) {
HashEntry<K,V> f;
if (retries < 0) {
if (e == null || key.equals(e.key)) retries=0;
else e=e.next;
}
else if (++retries > ... | Scans for a node containing the given key while trying to acquire lock for a remove or replace operation. Upon return, guarantees that lock is held. Note that we must lock even if the key is not found, to ensure sequential consistency of updates. |
public IntentBuilder oldColor(int oldColor){
mOldColor=oldColor;
return this;
}
| Sets the old color to show on the bottom "Cancel" half circle, and also the initial value for the picked color. The default value is black. |
public void __setDaoSession(DaoSession daoSession){
this.daoSession=daoSession;
myDao=daoSession != null ? daoSession.getUserDBDao() : null;
}
| called by internal mechanisms, do not call yourself. |
@Override public boolean equals(Object obj){
if (obj == this) {
return true;
}
if (!(obj instanceof TimeTableXYDataset)) {
return false;
}
TimeTableXYDataset that=(TimeTableXYDataset)obj;
if (this.domainIsPointsInTime != that.domainIsPointsInTime) {
return false;
}
if (this.xPosition != that... | Tests this dataset for equality with an arbitrary object. |
private void startContext(CrawlJob crawlJob){
LOGGER.debug("Starting context");
PathSharingContext ac=crawlJob.getJobContext();
ac.addApplicationListener(this);
try {
ac.start();
}
catch ( BeansException be) {
LOGGER.warn(be.getMessage());
ac.close();
}
catch ( Exception e) {
LOGGER.warn(... | Start the context, catching and reporting any BeansExceptions. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.