org.aspectj.org.eclipse.jdt.internal.formatter.align
Class Alignment

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.formatter.align.Alignment

public class Alignment
extends java.lang.Object

Alignment management

Since:
2.1

Field Summary
static int ALLOCATION
           
static int ANNOTATION_MEMBERS_VALUE_PAIRS
           
static int ARRAY_INITIALIZER
           
static int ASSIGNMENT
           
static int BINARY_EXPRESSION
           
 boolean blockAlign
           
static int BREAK
           
 int breakIndentationLevel
           
static int CASCADING_MESSAGE_SEND
           
static int CHUNK_ENUM
           
static int CHUNK_FIELD
           
static int CHUNK_METHOD
           
static int CHUNK_TYPE
           
 int chunkKind
           
 int chunkStartIndex
           
static int COMPACT_IF
           
static int COMPOUND_ASSIGNMENT
           
static int CONDITIONAL_EXPRESSION
           
 Alignment enclosing
           
static int ENUM_CONSTANTS
           
static int ENUM_CONSTANTS_ARGUMENTS
           
static int EXPLICIT_CONSTRUCTOR_CALL
           
static int FIELD_DECLARATION_ASSIGNMENT
           
 int[] fragmentBreaks
           
 int fragmentCount
           
 int[] fragmentIndentations
           
 int fragmentIndex
           
 int kind
           
static int LOCAL_DECLARATION_ASSIGNMENT
           
 Location location
           
