de.uni_paderborn.fujaba.codegen
Class OOGenToken

java.lang.Object
  extended byde.uni_paderborn.fujaba.codegen.OOGenToken

public class OOGenToken
extends java.lang.Object

Associations

             0..1                             0..1
 OOGenToken --------------------------------------- ASGElement
             firstOOGenToken     firstAsgElement

             0..1                           0..1
 OOGenToken ------------------------------------- ASGElement
             lastOOGenToken     lastAsgElement

              n      hasStatements      0..1
 OOStatement -------------------------------- OOGenToken
              statement   {ordered,}   token

             0..1                       0..1
 OOGenToken --------------------------------- OOGenToken
             prev                       next
 

Version:
$Revision: 1.26.2.1 $
Author:
$Author: creckord $

Field Summary
static int FILEFOOT
          No comment provided by developer, please add a comment to improve documentation.
static int FILEHEADER
          No comment provided by developer, please add a comment to improve documentation.
static int FIRST
          No comment provided by developer, please add a comment to improve documentation.
static int LAST
          No comment provided by developer, please add a comment to improve documentation.
static int UNUSED
          No comment provided by developer, please add a comment to improve documentation.
 
Constructor Summary
OOGenToken()
          Constructor for class OOGenToken
OOGenToken(OOStatement statement)
          Constructor for class OOGenToken
OOGenToken(OOStatement statement, java.lang.String sectionName)
          Constructor for class OOGenToken
 
Method Summary
 boolean addToStatement(OOStatement value)
           
 void append(OOGenToken newToken)
          Inserts the new token behind me. before: prevElement <---> this <---> nextElement after : prevElement <---> this <---> newToken <---> nextElement
 void appendStatement(java.lang.Object value)
          No comment provided by developer, please add a comment to improve documentation.
 boolean appendStatement(OOStatement value)
           
 void appendStatement(OOStatement[] values)
          append all statements
static OOGenToken createFirstToken()
          No comment provided by developer, please add a comment to improve documentation.
static OOGenToken createGeneratedToken()
          No comment provided by developer, please add a comment to improve documentation.
static OOGenToken createLastToken()
          No comment provided by developer, please add a comment to improve documentation.
static OOGenToken createNewList(OOGenToken prevToken)
          Creates a new token pair for with explicite first and last token and inserts it in the list behind prevToken before: prevElement <---> nextElement after : prevElement <---> this <---> nextElement
static void cutAndPaste(OOGenToken firstToken, OOGenToken lastToken, OOGenToken prevToken)
          Cuts all tokens from firstToken to lastToken out of the list and inserts them behind prevToken.
 void deleteToSection(java.lang.String sectionName, OOGenToken lastToken)
          Returns the token in front of the specified section and deletes all tokens on the way are deleted.
 OOGenToken findSection(java.lang.String sectionName)
          No comment provided by developer, please add a comment to improve documentation.
 OOGenToken getBottomToken(java.lang.String sectionName)
          Get the bottomToken attribute of the OOGenToken object
 ASGElement getFirstAsgElement()
           
 OOStatement getFirstOfStatement()
           
 ASGElement getLastAsgElement()
           
 OOStatement getLastOfStatement()
           
 OOGenToken getNext()
          Get the next attribute of the OOGenToken object
 OOStatement getNextIndexOfStatement(OOStatement object, int index)
           
 OOStatement getNextOfStatement(OOStatement object)
           
 OOGenToken getNextOrAppend(java.lang.String sectionName, OOGenToken lastToken)
          Gets the next token in the section or creates a new one behind me.
 OOGenToken getPrev()
          Get the prev attribute of the OOGenToken object
 OOStatement getPreviousIndexOfStatement(OOStatement object, int index)
           
 OOStatement getPreviousOfStatement(OOStatement object)
           
 java.lang.String getSectionName()
          Get the sectionName attribute of the OOGenToken object
 java.lang.String getSourceCode()
          Get the sourceCode attribute of the OOGenToken object
