Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2014 Attila Szegedi, Daniel Dekany, Jonathan Revusky
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package freemarker.core;
This is the model used for right-unbounded ranges since Incompatible Improvements 2.3.21.

Since:
2.3.21
    ListableRightUnboundedRangeModel(int begin) {
        super(begin);
    }
    public int size() throws TemplateModelException {
        return .;
    }
        return new TemplateModelIterator() {
            boolean needInc;
            int nextType = 1;
            int nextInt = getBegining();
            long nextLong;
            BigInteger nextBigInteger;
            public TemplateModel next() throws TemplateModelException {
                if () {
                    switch () {
                    case 1:
                        if ( < .) {
                            ++;
                        } else {
                             = 2;
                             =  + 1L;
                        }
                        break;
                        
                    case 2:
                        if ( < .) {
                            ++;
                        } else {
                             = 3;
                             = BigInteger.valueOf();
                             = .add(.);
                        }
                        break;
                        
                    default// 3
                         = .add(.);
                    }
                }
                 = true;
                return  == 1 ? new SimpleNumber()
                        : ( == 2 ? new SimpleNumber()
                        : new SimpleNumber()); 
            }
            public boolean hasNext() throws TemplateModelException {
                return true;
            }
            
        };
        
    }
    
New to GrepCode? Check out our FAQ X