Ejemplo n.º 1
0
 @operator(value = "as_csv", can_be_const = true, index_type = IType.INT)
 @doc(
     deprecated = "use csv_file(path, separator) instead",
     value =
         "allows to specify the character to use as a separator for a CSV format and returns the file. Yields an error if the file is not a text file",
     examples =
         @example("let fileT type: file value: text(\"../includes/Stupid_Cell.csv\") as_csv ';';"))
 @Deprecated
 public static IGamaFile as_csv(final IScope scope, final IGamaFile file, final String s)
     throws GamaRuntimeException {
   return new GamaCSVFile(scope, file.getPath(), s);
   // if ( !(file instanceof GamaTextFile) ) { throw GamaRuntimeException
   // .warning("The 'as_csv' operator can only be applied to text files"); }
   // if ( s == null || s.isEmpty() ) { throw GamaRuntimeException
   // .warning("The 'as_csv' operator expects a non-empty string as its right operand"); }
   // ((GamaTextFile) file).setCsvSeparators(s);
   // return file;
 }
Ejemplo n.º 2
0
 @operator(
     value = IKeyword.WRITE,
     type = ITypeProvider.FIRST_TYPE,
     content_type = ITypeProvider.FIRST_CONTENT_TYPE,
     index_type = ITypeProvider.FIRST_KEY_TYPE)
 @doc(
     deprecated = "use the operator \"writable\" instead",
     value = "marks the file so that read and write operations are allowed.",
     comment = "A file is created by default in read-only mode.",
     examples = {
       @example(
           "write(shapefile(\"../images/point_eau.shp\"))   --: returns a file in read-write mode representing \"../images/point_eau.shp\"")
     },
     see = {"file", "writable"})
 @Deprecated
 public static IGamaFile opWrite(final IScope scope, final IGamaFile s) {
   s.setWritable(true);
   return s;
 }