static java.lang.String getSourceCodeForTokens(OOGenToken token, OOGenToken stop)
          Get the sourceCodeForTokens attribute of the OOGenToken class
 int getStartColumn()
          Get the startColumn attribute of the OOGenToken object
 int getStartRow()
          Get the startRow attribute of the OOGenToken object
 OOStatement getStatementAt(int index)
           
 OOGenToken getTopToken(java.lang.String sectionName)
          Get the topToken attribute of the OOGenToken object
 boolean hasInStatement(OOStatement value)
           
 int indexOfStatement(OOStatement elem)
           
 OOGenToken insertNewToken(java.lang.String sectionName)
          No comment provided by developer, please add a comment to improve documentation.
 java.lang.String insertTopAndBottomToken(java.lang.String sectionName)
          Creates two new tokens behind the current and sets the section name of the first to 'sectionName'Top and of the last to 'sectionName'Bottom.
 boolean isAfterOfStatement(OOStatement leftObject, OOStatement rightObject)
           
 boolean isBeforeOfStatement(OOStatement leftObject, OOStatement rightObject)
           
 boolean isFirstToken()
          Get the firstToken attribute of the OOGenToken object
 boolean isLastToken()
          Get the lastToken attribute of the OOGenToken object
 java.util.Iterator iteratorOfStatement()
           
 java.util.Iterator iteratorOfStatement(OOStatement lowerBound)
           
 int lastIndexOfStatement(OOStatement elem)
           
 java.lang.String newSection(java.lang.String section, OOGenToken lastToken)
          Starts the new section
 void prepend(OOGenToken newToken)
          Inserts the new token in front of me. before: prevElement <---> this <---> nextElement after : prevElement <---> newToken <---> this <---> nextElement
 boolean prependStatement(OOStatement value)
           
 void removeAllFromStatement()
           
 boolean removeFromStatement(OOStatement value)
           
 void removeYou()
          Isolates the object so the garbage collector can remove it.
 void removeYouFromList()
          Removes this element from the list. before: prevElement <---> this <---> nextElement after : prevElement <--------------> nextElement this
 boolean setFirstAsgElement(ASGElement value)
           
 boolean setLastAsgElement(ASGElement value)
           
 void setNext(OOGenToken next)
          Sets the next attribute of the OOGenToken object
 void setPrev(OOGenToken prev)
          Sets the prev attribute of the OOGenToken object
 java.lang.String setSectionName(java.lang.String sectionName)
          Sets the sectionName attribute of the OOGenToken object
 int setStartColumn(int startColumn)
          Sets the startColumn attribute of the OOGenToken object
 int setStartRow(int startRow)
          Sets the startRow attribute of the OOGenToken object
 void showStatements()
          No comment provided by developer, please add a comment to improve documentation.
static void showStatements(OOGenToken token)
          No comment provided by developer, please add a comment to improve documentation.
 int sizeOfStatement()
           
 OOGenToken skipSection(java.lang.String sectionName, OOGenToken lastToken)
          Return the last token of the section named sectionName.
 OOGenToken skipToPrevNextFirstToken(OOGenToken lastToken)
          Returns the token just in front of the next Firsttoken or in front of the lastToken.
 java.lang.String toString()
           
 java.lang.String toString(int width)
          No comment provided by developer, please add a comment to improve documentation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIRST

public static final transient int FIRST
No comment provided by developer, please add a comment to improve documentation.

See Also:
Constant Field Values

LAST

public static final transient int LAST
No comment provided by developer, please add a comment to improve documentation.

See Also:
Constant Field Values

UNUSED

public static final transient int UNUSED
No comment provided by developer, please add a comment to improve documentation.

See Also:
Constant Field Values

FILEHEADER

public static final transient int FILEHEADER
No comment provided by developer, please add a comment to improve documentation.

See Also:
Constant Field Values

FILEFOOT

public static final transient int FILEFOOT
No comment provided by developer, please add a comment to improve documentation.

See Also:
Constant Field Values
Constructor Detail

OOGenToken

public OOGenToken()
Constructor for class OOGenToken


OOGenToken

public OOGenToken(OOStatement statement)
Constructor for class OOGenToken

Parameters:
statement - No description provided

OOGenToken

public OOGenToken(OOStatement statement,
                  java.lang.String sectionName)
Constructor for class OOGenToken

Parameters:
statement - No description provided
sectionName - No description provided
Method Detail

isFirstToken

public boolean isFirstToken()
Get the firstToken attribute of the OOGenToken object

Returns:
The firstToken value

isLastToken

public boolean isLastToken()
Get the lastToken attribute of the OOGenToken object

Returns:
The lastToken value

createFirstToken

public static final OOGenToken createFirstToken()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

createLastToken

public static final OOGenToken createLastToken()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

createGeneratedToken

public static final OOGenToken createGeneratedToken()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

createNewList

public static OOGenToken createNewList(OOGenToken prevToken)
Creates a new token pair for with explicite first and last token and inserts it in the list behind prevToken before: prevElement <---> nextElement after : prevElement <---> this <---> nextElement

Parameters:
prevToken - indicates the position in the list
Returns:
the first token
See Also:
append(de.uni_paderborn.fujaba.codegen.OOGenToken), prepend(de.uni_paderborn.fujaba.codegen.OOGenToken)

showStatements

public static void showStatements(OOGenToken token)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
token - No description provided

showStatements

public void showStatements()
No comment provided by developer, please add a comment to improve documentation.


getSourceCode

