Пример #1
0
  public static IScriptType wrapSingleReturnTypes(List<ReturnType> types) {
    List<IScriptType> result = Lists.newArrayList();

    for (ReturnType t : types) result.add(SingleReturnType.valueOf(t));

    return new TupleType(result);
  }
Пример #2
0
 public static IScriptType createFromReturn(List<ReturnType> types) {
   if (types.size() == 0) {
     return SingleType.VOID;
   } else if (types.size() == 1) {
     return SingleReturnType.valueOf(types.get(0));
   } else {
     return wrapSingleReturnTypes(types);
   }
 }
Пример #3
0
 public static IScriptType single(ReturnType type, IRange range) {
   Preconditions.checkNotNull(type);
   Preconditions.checkNotNull(range);
   return new BoundedType(SingleReturnType.valueOf(type), range);
 }
Пример #4
0
 public static IScriptType single(ReturnType type) {
   return SingleReturnType.valueOf(type);
 }