包裝方法宣告

int someMethod(String aString,
               List<Integer> aList,
               Map<String, String> aMap,
               int anInt,
               long aLong,
               Set<Number> aSet,
               double aDouble) {
    …
}

int someMethod(String aString, List<Integer> aList,
        Map<String, String> aMap, int anInt, long aLong,
        double aDouble, long aLong) {
    …
}

int someMethod(String aString,
               List<Map<Integer, StringBuffer>> aListOfMaps,
               Map<String, String> aMap)
        throws IllegalArgumentException {
    …
}

int someMethod(String aString, List<Integer> aList,
        Map<String, String> aMap, int anInt)
                throws IllegalArgumentException {
    …
}
  • 方法宣告可以通過垂直列出引數,或者通過新行和+8 個額外空格來格式化
  • 如果需要包裝 throws 子句,則將換行符放在 throws 子句的前面,並確保它從引數列表中突出,或者通過相對於函式宣告縮排+8,或者相對於前一行+8。