public java.lang.String getSourceCode()
Get the sourceCode attribute of the OOGenToken object

Returns:
The sourceCode value

getSourceCodeForTokens

public static java.lang.String getSourceCodeForTokens(OOGenToken token,
                                                      OOGenToken stop)
Get the sourceCodeForTokens attribute of the OOGenToken class

Parameters:
token - No description provided
stop - No description provided
Returns:
The sourceCodeForTokens value

getSectionName

public java.lang.String getSectionName()
Get the sectionName attribute of the OOGenToken object

Returns:
The sectionName value

setSectionName

public java.lang.String setSectionName(java.lang.String sectionName)
Sets the sectionName attribute of the OOGenToken object

Parameters:
sectionName - The new sectionName value
Returns:
No description provided

toString

public java.lang.String toString(int width)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
width - No description provided
Returns:
No description provided

getStartRow

public int getStartRow()
Get the startRow attribute of the OOGenToken object

Returns:
The startRow value

setStartRow

public int setStartRow(int startRow)
Sets the startRow attribute of the OOGenToken object

Parameters:
startRow - The new startRow value
Returns:
No description provided

getStartColumn

public int getStartColumn()
Get the startColumn attribute of the OOGenToken object

Returns:
The startColumn value

setStartColumn

public int setStartColumn(int startColumn)
Sets the startColumn attribute of the OOGenToken object

Parameters:
startColumn - The new startColumn value
Returns:
No description provided

getPrev

public OOGenToken getPrev()
Get the prev attribute of the OOGenToken object

Returns:
The prev value

setPrev

public void setPrev(OOGenToken prev)
Sets the prev attribute of the OOGenToken object

Parameters:
prev - The new prev value

getNext

public OOGenToken getNext()
Get the next attribute of the OOGenToken object

Returns:
The next value

setNext

public void setNext(OOGenToken next)
Sets the next attribute of the OOGenToken object

Parameters:
next - The new next value

setFirstAsgElement

public boolean setFirstAsgElement(ASGElement value)
Parameters:
value - The new firstAsgElement value
Returns:
No description provided
See Also:
#firstAsgElement

getFirstAsgElement

public ASGElement getFirstAsgElement()
Returns:
The firstAsgElement value
See Also:
#firstAsgElement

setLastAsgElement

public boolean setLastAsgElement(ASGElement value)
Parameters:
value - The new lastAsgElement value
Returns:
No description provided
See Also:
#lastAsgElement

getLastAsgElement

public ASGElement getLastAsgElement()
Returns:
The lastAsgElement value
See Also:
#lastAsgElement

hasInStatement

public boolean hasInStatement(OOStatement value)
Parameters:
value - No description provided
Returns:
No description provided
See Also:
#statement

iteratorOfStatement

public java.util.Iterator iteratorOfStatement()
Returns:
No description provided
See Also:
#statement

sizeOfStatement

public int sizeOfStatement()
Returns:
No description provided
See Also:
#statement

addToStatement

public boolean addToStatement(OOStatement value)
Parameters:
value - The object added.
Returns:
No description provided
See Also:
#statement

prependStatement

public boolean prependStatement(OOStatement value)
Parameters:
value - No description provided
Returns:
No description provided
See Also:
#statement

appendStatement

public void appendStatement(java.lang.Object value)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
value - No description provided

appendStatement

public void appendStatement(OOStatement[] values)
append all statements

Parameters:
values - an OOStatement[] value

appendStatement

public boolean appendStatement(OOStatement value)
Parameters:
value - No description provided
Returns:
No description provided
See Also:
#statement

removeFromStatement

public boolean removeFromStatement(OOStatement value)
Parameters:
value - No description provided
Returns:
No description provided
See Also:
#statement

removeAllFromStatement

public void removeAllFromStatement()
See Also:
#statement

getStatementAt

public OOStatement getStatementAt(int index)
Parameters:
index - No description provided
Returns:
The statementAt value
See Also:
#statement

indexOfStatement

public int indexOfStatement(OOStatement elem)
Parameters:
elem - No description provided
Returns:
No description provided
See Also:
#statement

lastIndexOfStatement

public int lastIndexOfStatement(OOStatement elem)
Parameters:
elem - No description provided
Returns:
No description provided
See Also:
#statement

iteratorOfStatement

public java.util.Iterator iteratorOfStatement(OOStatement lowerBound)
Parameters:
lowerBound - No description provided
Returns:
No description provided
See Also:
#statement

isBeforeOfStatement

public boolean isBeforeOfStatement(OOStatement leftObject,
                                   OOStatement rightObject)
Parameters:
leftObject - No description provided
rightObject - No description provided
Returns:
The beforeOfStatement value
See Also:
#statement

