Dwarf Fortress has taught me that all the world's problems would be substantially reduced had our parent civilizations never minted more than four stacks of coins.
"Il y a peu de choses qui me soient impossibles..."
Dwarf Fortress has taught me that all the world's problems would be substantially reduced had our parent civilizations never minted more than four stacks of coins.
"Il y a peu de choses qui me soient impossibles..."
Dwarf Fortress has taught me that all the world's problems would be substantially reduced had our parent civilizations never minted more than four stacks of coins.
Magnus Gunnarsson wrote:wouldnt it be better to insert the classes into a hashmap and link string to the classes
"Il y a peu de choses qui me soient impossibles..."
Dwarf Fortress has taught me that all the world's problems would be substantially reduced had our parent civilizations never minted more than four stacks of coins.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Dwarf Fortress has taught me that all the world's problems would be substantially reduced had our parent civilizations never minted more than four stacks of coins.
Dwarf Fortress has taught me that all the world's problems would be substantially reduced had our parent civilizations never minted more than four stacks of coins.
Magnus Gunnarsson wrote:hmm, thats a very good idea actually, but i wonder, whats the speed diffrence between
class.newInstance();
and
new OperatorClass();
because, in the end this is gonna require create problably several several thousands of instances
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:Some variations on Ron's suggestion include adopting a standard package scheme for all operator classes and scanning that package subtree the way that certain Spring components do. Or, what the heck just scan EVERY class and introspect for children of "parent". It's a fair amount of overhead, but you only have to do it at startup.
Dwarf Fortress has taught me that all the world's problems would be substantially reduced had our parent civilizations never minted more than four stacks of coins.
Tim Holloway wrote:For a large number of classes, probably a Hash works better than a switch-construct. Something like this:
"Il y a peu de choses qui me soient impossibles..."
Magnus Gunnarsson wrote:i'll try get a quick example of what i meant by the enum
"Il y a peu de choses qui me soient impossibles..."
Stevens Miller wrote:Loading the strings is trivial, but how do you load the classes from a list?
Stevens Miller wrote:which, in your case, is an instance of an anonymous inner class that implements your functional interface
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:
Stevens Miller wrote:which, in your case, is an instance of an anonymous inner class that implements your functional interface
Not an anonymous inner class but a lambda expression. The latter does not create a class file (no EnumTest$1.class).
"Il y a peu de choses qui me soient impossibles..."
Magnus Gunnarsson wrote:i want to.. basically parse strings, into instances, lets say i got a string saying "cond start store"
this should be changed into a 3 length array with a instance of the class cond instance at index 0, instance of the class start at index 1 and so on, now.. i could do a HUGE switch statement.. or similarly, but that just feels really really.. messy?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Dwarf Fortress has taught me that all the world's problems would be substantially reduced had our parent civilizations never minted more than four stacks of coins.
Magnus Gunnarsson wrote:yes the interface will have only really one method, one thing about enum is that doing it like that would.. make it very cluttered, i mean, imagine hundreds of enums, all implementing the interface
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:The lambda implementation would seem to cost ... a fair bit of readability, IMO
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Stevens Miller wrote:
Rob Spoor wrote:
Stevens Miller wrote:which, in your case, is an instance of an anonymous inner class that implements your functional interface
Not an anonymous inner class but a lambda expression. The latter does not create a class file (no EnumTest$1.class).
Isn't that a matter of the implementation? From the language's perspective, a lambda is the same as an instance of an anonymous inner class, isn't it?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |