Source: BKGWebMap/Protocol.js

/*
 * Copyright (c) 2013 Bundesamt by Kartographie und Geodäsie.
 * See license.txt in the BKG WebMap distribution or repository for the
 * full text of the license.
 *
 * Author: Dirk Thalheim
 */

/**
 * @namespace BKGWebMap.Protocol
 */
BKGWebMap.Protocol = BKGWebMap.Protocol || {};


/**
 * @classdesc Objekt für Requests an die Ortsuche
 *
 * @param {object} options - Werte für das Objekt
 **/
BKGWebMap.Protocol.Response = OpenLayers.Class({
  /**
   * OpenLayers.Protocol.Response.SUCCESS oder OpenLayers.Protocol.Response.FAILURE
   * @memberOf BKGWebMap.Protocol.Geokodierung.Response
   * @type string
   */
  code: null,

  /**
   * Requesttyp für diese Response:
   *      "geocode" oder "suggest".
   * @memberOf BKGWebMap.Protocol.Geokodierung.Response
   * @type string
   */
  requestType: null,

  /**
   * Die Features aus der Serverantwort.
   * @memberOf BKGWebMap.Protocol.Geokodierung.Response
   * @type Array
   */
  features: [],

  /**
   * Alternativvorschläge des Servers
   * @memberOf BKGWebMap.Protocol.Geokodierung.Response
   * @type Array
   */
  suggestions: [],

  /**
   * Originalanfrage an Server
   * @memberOf BKGWebMap.Protocol.Geokodierung.Response
   */
  data: null,

  /**
   * Request-Objekt
   * @memberOf BKGWebMap.Protocol.Geokodierung.Response
   * @type {XMLHttpRequest}
   */
  request: null,

  initialize: function(options) {
    OpenLayers.Util.extend(this, options);
  },

  /**
   * @memberOf BKGWebMap.Protocol.Geokodierung.Response
   * @return {Boolean} - <code>true</code> on success, <code>false</code> otherwise
   */
  success: function() {
    return this.code > 0;
  },

  CLASS_NAME: "BKGWebMap.Protocol.Geokodierung.Response"
});