Jindent - Java Source Code Formatter http://www.jindent.com
 



title
5.6.2.9.2 Operators

Conditional operators: && ||

Conditional operators: && ||

Determines whether line breaks are proceed before or after conditional operators.


Wrap before conditional operators:

if (conditionA() && conditionB()        |
    
&& conditionC() && conditionD())    |
{                                       |
    
...                                 |
}                                       |


Wrap after conditional operators:

if (conditionA() && conditionB() &&     |
    
conditionC() && conditionD())       |
{                                       |
    
...                                 |
}                                       |



Comparison operators: < > == != ...

Comparison operators: < > == != ...

Determines whether line breaks are proceed before or after comparison operators.


Wrap before comparison operators:

if (functionA(a, b, c, d, e)            |
    
< functionB(f, g, h, i, j))         |
{                                       |
    
...                                 |
}                                       |


Wrap after comparison operators:

if (functionA(a, b, c, d, e) <          |
    
functionB(f, g, h, i, j))           |
{                                       |
    
...                                 |
}                                       |



Numerical operators: + - * / % & | << >> ...

Numerical operators: + - * / % & | << >> ...

Determines whether line breaks are proceed before or after numerical operators.


Wrap before numerical operators:

x = (y * 100) + 42       |
    
+ (100 - z);         |


Wrap after numerical operators:

x = (y * 100) + 42 +     |
    
(100 - z);           |



Input/Output operators: << >>

Input/Output operators: << >>

Determines whether line breaks are proceed before or after input/output operators.


Wrap before input/output operators:

std::cout << "This is a simple program that outputs some text." << std::endl    |
          
<< "You can output more lines of text" << std::endl                   |
          
<< "just by repeating the output statement like this." << std::endl;  |
                                                                                |


Wrap after input/output operators:

std::cout << "This is a simple program that outputs some text." << std::endl << |
             
"You can output more lines of text" << std::endl <<                |
             
"just by repeating the output statement like this." << std::endl;  |



Allow wrapping after assignments =

Allow wrapping after assignments =

Determines whether line breaks are allowed after assignments or not.


Allow wrapping after assignments:

if (x == 0                                                |
{                                                           |
    
myNewValue =                                            |
         
new aVeryLongConstructorWhichIsNotEasyToWrap();    |
}                                                           |


Do not allow wrapping after assignments:

if (x == 0                                                |
{                                                           |
    
myNewValue = new aVeryLongConstructorWhichIsNotEasyToWrap();
}
                                                           |