Merge branch 'master' of bitbucket.org:xgiovio/unisa_project_java_fist
This commit is contained in:
34
it/unisa/info13d/Articoli/Global.java
Normal file
34
it/unisa/info13d/Articoli/Global.java
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
package it.unisa.info13d.Articoli;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created with MONSTER.
|
||||||
|
* User: xgiovio
|
||||||
|
* Date: 16/12/13
|
||||||
|
* Time: 19.22
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* I metodi statici (globali) da usare nel progetto vanno tutti in questa classe
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class Global {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return il seguente id disponibile all'aggiunta di un nuovo prodotto
|
||||||
|
*/
|
||||||
|
public static int get_next_id (){
|
||||||
|
general_counter++;
|
||||||
|
return general_counter;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* E' il contatore statico privato
|
||||||
|
*/
|
||||||
|
private static int general_counter = 0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user