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



title
5.6.1.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())       |
{                                       |
    
...                                 |
}                                       |



Wrap conditional expressions

Wrap conditional expressions

Controls how to wrap conditional expressions.


Never wrap conditional operators:

if ((condition1 && condition2) || (condition3 && condition4) ||!(condition5 && condition6)) {
    callMethod();
                                                     |
}                                                                     |


Wrap conditional operators on demand:

if ((condition1 && condition2) || (condition3 && condition4)          |
        
||!(condition5 && condition6)) {                              |
    
callMethod();                                                     |
}                                                                     |


Wrap conditional operators if line exceeds:

if ((condition1 && condition2)                                        |
        
|| (condition3 && condition4)                                 |
        
||!(condition5 && condition6)) {                              |
    
callMethod();                                                     |
}                                                                     |


Always wrap conditional operators:

if ((condition1 && condition2)                                        |
        
|| (condition3 && condition4)                                 |
        
||!(condition5 && condition6)) {                              |
    
callMethod();                                                     |
}                                                                     |



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);           |



Wrap after assignments = on demand

Wrap after assignments = on demand

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();
}
                                                           |