示例#1
0
InetAddress * InetAddressSet::removeElement(const InetAddress &key){
	long position=getPositionIndex(key);
	if(position==-1){
		return 0;
	}else{
		return removeElementAt(position);
	}
}
示例#2
0
UBool UVector::removeElement(void* obj) {
    int32_t i = indexOf(obj);
    if (i >= 0) {
        removeElementAt(i);
        return TRUE;
    }
    return FALSE;
}
示例#3
0
int32_t UStack::popi(void) {
    int32_t n = size() - 1;
    int32_t result = 0;
    if (n >= 0) {
        result = elementAti(n);
        removeElementAt(n);
    }
    return result;
}
示例#4
0
void* UStack::pop(void) {
    int32_t n = size() - 1;
    void* result = 0;
    if (n >= 0) {
        result = elementAt(n);
        removeElementAt(n);
    }
    return result;
}
示例#5
0
bool TMAVectorBase::removeElement(PMAObject obj,bool delobject)
{
    long index;
    if (findElement(obj,index))
    {
        return removeElementAt(index,delobject);
    }
    return false;
}
示例#6
0
	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);
	}
示例#7
0
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;
}
示例#8
0
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;
}
示例#9
0
/**
 * 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;
}
示例#10
0
	void Vector::removeLast(void)
	{
		removeElementAt(getCount() - 1);
	}
示例#11
0
void InetAddressSet::hardReleaseMemory(){
	while(size>0){
		delete removeElementAt(0);
	}
}
示例#12
0
void InetAddressSet::softReleaseMemory(){
	while(size>0){
		removeElementAt(0);
	}

}