List of usage examples for java.lang Integer toUnsignedLong
public static long toUnsignedLong(int x)
From source file:Main.java
public static void main(String[] args) { // Two negative integer values int x = -1;//from w w w. ja v a 2 s . c om int y = -2; // Performs signed division System.out.println("Signed x = " + x); System.out.println("Signed y = " + y); System.out.println("Signed x/y = " + (x / y)); // Performs unsigned division by treating x and y holding unsigned values long ux = Integer.toUnsignedLong(x); long uy = Integer.toUnsignedLong(y); int uQuotient = Integer.divideUnsigned(x, y); System.out.println("Unsigned x = " + ux); System.out.println("Unsigned y = " + uy); System.out.println("Unsigned x/y = " + uQuotient); }
From source file:restservice.CartrackerFacadeREST.java
@GET @Path("create/{amount}") public String createCartrackers(@PathParam("amount") int amount, @QueryParam("name") String name, @QueryParam("key") String key) throws Exception { if (service.getUser(name, key) == null) { throw new NotAuthorizedException("Not authorized"); }/* w w w.j av a2s. com*/ for (int i = 0; i < amount; i++) { Cartracker cartracker = new Cartracker(); cartracker.setCartrackId(Integer.toUnsignedLong(i + 1)); cartracker.setLastId(0l); cartracker.setIdCode("hrgrjgf" + i); cartracker.setActive(true); ArrayList<Movement> movements = new ArrayList<>(); Movement m = new Movement(); m.setMovementId(Integer.toUnsignedLong(i + 1)); m.setLatitude(50.0000); m.setLongitude(50.0000); m.setDistance(i); m.setRegistrationDate(new Date()); m.setCartracker(cartracker); movements.add(m); cartracker.setMovements(movements); service.createCartracker(cartracker); service.addMovement(m); } return "Created" + amount; }
From source file:msi.gama.util.random.GamaRNG.java
@Override public void setSeed(int seed) { super.setSeed(Integer.toUnsignedLong(seed)); }
From source file:us.ihmc.idl.CDR.java
/** * Unsigned int */ public long read_type_4() { return Integer.toUnsignedLong(read_type_2()); }
From source file:com.formkiq.core.service.generator.pdfbox.TextToPDFieldMapper.java
/** * Remove Non Prinable Characters./*from w w w. j ava 2 s.c om*/ * * @param s {@link String} * @return {@link String} */ private String cleanTextContent(final String s) { if (Strings.getBytes(s).length > 1) { final int maxUnicodeCharacter = 8300; char c = s.charAt(0); if (Integer.toUnsignedLong(c) > maxUnicodeCharacter) { return ""; } } return s; }