File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -91,16 +91,28 @@ snippet v
9191# #
9292# # Declaration for ArrayList
9393snippet d.al
94- List<${1: Object } > ${2: list } = ArrayList<$1 >;${0}
94+ List<${1: Object } > ${2: list } = new ArrayList<$1 >() ;${0}
9595# # Declaration for HashMap
9696snippet d.hm
97- Map<${1: Object } , ${2: Object } > ${3: map } = HashMap<$1 , $2 >;${0}
97+ Map<${1: Object } , ${2: Object } > ${3: map } = new HashMap<$1 , $2 >() ;${0}
9898# # Declaration for HashSet
9999snippet d.hs
100- Set<${1: Object } > ${2: set } = HashSet<$1 >;${0}
100+ Set<${1: Object } > ${2: set } = new HashSet<$1 >() ;${0}
101101# # Declaration for Stack
102102snippet d.st
103- Stack<${1: Object } > ${2: stack } = Stack<$1 >;${0}
103+ Stack<${1: Object } > ${2: stack } = new Stack<$1 >();${0}
104+ # #
105+ # # Singleton Pattern
106+ snippet singlet
107+ private static class Holder {
108+ private static final ${1: `vim_snippets#Filename("$1 ")` } INSTANCE = new $1 ();
109+ }
110+
111+ private $1 () { }
112+
113+ private static $1 getInstance() {
114+ return Holder.INSTANCE;
115+ }
104116# #
105117# # Enhancements to Methods, variables, classes, etc.
106118snippet ab
You can’t perform that action at this time.
0 commit comments