This is something that every now and then I have to do: check whether either one or all elements of a collection meet a certain criteria.ย The standard code initially in Java involved a for loop and iterating through the collection explicitly and checking the condition at each step. Then Apache Commons came on with their […]
Posts Tagged: apache commons
Parallel Sorting in Java 8
I started playing with Java 8 relatively recently (booo! ๐ ) — and going through the new features this JDK brought, I keep discovering things which I feel deserve more attention than they have been given. Sure, everyone is raving about the lambda expressions, try-with-resources and so on, but occasionally there are small additions that […]
Using Apache Commons CLI to Parse Arguments
I’ve talked before on this blog about Apache Commons CLI project and showcased how easy it is to use it to build a rather complex command-line syntax for your Java application. If you find yourself at any point writing an application which needs more than one command line switch, I strongly recommend Commons CLI is […]
Perf4J and Object Creation/Destroy
If at any point in your coding life you had to measure some component performance, chances are that you came across Perf4J at some point. To quote from their own website: Perf4J is to System.currentTimeMillis() as log4j is to System.out.println() There are of course other ways to measure timings of components execution, however, I found […]
Playing Around with Buffers
I found myself recently using the Buffer class in the Apache Commons Collections framework — and realised that the Buffer-related classes don’t get enough coverage as they probably should, since they can actually provide out-of-the-box solutions to common development problems. So I started this little exercise partly to demonstrate some of the powerful Buffer-based classes […]
maven site Problem with Hash Symbol (#)
Not sure if it’s just me who’s been digging around this issue for a while, maybe it’s common knowledge to the maven community, but I found this very frustrated dealing with this and researching it on the net, so having finally found the solution to this I thought I’d post it here. If nothing else, […]
Cache Ahead using Apache Commons Pool
If you have done any code that needs some sort of pooling of resources (which is some sort of caching, let’s face it), you would have no doubt come across Apache Commons Pool. (In fact the DBCP pool is used as a standard in applications which require database connection pooling.) The framework offers most of […]
Simplify Your Singletons
I’ve seen recently some Java code (I’m not telling whose, you probably know who you are :p) where a singleton pattern was involved. Nothing unusual here, you would say — and you’re right, I probably found myself using Singleton and Factory and Observer in pretty much every single Java project I ever worked on. The […]
Groovy Scripting at the Power of Commons CLI
I’ve found myself more and more scripting stuff in Groovy — partly I’m guessing it’s cause of my Java background, partly because I’m probably not such a good bash/awk/perl/sed/etc script hacker ๐ Nevertheless, make no mistakes, Groovy is an awesome scripting tool! (I’m not going to praise its benefits in terms of building applications — […]
Apache Commons Modeler — Simple/Sample Usage
I’ve dealt in previous posts (here and on Cognitive Match‘s blog) with JMX and various things around it — as this is an area I have found more than useful in the JDK. It is therefore no surprise that recently I have turned my eyes to Apache Commons Modeler. The project lacks documentation, granted, and […]