isAfterOfStatement

public boolean isAfterOfStatement(OOStatement leftObject,
                                  OOStatement rightObject)
Parameters:
leftObject - No description provided
rightObject - No description provided
Returns:
The afterOfStatement value
See Also:
#statement

getFirstOfStatement

public OOStatement getFirstOfStatement()
Returns:
The firstOfStatement value
See Also:
#statement

getLastOfStatement

public OOStatement getLastOfStatement()
Returns:
The lastOfStatement value
See Also:
#statement

getNextOfStatement

public OOStatement getNextOfStatement(OOStatement object)
Parameters:
object - No description provided
Returns:
The nextOfStatement value
See Also:
#statement

getNextIndexOfStatement

public OOStatement getNextIndexOfStatement(OOStatement object,
                                           int index)
Parameters:
object - No description provided
index - No description provided
Returns:
The nextIndexOfStatement value
See Also:
#statement

getPreviousOfStatement

public OOStatement getPreviousOfStatement(OOStatement object)
Parameters:
object - No description provided
Returns:
The previousOfStatement value
See Also:
#statement

getPreviousIndexOfStatement

public OOStatement getPreviousIndexOfStatement(OOStatement object,
                                               int index)
Parameters:
object - No description provided
index - No description provided
Returns:
The previousIndexOfStatement value
See Also:
#statement

findSection

public OOGenToken findSection(java.lang.String sectionName)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
sectionName - No description provided
Returns:
No description provided

skipSection

public OOGenToken skipSection(java.lang.String sectionName,
                              OOGenToken lastToken)
Return the last token of the section named sectionName.

Parameters:
sectionName - the name of the new section
lastToken - marks the end
Returns:
the last token of the section

skipToPrevNextFirstToken

public OOGenToken skipToPrevNextFirstToken(OOGenToken lastToken)
Returns the token just in front of the next Firsttoken or in front of the lastToken.

Parameters:
lastToken - marks the end
Returns:
the new position

deleteToSection

public void deleteToSection(java.lang.String sectionName,
                            OOGenToken lastToken)
Returns the token in front of the specified section and deletes all tokens on the way are deleted.

Parameters:
sectionName - the name of the new section
lastToken - the last token in the current list

newSection

public java.lang.String newSection(java.lang.String section,
                                   OOGenToken lastToken)
Starts the new section

Parameters:
section - the name of the new section
lastToken - the last token of the list
Returns:
the sections name

insertTopAndBottomToken

public java.lang.String insertTopAndBottomToken(java.lang.String sectionName)
Creates two new tokens behind the current and sets the section name of the first to 'sectionName'Top and of the last to 'sectionName'Bottom.

Parameters:
sectionName - the name of the section
Returns:
the sections name

getTopToken

public OOGenToken getTopToken(java.lang.String sectionName)
Get the topToken attribute of the OOGenToken object

Parameters:
sectionName - No description provided
Returns:
The topToken value

getBottomToken

public OOGenToken getBottomToken(java.lang.String sectionName)
Get the bottomToken attribute of the OOGenToken object

Parameters:
sectionName - No description provided
Returns:
The bottomToken value

insertNewToken

public OOGenToken insertNewToken(java.lang.String sectionName)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
sectionName - No description provided
Returns:
No description provided

getNextOrAppend

public OOGenToken getNextOrAppend(java.lang.String sectionName,
                                  OOGenToken lastToken)
Gets the next token in the section or creates a new one behind me. This method is useful because at many times you need it. For example see generateJava() methods.

Parameters:
sectionName - the name of the section
lastToken - the last token in the current list
Returns:
the next token if exists or a new one

cutAndPaste

public static void cutAndPaste(OOGenToken firstToken,
                               OOGenToken lastToken,
                               OOGenToken prevToken)
Cuts all tokens from firstToken to lastToken out of the list and inserts them behind prevToken.

Parameters:
firstToken - marks the first token in the list
lastToken - marks the last token in the list
prevToken - marks the new position for the list

append

public void append(OOGenToken newToken)
Inserts the new token behind me. before: prevElement <---> this <---> nextElement after : prevElement <---> this <---> newToken <---> nextElement

Parameters:
newToken - the new token to insert in the list

prepend

public void prepend(OOGenToken newToken)
Inserts the new token in front of me. before: prevElement <---> this <---> nextElement after : prevElement <---> newToken <---> this <---> nextElement

Parameters:
newToken - the new token to insert in the list

removeYouFromList

public void removeYouFromList()
Removes this element from the list. before: prevElement <---> this <---> nextElement after : prevElement <--------------> nextElement this


toString

public java.lang.String toString()
Returns:
short string representation of current object

removeYou

public void removeYou()
Isolates the object so the garbage collector can remove it.