-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
1.2.2
-
generic
-
generic
Name: sg39081 Date: 04/14/2000
java version "1.2.2"
Classic VM (build JDK-1.2.2-001, native threads, symcjit)
The JavaBeans specification described naming conventions for two
types of write methods for indexed properties:
void setProperty(int index, PropertyType value);
void setProperty(PropertyType values[]);
It's very common that indexed properties are used to hold values that
are added successively in JSP pages, for instance a property that
holds items in a shopping cart where new items are added in separate
requests. I therefore suggest adding a new type of setter method:
void addProperty(PropertyType value);
This method adds the new value at the next available index in
the property.
Methods to remove items of an indexed property would also be
nice, e.g.:
PropertyType removeProperty(PropertyType value);
Returns the first occurance of value in the indexed property
and removes it from the collection.
PropertyType removeProperty(int index);
Returns the specified indexed value and removes it from the
collection.
Removing a value like this would adjust the collection to fill
the hole left by the removed value.
(Review ID: 103682)
======================================================================
java version "1.2.2"
Classic VM (build JDK-1.2.2-001, native threads, symcjit)
The JavaBeans specification described naming conventions for two
types of write methods for indexed properties:
void setProperty(int index, PropertyType value);
void setProperty(PropertyType values[]);
It's very common that indexed properties are used to hold values that
are added successively in JSP pages, for instance a property that
holds items in a shopping cart where new items are added in separate
requests. I therefore suggest adding a new type of setter method:
void addProperty(PropertyType value);
This method adds the new value at the next available index in
the property.
Methods to remove items of an indexed property would also be
nice, e.g.:
PropertyType removeProperty(PropertyType value);
Returns the first occurance of value in the indexed property
and removes it from the collection.
PropertyType removeProperty(int index);
Returns the specified indexed value and removes it from the
collection.
Removing a value like this would adjust the collection to fill
the hole left by the removed value.
(Review ID: 103682)
======================================================================