Skip to content

Commit

Permalink
Merge pull request honza#385 from 0hansen/master
Browse files Browse the repository at this point in the history
Corrections and singleton pattern for java
  • Loading branch information
honza committed Jun 11, 2014
2 parents 92575e1 + 106d004 commit 405aff0
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions snippets/java.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,28 @@ snippet v
##
## Declaration for ArrayList
snippet d.al
List<${1:Object}> ${2:list} = ArrayList<$1>;${0}
List<${1:Object}> ${2:list} = new ArrayList<$1>();${0}
## Declaration for HashMap
snippet d.hm
Map<${1:Object}, ${2:Object}> ${3:map} = HashMap<$1, $2>;${0}
Map<${1:Object}, ${2:Object}> ${3:map} = new HashMap<$1, $2>();${0}
## Declaration for HashSet
snippet d.hs
Set<${1:Object}> ${2:set} = HashSet<$1>;${0}
Set<${1:Object}> ${2:set} = new HashSet<$1>();${0}
## Declaration for Stack
snippet d.st
Stack<${1:Object}> ${2:stack} = Stack<$1>;${0}
Stack<${1:Object}> ${2:stack} = new Stack<$1>();${0}
##
## Singleton Pattern
snippet singlet
private static class Holder {
private static final ${1:`vim_snippets#Filename("$1")`} INSTANCE = new $1();
}

private $1() { }

private static $1 getInstance() {
return Holder.INSTANCE;
}
##
## Enhancements to Methods, variables, classes, etc.
snippet ab
Expand Down

0 comments on commit 405aff0

Please sign in to comment.