The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Java Code
Posted by: Something | May 16, 2011 @ 7:52am
Java Code
[
Download
]
package service; import model.Alarm; import model.Location; import model.Product; import model.Stack; import model.Stack.DryState; import dao.AlarmDao; import dao.LocationDao; import dao.ProductDao; public class Service { private static final Service INSTANCE = new Service(); private Service() { } public static Service getInstance() { return INSTANCE; } boolean isInt(char ch) { System.out.println("testNumber"); if (ch == '1' || ch == '2' || ch == '3' || ch == '4' || ch == '5' || ch == '6' || ch == '7' || ch == '8' || ch == '9' || ch == '0') { return true; } else { return false; } } public boolean isNumber(String input) { System.out.println("testForNumbers"); boolean isNumber = false; for (int i = 0; i < input.length(); i++) { if (!isInt(input.charAt(i))) { isNumber = false; } else { isNumber = true; } } return isNumber; } public void createObjects() { Location area1 = new Location("Area1", "AR1"); LocationDao.storeLocation(area1); Location area2 = new Location("Area2", "AR2"); LocationDao.storeLocation(area2); Location area3 = new Location("Area3", "AR3"); LocationDao.storeLocation(area3); Alarm alarm1 = new Alarm(5, 5); AlarmDao.storeAlarm(alarm1); Alarm alarm2 = new Alarm(5, 5); AlarmDao.storeAlarm(alarm2); Alarm alarm3 = new Alarm(0, 0); AlarmDao.storeAlarm(alarm3); Product product = new Product("Licorice", "LQ", "AAA"); ProductDao.storeProduct(product); Product product2 = new Product("Skumbananer", "SK", "BBB"); ProductDao.storeProduct(product2); Product product3 = new Product("Nyamnyams", "NN", "CCC"); ProductDao.storeProduct(product3); System.out.println(ProductDao.getAllProducts()); Stack a = StackService.getInstance().createStack(false, DryState.NOTYET, area1, alarm1, product); Stack b = StackService.getInstance().createStack(true, DryState.IDEAL, area3, alarm2, product2); Stack d = StackService.getInstance().createStack(true, DryState.TOOLATE, area3, alarm3, product3); } }
Syntax Highlighting
[
Open in new window
]
Author Comments
NE{PONIMAJU!!!!!
Rating
5.87 / 8
92 Votes
http://codebin.yi.org/1269
page generated in 0.01 seconds