View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.indentation.indentation; //indent:0 exp:0
2   
3   import java.util.Map; //indent:0 exp:0
4   import java.util.Map.Entry; //indent:0 exp:0
5   
6   import com.google.common.collect.Range; //indent:0 exp:0
7   import com.google.common.collect.RangeMap; //indent:0 exp:0
8   
9   /**                                                                           //indent:0 exp:0
10   * This test-input is intended to be checked using following configuration:   //indent:1 exp:1
11   *                                                                            //indent:1 exp:1
12   * arrayInitIndent = 4                                                        //indent:1 exp:1
13   * basicOffset = 2                                                            //indent:1 exp:1
14   * braceAdjustment = 0                                                        //indent:1 exp:1
15   * caseIndent = 4                                                             //indent:1 exp:1
16   * forceStrictCondition = false                                               //indent:1 exp:1
17   * lineWrappingIndentation = 4                                                //indent:1 exp:1
18   * tabWidth = 4                                                               //indent:1 exp:1
19   * throwsIndent = 4                                                           //indent:1 exp:1
20   *                                                                            //indent:1 exp:1
21   *                                                                            //indent:1 exp:1
22   */                                                                           //indent:1 exp:1
23  public abstract class InputIndentationFromGuava2<K extends Comparable<?>, V> implements RangeMap<K, V> { //indent:0 exp:0
24  
25    public InputIndentationFromGuava2<K, V> subRangeMap1(final Range<K> range) { //indent:2 exp:2
26      Range<K> ranges = null; //indent:4 exp:4
27      if (checkNotNull(range).isEmpty()) { //indent:4 exp:4
28      } else if (ranges.isEmpty() || range.encloses(span())) { //indent:4 exp:4
29        return this; //indent:6 exp:6
30      } //indent:4 exp:4
31      int lowerIndex = SortedLists.binarySearch(); //indent:4 exp:4
32      int upperIndex = SortedLists.binarySearch(); //indent:4 exp:4
33      if (lowerIndex >= upperIndex) { //indent:4 exp:4
34        return null; //indent:6 exp:6
35      } //indent:4 exp:4
36      final int off = lowerIndex; //indent:4 exp:4
37      final int len = upperIndex - lowerIndex; //indent:4 exp:4
38      InputIndentationFromGuava2<K, V> outer = null; //indent:4 exp:4
39      return outer; //indent:4 exp:4
40    } //indent:2 exp:2
41  
42    public V get(int index) { //indent:2 exp:2
43      K key = null; //indent:4 exp:4
44      int len = 0; //indent:4 exp:4
45      checkElementIndex(index, len); //indent:4 exp:4
46      int off; //indent:4 exp:4
47      RangeMap<K, V> ranges = null; //indent:4 exp:4
48      if (index == 0 || index == len - 1) { //indent:4 exp:4
49        Object range; //indent:6 exp:6
50        return ranges.get(key); //indent:6 exp:6
51      } else { //indent:4 exp:4
52        return ranges.get(key); //indent:6 exp:6
53      } //indent:4 exp:4
54    } //indent:2 exp:2
55  
56    private void checkElementIndex(int index, Object len) //indent:2 exp:2
57    { //indent:2 exp:2
58  
59    } //indent:2 exp:2
60  
61    boolean isPartialView() { //indent:2 exp:2
62      return true; //indent:4 exp:4
63    } //indent:2 exp:2
64  
65    private Range<K> checkNotNull(Range<K> range) //indent:2 exp:2
66    { //indent:2 exp:2
67      return null; //indent:4 exp:4
68    } //indent:2 exp:2
69  
70    @Override //indent:2 exp:2
71    public V get(K key) //indent:2 exp:2
72    { //indent:2 exp:2
73      return null; //indent:4 exp:4
74    } //indent:2 exp:2
75  
76    public Range<K> span() //indent:2 exp:2
77    { //indent:2 exp:2
78      return null; //indent:4 exp:4
79    } //indent:2 exp:2
80  
81    @Override //indent:2 exp:2
82    public void put(Range<K> range, V value) //indent:2 exp:2
83    { //indent:2 exp:2
84  
85    } //indent:2 exp:2
86  
87    @Override //indent:2 exp:2
88    public void putAll(RangeMap<K, V> rangeMap) //indent:2 exp:2
89    { //indent:2 exp:2
90  
91    } //indent:2 exp:2
92  
93    @Override //indent:2 exp:2
94    public void clear() //indent:2 exp:2
95    { //indent:2 exp:2
96  
97    } //indent:2 exp:2
98  
99    @Override //indent:2 exp:2
100   public void remove(Range<K> range) //indent:2 exp:2
101   { //indent:2 exp:2
102 
103   } //indent:2 exp:2
104 
105   @Override //indent:2 exp:2
106   public Map<Range<K>, V> asMapOfRanges() //indent:2 exp:2
107   { //indent:2 exp:2
108     return null; //indent:4 exp:4
109   } //indent:2 exp:2
110 
111   @Override //indent:2 exp:2
112   public RangeMap<K, V> subRangeMap(Range<K> range) //indent:2 exp:2
113   { //indent:2 exp:2
114     return null; //indent:4 exp:4
115   } //indent:2 exp:2
116 
117   @Override //indent:2 exp:2
118   public Entry<Range<K>, V> getEntry(K key) //indent:2 exp:2
119   { //indent:2 exp:2
120     return null; //indent:4 exp:4
121   } //indent:2 exp:2
122 
123   private static class SortedLists { //indent:2 exp:2
124     public static int binarySearch() { return 4; } //indent:4 exp:4
125   } //indent:2 exp:2
126 } //indent:0 exp:0