Tagged Questions
4
votes
2answers
109 views
Move object by one up or down algorithm in a custom order
Basically, I did an object (using hibernate) with a field called sorting_order. This field needs to be unique and I wish to swap two object by one. So one element has to be after or before the current ...
2
votes
4answers
566 views
Is my Scala Option conversion to Java correct?
Summary:
I've implemented what I think is a complete Java implementation of the Scala Option class. Could you please review and let me know if I have correctly and completely implemented it? And if ...
2
votes
2answers
114 views
how to write generic extensions for standard collection types in java?
I am a Java beginner and I am looking for an idiomatic way of writing a function that involves generics. I wrote this helper class (below) that pushes items into a sorted generic collection and I ...
1
vote
1answer
50 views
Java; Generic Observer/Observable - is this as messy as I think?
I have recently had a whole load of help trying to roll my own loosely-coupled Observable/Observer paradigm, here: Loosely coupled observer pattern
To keep things simple and to aid in my ...
1
vote
1answer
322 views
Java generics, convert nested list to array
I have to interface to some old code using nested arrays, so I have to convert my nested Lists to nested arrays. Any idea, suggestions, improvements are warmly welcomed.
public static <E> int ...