<?xml version="1.0" encoding="UTF-8"?>
<!--
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - JASMINe
  - Copyright (C) 2012 Bull S.A.S.
  - Contact: jasmine@ow2.org
  -
  - This library is free software; you can redistribute it and/or
  - modify it under the terms of the GNU Lesser General Public
  - License as published by the Free Software Foundation; either
  - version 2.1 of the License, or any later version.
  -
  - This library is distributed in the hope that it will be useful,
  - but WITHOUT ANY WARRANTY; without even the implied warranty of
  - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  - Lesser General Public License for more details.
  -
  - You should have received a copy of the GNU Lesser General Public
  - License along with this library; if not, write to the Free Software
  - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  - USA
  -
  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - $Id$
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<sect1 version="5.0" xml:lang="en" xml:id="jasmineprobe.values.api" xmlns="http://docbook.org/ns/docbook"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  xmlns:svg="http://www.w3.org/2000/svg"
  xmlns:mml="http://www.w3.org/1998/Math/MathML"
  xmlns:html="http://www.w3.org/1999/xhtml"
  xmlns:db="http://docbook.org/ns/docbook">

  <title>Interfaces for indicator values</title>

<sect2>
  <title>JasmineIndicatorValue</title>
  <para>
    <screen>
    public class JasmineIndicatorValue implements Serializable {

      /**
       * Indicator Name.
       */
      private String name;

      /**
       * Target name
       */
      private String target;

      /**
       * Additional Metadata, depending on the indicator type.
       */
      private Map metadata;

      /**
       * Collection of results
       * We have a Collection because indicators may have complex values.
       */
      private Collection&lt;JasmineSingleResult&gt; values;

    }
    </screen>
  </para>
</sect2>

<sect2>
  <title>JasmineSingleResult</title>
  <para>
    <screen>
    public abstract class JasmineSingleResult implements Serializable {

      /**
       * Result Name.
       */
      private String name;

      /**
       * Timestamp of the measure in millis
       */
      private long timestamp;

       /**
       * List of properties associated to this value.
       * Their name depend on the Collector type.
       */
      private Map properties;

      public abstract Object getValue();

      public abstract void setValue(Object value);
    }
    </screen>
  </para>
  <para>
     Several sub-classes are provided corresponding to the supported result types: <emphasis>JasmineSingleNumberResult</emphasis>,
     <emphasis>JasmineSingleStringResult, <emphasis>JasmineSingleBooleanResult</emphasis></emphasis> and <emphasis>JasmineSingleObjectNameResult</emphasis>.
  </para>
  <para>
    <screen>
    public class JasmineSingleNumberResult extends JasmineSingleResult {
    /**
     * Numeric value of this result
     *
     * The abstract class <code>Number</code> is the superclass of classes
     * <code>BigDecimal</code>, <code>BigInteger</code>,
     * <code>Byte</code>, <code>Double</code>, <code>Float</code>,
     * <code>Integer</code>, <code>Long</code>, and <code>Short</code>.
     */
      private Number value;

      public Number getValue() {
        return value;
      }

      public void setValue(Object value) {
        this.value = (Number) value;
      }
    }
    </screen>
  </para>
</sect2>

</sect1>
