Friday, April 29, 2016

COLLECTIONS - mutable List vs unmodifiable view of List

When you use Collections.unmodifiableList(list) it will return unmodifiable view of that list, it means you will get an UnsupportedOperationException on add() over that view etc.

But in the same time the list itself remains to be mutable in case it is modified in proper way e.g. by the programm API.

JAVA - Map Big O notation chart, Algorithmic Performance


GRALDE - add custom external *.jar to module dependencies

1. An example is map-visualiser project from github
2. Clone that project and make gradlew build for it
3. It will build its *.jar inside of /build/libs
4. Create libs dir inside your module
5. Copy/past that *.jar into your module libs dir 
6. Add these LOCs below into module's build.gradle and build the project:

repositories {
    mavenCentral()
    flatDir {
        dirs 'libs'    
    }
}

dependencies {    
    compile name: 'map-visualiser-1.0'
    testCompile group: 'junit', name: 'junit', version: '4.11'
}