<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses('net.xp_framework.unittest.xml.ButtonType', 'util.collections.Vector');

  /**
   * Test class for Marshaller / Unmarshaller tests
   *
   * @see      xp://net.xp_framework.unittest.xml.UnmarshallerTest
   * @see      xp://net.xp_framework.unittest.xml.MarshallerTest
   * @see      rfc://0040
   * @purpose  Test class
   */
  class DialogType extends Object {
    public
      $id       = '',
      $caption  = '',
      $buttons  = NULL,
      $flags    = array(),
      $options  = array();

    /**
     * Constructor
     *
     */
    public function __construct() {
      $this->buttons= create('new util.collections.Vector<net.xp_framework.unittest.xml.ButtonType>()');
    }

    /**
     * Set ID
     *
     * @param   string id
     */
    #[@xmlmapping(element= '@id')]
    public function setId($id) {
      $this->id= $id;
    }

    /**
     * Get ID
     *
     * @return  string id
     */
    #[@xmlfactory(element= '@id')]
    public function getId() {
      return $this->id;
    }

    /**
     * Set caption
     *
     * @param   string caption
     */
    #[@xmlmapping(element= 'caption')]
    public function setCaption($caption) {
      $this->caption= $caption;
    }

    /**
     * Get caption
     *
     * @param   string caption
     */
    #[@xmlfactory(element= 'caption')]
    public function getCaption() {
      return $this->caption;
    }
    
    /**
     * Add a button
     *
     * @param   &net.xp_framework.unittest.xml.ButtonType button
     * @return  &net.xp_framework.unittest.xml.ButtonType the added button
     */
    #[@xmlmapping(element= 'button', class= 'net.xp_framework.unittest.xml.ButtonType')]
    public function addButton($button) {
      $this->buttons->add($button);
      return $button;
    }
    
    /**
     * Returns number of buttons
     *
     * @return  int
     */
    public function numButtons() {
      return $this->buttons->size();
    }

    /**
     * Returns button at a given position
     *
     * @param   int
     * @return  &net.xp_framework.unittest.xml.ButtonType 
     */
    public function buttonAt($offset) {
      return $this->buttons->get($offset);
    }

    /**
     * Returns whether buttons exist
     *
     * @return  int
     */
    public function hasButtons() {
      return !$this->buttons->isEmpty();
    }
    
    /**
     * Retrieve this dialog's buttons
     *
     * @return  &lang.Collection<net.xp_framework.unittest.xml.ButtonType>
     */
    #[@xmlfactory(element= 'button')]
    public function getButtons() {
      return $this->buttons;
    }
    
    /**
     * Set flags
     *
     */
    #[@xmlmapping(element= 'flags', pass= array('substring-before(., "|")', 'substring-after(., "|")'))]
    public function setFlags($flag1, $flag2) {
      $this->flags= array($flag1, $flag2);
    }
    
    /**
     * Get flags<commit_msg>- QA: Remove reference operators from apidoc<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses('net.xp_framework.unittest.xml.ButtonType', 'util.collections.Vector');

  /**
   * Test class for Marshaller / Unmarshaller tests
   *
   * @see      xp://net.xp_framework.unittest.xml.UnmarshallerTest
   * @see      xp://net.xp_framework.unittest.xml.MarshallerTest
   * @see      rfc://0040
   * @purpose  Test class
   */
  class DialogType extends Object {
    public
      $id       = '',
      $caption  = '',
      $buttons  = NULL,
      $flags    = array(),
      $options  = array();

    /**
     * Constructor
     *
     */
    public function __construct() {
      $this->buttons= create('new util.collections.Vector<net.xp_framework.unittest.xml.ButtonType>()');
    }

    /**
     * Set ID
     *
     * @param   string id
     */
    #[@xmlmapping(element= '@id')]
    public function setId($id) {
      $this->id= $id;
    }

    /**
     * Get ID
     *
     * @return  string id
     */
    #[@xmlfactory(element= '@id')]
    public function getId() {
      return $this->id;
    }

    /**
     * Set caption
     *
     * @param   string caption
     */
    #[@xmlmapping(element= 'caption')]
    public function setCaption($caption) {
      $this->caption= $caption;
    }

    /**
     * Get caption
     *
     * @param   string caption
     */
    #[@xmlfactory(element= 'caption')]
    public function getCaption() {
      return $this->caption;
    }
    
    /**
     * Add a button
     *
     * @param   net.xp_framework.unittest.xml.ButtonType button
     * @return  net.xp_framework.unittest.xml.ButtonType the added button
     */
    #[@xmlmapping(element= 'button', class= 'net.xp_framework.unittest.xml.ButtonType')]
    public function addButton($button) {
      $this->buttons->add($button);
      return $button;
    }
    
    /**
     * Returns number of buttons
     *
     * @return  int
     */
    public function numButtons() {
      return $this->buttons->size();
    }

    /**
     * Returns button at a given position
     *
     * @param   int
     * @return  net.xp_framework.unittest.xml.ButtonType 
     */
    public function buttonAt($offset) {
      return $this->buttons->get($offset);
    }

    /**
     * Returns whether buttons exist
     *
     * @return  int
     */
    public function hasButtons() {
      return !$this->buttons->isEmpty();
    }
    
    /**
     * Retrieve this dialog's buttons
     *
     * @return  util.collections.Vector<net.xp_framework.unittest.xml.ButtonType>
     */
    #[@xmlfactory(element= 'button')]
    public function getButtons() {
      return $this->buttons;
    }
    
    /**
     * Set flags
     *
     */
    #[@xmlmapping(element= 'flags', pass= array('substring-before(., "|")', 'substring-after(., "|")'))]
    public function setFlags($flag1, $flag2) {
      $this->flags= array($flag1, $flag2);
    }
    
    /**
     * Get flags
{'fraction_non_alphanumeric': 0.15188376414934956, 'fraction_numerical': 0.0027031593174522725, 'mean_word_length': 2.0005068423720225, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 32}, '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': '5395541', 'n_tokens_mistral': 1906, 'n_tokens_neox': 1874, 'n_words': 369}