Added new structure for neighbors data storage (in C++ and Java). Java version is tested, but not always worked correctly (special case is quad 3x3, where neighborhood is not determined right way for angles).

C++ version is not tested, but compiled.