package mfl;

public class Integer
extends mfl.Number
{
  long java_value;

  public Integer(){
    java_value = 0;
  }
  public Integer(long v){
    super((double)v);
    java_value = v;
  }
 
  public int hashCode()
    {return (int)java_value;}

  public mfl.Value divide_op(mfl.Value x)
    {if (!(x instanceof Integer)) return super.divide_op(x);
    return new mfl.Number((double)java_value / (double)((Number)x).java_value);}

  public boolean equals(Object x)
    {if (!(x instanceof Integer)) return false;
    return java_value == ((Integer)x).java_value;}

  public mfl.Value greater_than_or_equal_op(mfl.Value x)
    {if (!(x instanceof Integer)) return super.greater_than_or_equal_op(x);
    return java_value >= ((Integer)x).java_value ? mfl.Boolean.True : mfl.Boolean.False;}

  public mfl.Value exponentiate_op(mfl.Value x)
    {if (!(x instanceof Integer)) return super.exponentiate_op(x);
    return new Integer((long)java.lang.Math.pow((double)java_value, (double)((Integer)x).java_value));}

  public mfl.Value greater_than_op(mfl.Value x)
    {if (!(x instanceof Integer)) return super.greater_than_op(x);
    return java_value > ((Integer)x).java_value ? mfl.Boolean.True : mfl.Boolean.False;}

  public mfl.Value less_than_op(mfl.Value x)
    {if (!(x instanceof Integer)) return super.less_than_op(x);
    return java_value < ((Integer)x).java_value ? mfl.Boolean.True : mfl.Boolean.False;}

  public mfl.Value less_than_or_equal_op(mfl.Value x)
    {if (!(x instanceof Integer)) return super.less_than_or_equal_op(x);
    return java_value <= ((Integer)x).java_value ? mfl.Boolean.True : mfl.Boolean.False;}

  public mfl.Value minus_op(mfl.Value x)
    {if (!(x instanceof Integer)) return super.minus_op(x);
    return new Integer(java_value - ((Integer)x).java_value);}

  public mfl.Value multiply_op(mfl.Value x)
    {if (!(x instanceof Integer)) return super.multiply_op(x);
    return new Integer(java_value * ((Integer)x).java_value);}

  public mfl.Value not_equal_op(mfl.Value x)
    {if (!(x instanceof Integer)) return super.not_equal_op(x);
    return java_value != ((Integer)x).java_value ? mfl.Boolean.True : mfl.Boolean.False;}

  public mfl.Value plus_op(mfl.Value x)
    {if (!(x instanceof Integer)) return super.plus_op(x);
    return new Integer(java_value + ((Integer)x).java_value);}

  public java.lang.String toString()
    {return (new java.lang.Long(java_value)).toString();}

  public mfl.Value unary_minus_op()
    {return new Integer(-java_value);}
}

