/** * Processes an equals() request against the SCO's run-time data. * * @param iRequest The request (<code>DMRequest</code>) being processed. * @return A data model error code indicating the result of this operation. */ public int equals(DMRequest iRequest) { // Assume no processing errors int result = DMErrorCodes.NO_ERROR; // Make sure there is a request to process and some data model to // process it on if (iRequest != null && mDataModels != null) { RequestToken tok = iRequest.getNextToken(); // The first request token must be a data model token if (tok.getType() == RequestToken.TOKEN_DATA_MODEL) { DataModel dm = (DataModel) mDataModels.get(tok.getValue()); // Make sure the data model exists if (dm != null) { // Process this request result = dm.equals(iRequest); } else { // Specified data model element does not exist result = DMErrorCodes.UNDEFINED_ELEMENT; } } else { // No data model specified result = DMErrorCodes.INVALID_REQUEST; } } else { // Nothing to process or nothing to process on result = DMErrorCodes.UNKNOWN_EXCEPTION; } return result; }