InetAddress * InetAddressSet::removeElement(const InetAddress &key){ long position=getPositionIndex(key); if(position==-1){ return 0; }else{ return removeElementAt(position); } }
UBool UVector::removeElement(void* obj) { int32_t i = indexOf(obj); if (i >= 0) { removeElementAt(i); return TRUE; } return FALSE; }
int32_t UStack::popi(void) { int32_t n = size() - 1; int32_t result = 0; if (n >= 0) { result = elementAti(n); removeElementAt(n); } return result; }
void* UStack::pop(void) { int32_t n = size() - 1; void* result = 0; if (n >= 0) { result = elementAt(n); removeElementAt(n); } return result; }
bool TMAVectorBase::removeElement(PMAObject obj,bool delobject) { long index; if (findElement(obj,index)) { return removeElementAt(index,delobject); } return false; }
int32 Vector::removeElement(char* element, uint32 sz, Comparator* c) { uint32 index = 0; int32 ret = scan(element, sz, &index, c); if (ret == FAILURE) return FAILURE; return removeElementAt(index); }
UBool UVector::retainAll(const UVector& other) { UBool changed = FALSE; for (int32_t j=size()-1; j>=0; --j) { int32_t i = other.indexOf(elements[j]); if (i < 0) { removeElementAt(j); changed = TRUE; } } return changed; }
UBool UVector::removeAll(const UVector& other) { UBool changed = FALSE; for (int32_t i=0; i<other.size(); ++i) { int32_t j = indexOf(other.elements[i]); if (j >= 0) { removeElementAt(j); changed = TRUE; } } return changed; }
/** * Change the size of this vector as follows: If newSize is smaller, * then truncate the array, possibly deleting held elements for i >= * newSize. If newSize is larger, grow the array, filling in new * slots with NULL. */ void UVector::setSize(int32_t newSize, UErrorCode &status) { int32_t i; if (newSize < 0) { return; } if (newSize > count) { if (!ensureCapacity(newSize, status)) { return; } UElement empty; empty.pointer = NULL; empty.integer = 0; for (i=count; i<newSize; ++i) { elements[i] = empty; } } else { /* Most efficient to count down */ for (i=count-1; i>=newSize; --i) { removeElementAt(i); } } count = newSize; }
void Vector::removeLast(void) { removeElementAt(getCount() - 1); }
void InetAddressSet::hardReleaseMemory(){ while(size>0){ delete removeElementAt(0); } }
void InetAddressSet::softReleaseMemory(){ while(size>0){ removeElementAt(0); } }