Added a removeItem method to the Array Ruamoko class.

This commit is contained in:
Brian Koropoff 2003-05-14 21:11:23 +00:00
parent e2061095a6
commit cc3f98e99c
2 changed files with 14 additions and 0 deletions

View file

@ -15,6 +15,7 @@
- (void []) getItemAt: (integer) index;
- (void) setItemAt: (integer) index item:(void []) item;
- (void) addItem: (void []) item;
- (void) removeItem: (void []) item;
- (void []) removeItemAt: (integer) index;
- (void []) insertItemAt: (integer) index item:(void []) item;
- (integer) count;

View file

@ -53,6 +53,19 @@
array[count++] = item;
}
- (void) removeItem: (void []) item
{
local integer i, n;
for (i = 0; i < count; i++)
if (array[i] == item) {
count--;
for (n = i; n < count; n++)
array[n] = array[n + 1];
}
return;
}
- (void []) removeItemAt: (integer) index
{
local integer i;