<commit_before>// Copyright 2017, University of Colorado Boulder

/**
 * PhET-iO wrapper type for phet's NumberProperty type.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PhET Interactive Simulations)
 */
define( function( require ) {
  'use strict';

  // modules
  var axon = require( 'AXON/axon' );
  var TProperty = require( 'AXON/TProperty' );

  // phet-io modules
  var assertInstanceOf = require( 'ifphetio!PHET_IO/assertions/assertInstanceOf' );
  var phetioInherit = require( 'ifphetio!PHET_IO/phetioInherit' );
  var TNumber = require( 'ifphetio!PHET_IO/types/TNumber' );

  // constants
  var VALUE_TYPE = TNumber; // It's a NumberProperty.
  var TPropertyImpl = TProperty( VALUE_TYPE );

  /**
   * NumberProperty wrapper type.
   * @constructor
   */
  function TNumberProperty( property, phetioID ) {
    assertInstanceOf( property, phet.axon.NumberProperty );
    TPropertyImpl.call( this, property, phetioID );
  }

  axon.register( 'TNumberProperty', TNumberProperty );

  phetioInherit( TPropertyImpl, 'TNumberProperty', TNumberProperty, {}, {

    getAPI: function() {
      return {
        valueType: phet.phetIo.phetio.getAPIForType( VALUE_TYPE )
      };
    },

    /**
     * Decodes a state into a NumberProperty.
     * @param {Object} stateObject
     * @returns {Object}
     */
    fromStateObject: function( stateObject ) {
      var fromParentStateObject = TPropertyImpl.fromStateObject( stateObject );
      fromParentStateObject.valueType = stateObject.valueType;
      fromParentStateObject.units = stateObject.units;
      fromParentStateObject.range = stateObject.range;
      fromParentStateObject.validValues = stateObject.validValues;
      return fromParentStateObject;
    },

    /**
     * Encodes a NumberProperty instance to a state.
     * @param {Object} instance
     * @returns {Object} - a state object
     */
    toStateObject: function( instance ) {
      assert && assert( instance, 'instance should be defined' );

      var parentStateObject = TPropertyImpl.toStateObject( instance );
      parentStateObject.valueType = instance.valueType;
      parentStateObject.units = instance.units;
      parentStateObject.range = instance.range;
      parentStateObject.validValues = instance.validValues;
      return parentStateObject;
    },

    documentation: 'Numeric property model'
  } );

  return TNumberProperty;
} );

<commit_msg>Removed blank lines<commit_after>// Copyright 2017, University of Colorado Boulder

/**
 * PhET-iO wrapper type for phet's NumberProperty type.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PhET Interactive Simulations)
 */
define( function( require ) {
  'use strict';

  // modules
  var axon = require( 'AXON/axon' );
  var TProperty = require( 'AXON/TProperty' );

  // phet-io modules
  var assertInstanceOf = require( 'ifphetio!PHET_IO/assertions/assertInstanceOf' );
  var phetioInherit = require( 'ifphetio!PHET_IO/phetioInherit' );
  var TNumber = require( 'ifphetio!PHET_IO/types/TNumber' );

  // constants
  var VALUE_TYPE = TNumber; // It's a NumberProperty.
  var TPropertyImpl = TProperty( VALUE_TYPE );

  /**
   * NumberProperty wrapper type.
   * @constructor
   */
  function TNumberProperty( property, phetioID ) {
    assertInstanceOf( property, phet.axon.NumberProperty );
    TPropertyImpl.call( this, property, phetioID );
  }

  axon.register( 'TNumberProperty', TNumberProperty );

  phetioInherit( TPropertyImpl, 'TNumberProperty', TNumberProperty, {}, {

    getAPI: function() {
      return {
        valueType: phet.phetIo.phetio.getAPIForType( VALUE_TYPE )
      };
    },

    /**
     * Decodes a state into a NumberProperty.
     * @param {Object} stateObject
     * @returns {Object}
     */
    fromStateObject: function( stateObject ) {
      var fromParentStateObject = TPropertyImpl.fromStateObject( stateObject );
      fromParentStateObject.valueType = stateObject.valueType;
      fromParentStateObject.units = stateObject.units;
      fromParentStateObject.range = stateObject.range;
      fromParentStateObject.validValues = stateObject.validValues;
      return fromParentStateObject;
    },

    /**
     * Encodes a NumberProperty instance to a state.
     * @param {Object} instance
     * @returns {Object} - a state object
     */
    toStateObject: function( instance ) {
      assert && assert( instance, 'instance should be defined' );

      var parentStateObject = TPropertyImpl.toStateObject( instance );
      parentStateObject.valueType = instance.valueType;
      parentStateObject.units = instance.units;
      parentStateObject.range = instance.range;
      parentStateObject.validValues = instance.validValues;
      return parentStateObject;
    },

    documentation: 'Numeric property model'
  } );

  return TNumberProperty;
} );
{'fraction_non_alphanumeric': 0.10541546093427036, 'fraction_numerical': 0.0016535758577924762, 'mean_word_length': 3.435380384967919, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6472377', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1423, 'n_words': 330}