htFetch method

dynamic htFetch(
  1. String varName
)

Implementation

dynamic htFetch(String varName) {
  switch (varName) {
    case 'bitLength':
      return bitLength;
    case 'sign':
      return sign;
    case 'isEven':
      return isEven;
    case 'isOdd':
      return isOdd;
    case 'isNegative':
      return isNegative;
    case 'pow':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          pow(positionalArgs.first);
    case 'modPow':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          modPow(positionalArgs[0], positionalArgs[1]);
    case 'modInverse':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          modInverse(positionalArgs.first);
    case 'gcd':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          gcd(positionalArgs.first);
    case 'toUnsigned':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toUnsigned(positionalArgs.first);
    case 'toSigned':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toSigned(positionalArgs.first);
    case 'isValidInt':
      return isValidInt;
    case 'toInt':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toInt();
    case 'toDouble':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toDouble();
    case 'toString':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toString();
    case 'toRadixString':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toRadixString(positionalArgs.first);
    default:
      throw HTError.undefined(varName);
  }
}