Uday's Tech Space

Showing category "Java" (Show all posts)

Merge Sort - Revisit with Fork and Join

Posted by Uday Shankar on Monday, February 23, 2015, In : Java 
Linear merge sort:

    private int[] mergeSort(int[] input, int fromIndex, int length) {
        if (length == 1)
            return new int[]{input[fromIndex]};
        int mid = length >>> 1;
        int[] sorted1 = mergeSort(input, fromIndex, mid);
        int[] sorted2 = mergeSort(input, (fromIndex + mid), (length - mid));
        return merge(sorted1, sorted2);

    private int[] merge(int[] sorted1, int[] sorted2) {
        int[] merged = new int[sorted1.length + sorted2.length];
        int ...

Continue reading ...

Counting Classes and Methods in a package

Posted by Uday Shankar on Friday, October 3, 2014, In : Java 
This is just a utility i created joining these blog posts:

How can I count the number of methods in a Java class ?
Get All Classes Within A Package

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

 * Counts the number of classes and methods in a package.
public class CountPackageMethods {
     * Scans all classes accessible from the context class loader w...

Continue reading ...

Camel: Brief Overview

Posted by Uday Shankar on Wednesday, February 8, 2012, In : Java 

According to Apache Camel site (http://camel.apache.org/): Apache Camel is a powerful open source integration framework based on known Enterprise Integration Patterns with powerful Bean Integration.

But before jumping on to Camel, the understanding of integration patterns is must which is defined by Gregor Hohpe in his book Enterprise Integration Patterns. The same is briefly described in his website (http://www.eaipatterns.com/index.html). Also very brief summary of the same is mentioned by...

Continue reading ...

XML Properties

Posted by Uday Shankar on Friday, March 19, 2010, In : Java 
While building one of the java projects i came across properties files. They are kind of configuration files which are easy to use in java as java provide its apis. But with time i found that properties files are limited in a way like it does not have properties of a property or it could not have two or more values for the same property. For quite some time i was looking for a solution but it seems it is a less traveled path. Hence i had tried to develop something similar to properties api bu...
Continue reading ...

About Me

Uday Shankar A curious Java Developer.
Make a Free Website with Yola.