<?php
/*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE @UMPLE_VERSION@ modeling language!*/

class Student
{

  //------------------------
  // MEMBER VARIABLES
  //------------------------

  //Student Attributes
  private $intId;
  private $doubleId;
  private $booleanId;
  private $stringId;

  //Helper Variables
  private $cachedHashCode;
  private $canSetIntId;

  //------------------------
  // CONSTRUCTOR
  //------------------------

  public function __construct($aDoubleId, $aBooleanId, $aStringId)
  {
    $this->cachedHashCode = -1;
    $this->canSetIntId = true;
    $this->doubleId = $aDoubleId;
    $this->booleanId = $aBooleanId;
    $this->stringId = $aStringId;
  }

  //------------------------
  // INTERFACE
  //------------------------

  public function setIntId($aIntId)
  {
    $wasSet = false;
    if (!$this->canSetIntId) { return false; }
    $this->canSetIntId = false;
    $this->intId = $aIntId;
    $wasSet = true;
    return $wasSet;
  }

  public function getIntId()
  {
    return $this->intId;
  }

  public function getDoubleId()
  {
    return $this->doubleId;
  }

  public function getBooleanId()
  {
    return $this->booleanId;
  }

  public function getStringId()
  {
    return $this->stringId;
  }

  public function isBooleanId()
  {
    return $this->booleanId;
  }

  public function equals($compareTo)
  {
    if ($compareTo == null) { return false; }
    if (get_class($this) != get_class($compareTo)) { return false; }

    if ($this->intId != $compareTo->intId)
    {
      return false;
    }

    if ($this->doubleId != $compareTo->doubleId)
    {
      return false;
    }

    if ($this->booleanId != $compareTo->booleanId)
    {
      return false;
    }

    if ($this->stringId != $compareTo->stringId)
    {
      return false;
    }

    return true;
  }

  public function hashCode()
  {
    if ($this->cachedHashCode != -1)
    {
      return $this->cachedHashCode;
    }
    $this->cachedHashCode = 17;
    $this->cachedHashCode = $this->cachedHashCode * 23 + $this->intId;

    $this->cachedHashCode = $this->cachedHashCode * 23 + $this->doubleId;

    $this->cachedHashCode = $this->cachedHashCode * 23 + ($this->booleanId ? 1 : 0);

    if ($this->stringId != null)
    {
      $this->cachedHashCode = $this->cachedHashCode * 23 + spl_object_hash($this->stringId);
    }
    else
    {
      $this->cachedHashCode = $this->cachedHashCode * 23;
    }

    $this->canSetIntId = false;
    $this->canSetDoubleId = false;
    $this->canSetBooleanId = false;
    $this->canSetStringId = false;
    return $this->cachedHashCode;
  }

  public function delete()
  {}

}
?>
