1 package com.puppycrawl.tools.checkstyle.checks.indentation; 20 21 import java.util.SortedMap ; 22 import java.util.TreeMap ; 23 24 29 public class LineSet 30 { 31 34 private final SortedMap mLines = new TreeMap (); 35 36 43 public Integer getStartColumn(Integer aLineNum) 44 { 45 return (Integer ) mLines.get(aLineNum); 46 } 47 48 53 public int firstLineCol() 54 { 55 final Object firstLineKey = mLines.firstKey(); 56 return ((Integer ) mLines.get(firstLineKey)).intValue(); 57 } 58 59 64 public int firstLine() 65 { 66 return ((Integer ) mLines.firstKey()).intValue(); 67 } 68 69 74 public int lastLine() 75 { 76 return ((Integer ) mLines.lastKey()).intValue(); 77 } 78 79 85 public void addLineAndCol(Integer aLineNum, int aCol) 86 { 87 mLines.put(aLineNum, new Integer (aCol)); 88 } 89 90 95 public boolean isEmpty() 96 { 97 return mLines.isEmpty(); 98 } 99 100 103 public String toString() 104 { 105 return "LineSet[ start=" + firstLine() + ", last=" + lastLine() + "]"; 106 } 107 } 108 | Popular Tags |