Commit 54f2e783 by Billy Larru

asdfadsf

parent af43c1b4
...@@ -20,16 +20,23 @@ public class Main { ...@@ -20,16 +20,23 @@ public class Main {
private static final Logger log = LogManager.getLogger(Main.class); private static final Logger log = LogManager.getLogger(Main.class);
public static void main(String[] args) { public static void main(String[] args) {
setLogLevel(Level.TRACE);//DESARROLLO // setLogLevel(Level.TRACE);//DESARROLLO
// setLogLevel(Level.INFO);//PRODUCCION //// setLogLevel(Level.INFO);//PRODUCCION
log.info("Inicializando programa [Salidas Automaticas]..."); // log.info("Inicializando programa [Salidas Automaticas]...");
//
// Date horaInicio = Metodos.getHoraEjecucion("11:30");
// int periodo = 86400000;//El codigo se ejecutará cada 24h, 86400000 representa 24h en milisegundos
//
// TimerTask task = new ProgramarSalidasTask();
// Timer timer = new Timer();
// timer.schedule(task, horaInicio, periodo);
int i = 1;
for (int j = 0; j < 10; j++) {
sss(i++);
Date horaInicio = Metodos.getHoraEjecucion("11:30"); }
int periodo = 86400000;//El codigo se ejecutará cada 24h, 86400000 representa 24h en milisegundos
TimerTask task = new ProgramarSalidasTask();
Timer timer = new Timer();
timer.schedule(task , horaInicio, periodo);
} }
private static void setLogLevel(Level l) { private static void setLogLevel(Level l) {
...@@ -40,4 +47,8 @@ public class Main { ...@@ -40,4 +47,8 @@ public class Main {
ctx.updateLoggers(conf); ctx.updateLoggers(conf);
} }
private static void sss(int numero) {
System.out.println("valor en sss=" + numero);
}
} }
...@@ -7,6 +7,7 @@ package salidasautomaticas.util; ...@@ -7,6 +7,7 @@ package salidasautomaticas.util;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import org.json.JSONArray;
/** /**
* *
...@@ -15,8 +16,8 @@ import java.util.Date; ...@@ -15,8 +16,8 @@ import java.util.Date;
public class Metodos { public class Metodos {
/** /**
* Devuelve un objeto Date con la fecha de hoy y con la hora * Devuelve un objeto Date con la fecha de hoy y con la hora que le pasamos
* que le pasamos como parametro(en formato hh:mm en 24 horas). * como parametro(en formato hh:mm en 24 horas).
* *
* @param horaEjecucion hora que se va a setear al Date del dia de hoy. * @param horaEjecucion hora que se va a setear al Date del dia de hoy.
* @return * @return
...@@ -40,4 +41,31 @@ public class Metodos { ...@@ -40,4 +41,31 @@ public class Metodos {
return date; return date;
} }
public static void main(String[] args) {
JSONArray array = new JSONArray();
array
.put(Integer.class)
.put(String.class)
.put(Boolean.class);
f(Integer.class);
// System.out.println(array);
// ss(array);
// System.out.println(array.get(0));
// System.out.println(array);
}
private static void f(Class c) {
System.out.println(c.getName());
switch (c.getName()) {
case "java.lang.Integer":
System.out.println("entero");
}
}
private static void ss(JSONArray arr) {
System.out.println(arr.get(0));
arr.put(0, 1);
arr.put(1, "hello");
arr.put(2, true);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment