vineri, 21 mai 2010

Hai la cod, la cod, la cod! (2)

Adicatelea cine e obectele, cine e primitivele si ce vrea ele. Se putea mai complicat?! (Java6)
public static Integer getCustomerSegment(Long i_customerID) {

Long segment = null;

segment = Long.valueOf(String,valueOf(hash(i_customerID)));
segment = Long.valueOf(String.valueOf(convertLongTo10Bit(segment)));

return new Integer(segment.intValue());
}

public static long hash(Long toHash) {
...
}

private static Integer convertLongTo10Bit(Long i_long) {
...
}