blob: cfe10847da379b2e7908667297a3a314bf0e1a03 [file] [log] [blame]
/*******************************************************************************
* Copyright © 2012, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*
*******************************************************************************/
package eglx.lang;
import egl.lang.reflect.ClassType;
import egl.lang.reflect.Operation;
/**
* This is the class for bigints, 64-bit signed binary numbers.
*/
externalType EBigint extends ENumber type ClassType
/**
* Constructs a bigint with a default value of 0.
*/
constructor();
/**
* {@Operation +} A unary plus (has no effect on the numeric value).
*/
static function $Plus(value EBigint in) returns (EBigint) {@Operation{"+"}};
/**
* {@Operation +} Adds two numbers.
*/
static function $Plus(lvalue EBigint in, rvalue EBigint in) returns (EBigint) {@Operation{"+"}};
/**
* {@Operation -} Negates the value.
*/
static function $Minus(value EBigint in) returns (EBigint) {@Operation{"-"}};
/**
* {@Operation -} Subtracts one number from another.
*/
static function $Minus(lvalue EBigint in, rvalue EBigint in) returns (EBigint) {@Operation{"-"}};
/**
* {@Operation *} Multiplies two numbers.
*/
static function $Multiply(lvalue EBigint in, rvalue EBigint in) returns (EBigint) {@Operation{"*"}};
/**
* {@Operation /} Divides one number by another.
*/
static function $Divide(lvalue EBigint in, rvalue EBigint in) returns (EDecimal) {@Operation{"/"}};
/**
* {@Operation %} Computes the remainder of dividing one number by another.
*/
static function $Modulo(lvalue EBigint in, rvalue EBigint in) returns (EBigint) {@Operation{"%"}};
/**
* {@Operation **} Computes lvalue to the power of rvalue.
*/
static function $PowerOf(lvalue EBigint in, rvalue EBigint in) returns (EFloat) {@Operation{"**"}};
/**
* {@Operation <} Compares two numbers.
*/
static function $LT(lvalue EBigint in, rvalue EBigint in) returns (EBoolean) {@Operation{"<"}};
/**
* {@Operation >} Compares two numbers.
*/
static function $GT(lvalue EBigint in, rvalue EBigint in) returns (EBoolean) {@Operation{">"}};
/**
* {@Operation <=} Compares two numbers.
*/
static function $LTE(lvalue EBigint in, rvalue EBigint in) returns (EBoolean) {@Operation{"<="}};
/**
* {@Operation >=} Compares two numbers.
*/
static function $GTE(lvalue EBigint in, rvalue EBigint in) returns (EBoolean) {@Operation{">="}};
/**
* {@Operation ==} Compares two numbers.
*/
static function $EQ(lvalue EBigint? in, rvalue EBigint? in) returns(EBoolean) {@Operation{"=="}};
/**
* {@Operation !=} Compares two numbers.
*/
static function $NEQ(lvalue EBigint? in, rvalue EBigint? in) returns(EBoolean) {@Operation{"!="}};
/**
* {@Operation narrow} Converts a string to a bigint. The string is parsed
* as follows: It may begin with an optional + or - sign. After the sign there
* must be a sequence of one or more digit characters. Nothing may follow the
* digits. The digits in the string must be within the valid range for a bigint.
*
* @throws TypeCastException if the string can't be parsed into a bigint.
*/
static function asBigint(value EString? in) returns(EBigint?) {@Operation{"narrow"}};
/**
* {@Operation widen} Converts a smallint to a bigint.
*/
static function asBigint(value ESmallint? in) returns(EBigint?) {@Operation{"widen"}};
/**
* {@Operation narrow} Converts a smallfloat to a bigint. Digits after the
* decimal point are discarded.
*
* @throws TypeCastException if the smallfloat is out of range for a bigint.
*/
static function asBigint(value ESmallfloat? in) returns(EBigint?) {@Operation{"narrow"}};
/**
* {@Operation widen} Converts an int to a bigint.
*/
static function asBigint(value EInt? in) returns(EBigint?) {@Operation{"widen"}};
/**
* {@Operation narrow} Converts a float to a bigint. Digits after the
* decimal point are discarded.
*
* @throws TypeCastException if the float is out of range for a bigint.
*/
static function asBigint(value EFloat? in) returns(EBigint?) {@Operation{"narrow"}};
/**
* {@Operation narrow} Converts a decimal to a bigint. Digits after the
* decimal point are discarded.
*
* @throws TypeCastException if the decimal is out of range for a bigint.
*/
static function asBigint(value EDecimal? in) returns(EBigint?) {@Operation{"narrow"}};
/**
* {@Operation narrow} Converts a number to a bigint. Digits after the
* decimal point are discarded.
*
* @throws TypeCastException if the number is out of range for a bigint.
*/
static function asBigint(value ENumber? in) returns(EBigint?) {@Operation{"narrow"}};
/**
* {@Operation narrow} Converts bytes to a bigint.
*
* @throws TypeCastException if the bytes are not valid format for a bigint.
*/
static function asBigint(value EBytes? in) returns(EBigint?) {@Operation{"narrow"}};
/**
* {@Operation widen} Converts a bigint to a number.
*/
static function asNumber(value EBigint? in) returns(ENumber?) {@Operation{"widen"}};
end