static int M_COMPACT_FIRST_BREAK_SPLIT
          foobar( #fragment1, #fragment2, #fragment5, #fragment4,
static int M_COMPACT_SPLIT
          foobar(#fragment1, #fragment2, #fragment3, #fragment4
static int M_FORCE
           
static int M_INDENT_BY_ONE
           
static int M_INDENT_ON_COLUMN
           
static int M_MULTICOLUMN
           #fragment1A #fragment2A #fragment3A #very-long-fragment4A #fragment1B #long-fragment2B #fragment3B #fragment4B #very-long-fragment1C #fragment2C #fragment3C #fragment4C
static int M_NEXT_PER_LINE_SPLIT
          foobar(#fragment1, #fragment2, #fragment3 #fragment4,
static int M_NEXT_SHIFTED_SPLIT
          foobar( #fragment1, #fragment2, #fragment3 #fragment4,
static int M_NO_ALIGNMENT
           
static int M_ONE_PER_LINE_SPLIT
          foobar( #fragment1, #fragment2, #fragment3 #fragment4,
static int MESSAGE_ARGUMENTS
           
static int MESSAGE_SEND
           
static int METHOD_ARGUMENTS
           
static int METHOD_DECLARATION
           
 int mode
           
static int MULTI_CATCH
           
static int MULTIPLE_FIELD
           
 java.lang.String name
           
static java.lang.String[] NAMES
           
 boolean needRedoColumnAlignment
           
static int NONE
           
 int originalIndentationLevel
           
static int R_INNERMOST
           
static int R_OUTERMOST
           
 Scribe scribe
           
 int shiftBreakIndentationLevel
           
static int SPLIT_MASK
           
 int startingColumn
           
static int STRING_CONCATENATION
           
static int SUPER_CLASS
           
static int SUPER_INTERFACES
           
static int THROWS
           
 int tieBreakRule
           
 boolean tooLong
           
static int TRY_RESOURCES
           
static int TYPE_MEMBERS
           
 boolean wasSplit
           
 
Constructor Summary
Alignment(int kind, int mode, int tieBreakRule, Scribe scribe, int fragmentCount, int sourceRestart, int continuationIndent)
           
 
Method Summary
 boolean canAlign()
          Returns whether the alignment can be aligned or not.
 boolean checkChunkStart(int chunk, int startIndex, int sourceRestart)
           
 void checkColumn()
           
 boolean couldBreak()
           
 int depth()
           
 boolean isWrapped()
           
 void performFragmentEffect()
           
 void reset()
           
 void toFragmentsString(java.lang.StringBuffer buffer)
           
 java.lang.String toString()
           
 java.lang.String toString(java.lang.StringBuffer buffer, int level)
           
 void update()
           
 boolean wasReset()
           
 int wrappedIndex()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kind

public int kind

ALLOCATION

public static final int ALLOCATION
See Also:
Constant Field Values

ANNOTATION_MEMBERS_VALUE_PAIRS

public static final int ANNOTATION_MEMBERS_VALUE_PAIRS
See Also:
Constant Field Values

ARRAY_INITIALIZER

public static final int ARRAY_INITIALIZER
See Also:
Constant Field Values

ASSIGNMENT

public static final int ASSIGNMENT
See Also:
Constant Field Values

BINARY_EXPRESSION

public static final int BINARY_EXPRESSION
See Also:
Constant Field Values

CASCADING_MESSAGE_SEND

public static final int CASCADING_MESSAGE_SEND
See Also:
Constant Field Values

COMPACT_IF

public static final int COMPACT_IF
See Also:
Constant Field Values

COMPOUND_ASSIGNMENT

public static final int COMPOUND_ASSIGNMENT
See Also:
Constant Field Values

CONDITIONAL_EXPRESSION

public static final int CONDITIONAL_EXPRESSION
See Also:
Constant Field Values

ENUM_CONSTANTS

public static final int ENUM_CONSTANTS
See Also:
Constant Field Values

ENUM_CONSTANTS_ARGUMENTS

public static final int ENUM_CONSTANTS_ARGUMENTS
See Also:
Constant Field Values

EXPLICIT_CONSTRUCTOR_CALL

public static final int EXPLICIT_CONSTRUCTOR_CALL
See Also:
Constant Field Values

FIELD_DECLARATION_ASSIGNMENT

public static final int FIELD_DECLARATION_ASSIGNMENT
See Also:
Constant Field Values

LOCAL_DECLARATION_ASSIGNMENT

public static final int LOCAL_DECLARATION_ASSIGNMENT
See Also:
Constant Field Values

MESSAGE_ARGUMENTS

public static final int MESSAGE_ARGUMENTS
See Also:
Constant Field Values

MESSAGE_SEND

public static final int MESSAGE_SEND
See Also:
Constant Field Values

METHOD_ARGUMENTS

public static final int METHOD_ARGUMENTS
See Also:
Constant Field Values

METHOD_DECLARATION

public static final int METHOD_DECLARATION
See Also:
Constant Field Values

MULTIPLE_FIELD

public static final int MULTIPLE_FIELD
See Also:
Constant Field Values

SUPER_CLASS

public static final int SUPER_CLASS
See Also:
Constant Field Values

SUPER_INTERFACES

public static final int SUPER_INTERFACES
See Also:
Constant Field Values

THROWS

public static final int THROWS
See Also:
Constant Field Values

TYPE_MEMBERS

public static final int TYPE_MEMBERS
See Also:
Constant Field Values

STRING_CONCATENATION

public static final int STRING_CONCATENATION
See Also:
Constant Field Values

TRY_RESOURCES

public static final int TRY_RESOURCES
See Also:
Constant Field Values

MULTI_CATCH

public static final int MULTI_CATCH
See Also:
Constant Field Values

name

public java.lang.String name

NAMES

public static final java.lang.String[] NAMES

enclosing

public Alignment enclosing

location

public Location location

fragmentIndex

public int fragmentIndex

fragmentCount

public int fragmentCount

fragmentIndentations

public int[] fragmentIndentations

needRedoColumnAlignment

public boolean needRedoColumnAlignment

chunkStartIndex

public int chunkStartIndex

chunkKind

public int chunkKind

originalIndentationLevel

public int originalIndentationLevel

breakIndentationLevel

public int breakIndentationLevel

shiftBreakIndentationLevel

public int shiftBreakIndentationLevel

fragmentBreaks

public int[] fragmentBreaks

wasSplit

public boolean wasSplit

blockAlign

public boolean blockAlign

tooLong

public boolean tooLong

scribe

public Scribe scribe

M_FORCE

public static final int M_FORCE
See Also:
Constant Field Values

M_INDENT_ON_COLUMN

public static final int M_INDENT_ON_COLUMN
See Also:
Constant Field Values

M_INDENT_BY_ONE

public static final int M_INDENT_BY_ONE
See Also:
Constant Field Values

M_COMPACT_SPLIT

public static final int M_COMPACT_SPLIT
foobar(#fragment1, #fragment2,
  • #fragment3, #fragment4

See Also:
Constant Field Values

M_COMPACT_FIRST_BREAK_SPLIT

public static final int M_COMPACT_FIRST_BREAK_SPLIT
foobar(
  • #fragment1, #fragment2,
  • #fragment5, #fragment4,

See Also:
Constant Field Values

M_ONE_PER_LINE_SPLIT

public static final int M_ONE_PER_LINE_SPLIT
foobar(
  • #fragment1,
  • #fragment2,
  • #fragment3
  • #fragment4,

See Also:
Constant Field Values

M_NEXT_SHIFTED_SPLIT

public static final int M_NEXT_SHIFTED_SPLIT
foobar(
  • #fragment1,
  • #fragment2,
  • #fragment3
  • #fragment4,

See Also:
Constant Field Values

M_NEXT_PER_LINE_SPLIT

public static final int M_NEXT_PER_LINE_SPLIT
foobar(#fragment1,
  • #fragment2,
  • #fragment3
  • #fragment4,

See Also:
Constant Field Values

M_MULTICOLUMN

public static final int M_MULTICOLUMN
#fragment1A #fragment2A #fragment3A #very-long-fragment4A
#fragment1B #long-fragment2B #fragment3B #fragment4B
#very-long-fragment1C #fragment2C #fragment3C #fragment4C

See Also:
Constant Field Values

M_NO_ALIGNMENT

public static final int M_NO_ALIGNMENT
See Also:
Constant Field Values

mode

public int mode

SPLIT_MASK

public static final int SPLIT_MASK
See Also:
Constant Field Values

R_OUTERMOST

public static final int R_OUTERMOST
See Also:
Constant Field Values

R_INNERMOST

public static final int R_INNERMOST
See Also:
Constant Field Values

tieBreakRule

public int tieBreakRule

startingColumn

public int startingColumn

NONE

public static final int NONE
See Also:
Constant Field Values

BREAK

public static final int BREAK
See Also:
Constant Field Values

CHUNK_FIELD

public static final int CHUNK_FIELD
See Also:
Constant Field Values

CHUNK_METHOD

public static final int CHUNK_METHOD
See Also:
Constant Field Values

CHUNK_TYPE

public static final int CHUNK_TYPE
See Also:
Constant Field Values

CHUNK_ENUM

public static final int CHUNK_ENUM
See Also:
Constant Field Values
Constructor Detail

Alignment

public Alignment(int kind,
                 int mode,
                 int tieBreakRule,
                 Scribe scribe,
                 int fragmentCount,
                 int sourceRestart,
                 int continuationIndent)
Method Detail

checkChunkStart

public boolean checkChunkStart(int chunk,
                               int startIndex,
                               int sourceRestart)

checkColumn

public void checkColumn()

depth

public int depth()

canAlign

public boolean canAlign()
Returns whether the alignment can be aligned or not. Only used for message send alignment, it currently blocks its alignment when it's at the first nesting level of a message send. It allow to save space on the argument broken line by reducing the number of indentations.


couldBreak

public boolean couldBreak()

isWrapped

public boolean isWrapped()

wrappedIndex

public int wrappedIndex()

performFragmentEffect

public void performFragmentEffect()

reset

public void reset()

toFragmentsString

public void toFragmentsString(java.lang.StringBuffer buffer)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.StringBuffer buffer,
                                 int level)

update

public void update()

wasReset

public boolean wasReset()