* Mark path.contains() and HopObject.contains() as deprecated,

and replace them with indexOf() methods.
This commit is contained in:
hns 2007-05-02 13:44:44 +00:00
parent 1dcdb8e452
commit b097d65d52
2 changed files with 27 additions and 4 deletions

View file

@ -135,12 +135,25 @@ public class RequestPath {
}
/**
* Checks if the given object is contained in the request path
* Checks if the given object is contained in the request path.
* Itreturns the zero-based index position, or -1 if it isn't contained.
*
* @param obj the element to check
* @return the index of the element, or -1 if it isn't contained
* @deprecated use {@link #indexOf(Object)} instead.
*/
public int contains(Object obj) {
return objects.indexOf(obj);
}
/**
* Checks if the given object is contained in the request path.
* Itreturns the zero-based index position, or -1 if it isn't contained.
*
* @param obj the element to check
* @return the index of the element, or -1 if it isn't contained
*/
public int contains(Object obj) {
public int indexOf(Object obj) {
return objects.indexOf(obj);
}

View file

@ -651,9 +651,10 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
}
/**
* Check if node is contained in subnodes
* Check if node is contained in the subnode collection.
* Return its index position if it is, and -1 otherwise.
*/
public int jsFunction_contains(Object obj) {
public int jsFunction_indexOf(Object obj) {
checkNode();
@ -666,6 +667,15 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
return -1;
}
/**
* Check if node is contained in the subnode collection.
* Return its index position if it is, and -1 otherwise.
* @deprecated use indexOf(Object) instead.
*/
public int jsFunction_contains(Object obj) {
return jsFunction_indexOf(obj);
}
/**
* Set a property in this HopObject
*