Java Doc for ReducedModelBrace.java in  » IDE » DrJava » edu » rice » cs » drjava » model » definitions » reducedmodel » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE » DrJava » edu.rice.cs.drjava.model.definitions.reducedmodel 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.rice.cs.drjava.model.definitions.reducedmodel.AbstractReducedModel
      edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelBrace

ReducedModelBrace
public class ReducedModelBrace extends AbstractReducedModel (Code)
Keeps track of the true braces (i.e., "() {}[]"). This reduced sub-model is used to balance braces for both indenting and highlighting purposes. For example, when the user's caret is immediately after a closing brace, this allows the DefinitionsPane to produced a highlight extending from the closing brace to its match.
version:
   $Id: ReducedModelBrace.java 4255 2007-08-28 19:17:37Z mgricken $
author:
   JavaPLT



Constructor Summary
public  ReducedModelBrace(ReducedModelControl parent)
    

Method Summary
public  intbalanceBackward()
    
public  intbalanceForward()
     If the current ReducedToken is an open significant brace and the offset is 0 (i.e., if we're immediately left of said brace), push the current Brace onto a Stack and iterate forwards, keeping track of the distance covered. - For every closed significant Brace, if it matches the top of the Stack, pop the Stack.
public  booleanclosedBraceImmediatelyLeft()
    
public  voiddelete(int count)
     Updates ReducedModelBrace to reflect text deletion. Negative values mean text left of the cursor, positive values mean text to the right.
protected  voidgetDistToEnclosingBrace(IndentInfo braceInfo)
     Finds distance to enclosing brace on a preceding line.
protected  voidgetDistToEnclosingBraceCurrent(IndentInfo braceInfo)
     Find the enclosing brace enclosing our current location.
public  voidinsertChar(char ch)
    
protected  voidinsertGapBetweenMultiCharBrace(int length)
     Inserts a gap between the characters in a multiple character brace.
public  voidmove(int count)
     Updates ReducedModelBrace to reflect cursor movement. Negative values move left from the cursor, positive values move right.
protected  ReducedModelStatemoveWalkerGetState(int relDistance)
    
public  intnextBrace()
     Goes to the location before the brace.
public  booleanopenBraceImmediatelyLeft()
    
public  intpreviousBrace()
     Returns distance from current location of cursor to the location of the previous significant brace. ex.
protected  voidresetWalkerLocationToCursor()
    


Constructor Detail
ReducedModelBrace
public ReducedModelBrace(ReducedModelControl parent)(Code)




Method Detail
balanceBackward
public int balanceBackward()(Code)



balanceForward
public int balanceForward()(Code)
If the current ReducedToken is an open significant brace and the offset is 0 (i.e., if we're immediately left of said brace), push the current Brace onto a Stack and iterate forwards, keeping track of the distance covered. - For every closed significant Brace, if it matches the top of the Stack, pop the Stack. Increase the distance by the size of the Brace. If the Stack is Empty, we have a balance. Return distance. If the closed Brace does not match the top of the Stack, return -1; We have an unmatched open Brace at the top of the Stack. - For every open significant Brace, push onto the Stack. Increase distance by size of the Brace, continue. - Anything else, increase distance by size of the ReducedToken, continue.



closedBraceImmediatelyLeft
public boolean closedBraceImmediatelyLeft()(Code)



delete
public void delete(int count)(Code)
Updates ReducedModelBrace to reflect text deletion. Negative values mean text left of the cursor, positive values mean text to the right. All functionality has been refactored into TokenList.



getDistToEnclosingBrace
protected void getDistToEnclosingBrace(IndentInfo braceInfo)(Code)
Finds distance to enclosing brace on a preceding line. The field braceInfo.distToNewline holds the distance to the previous newline. To find the enclosing brace one must first move past this newline. The distance held in this variable is only to the space in front of the newline hence you must move back that distance + 1.



getDistToEnclosingBraceCurrent
protected void getDistToEnclosingBraceCurrent(IndentInfo braceInfo)(Code)
Find the enclosing brace enclosing our current location.



insertChar
public void insertChar(char ch)(Code)



insertGapBetweenMultiCharBrace
protected void insertGapBetweenMultiCharBrace(int length)(Code)
Inserts a gap between the characters in a multiple character brace. However, since ReducedModelBrace doesn't keep track of the comment braces and escape sequences, we just throw an exception since the condition in insertGap that spawns this method doesn't arise.



move
public void move(int count)(Code)
Updates ReducedModelBrace to reflect cursor movement. Negative values move left from the cursor, positive values move right. All functionality has been refactored into TokenList.
Parameters:
  count - indicates the direction and magnitude of cursor movement



moveWalkerGetState
protected ReducedModelState moveWalkerGetState(int relDistance)(Code)



nextBrace
public int nextBrace()(Code)
Goes to the location before the brace. |...( where | is the cursor, returns three since it is three moves to the location of the ( NOTE: /|* returns the next brace. It does not return this brace because you are past it.



openBraceImmediatelyLeft
public boolean openBraceImmediatelyLeft()(Code)



previousBrace
public int previousBrace()(Code)
Returns distance from current location of cursor to the location of the previous significant brace. ex. (...|) where | signifies the cursor. previousBrace returns 4 because it goes to the spot behind the (. /|* returns this brace since you're in the middle of it and going backward can find it.



resetWalkerLocationToCursor
protected void resetWalkerLocationToCursor()(Code)



Fields inherited from edu.rice.cs.drjava.model.definitions.reducedmodel.AbstractReducedModel
final public static char PTR_CHAR(Code)(Java Doc)
TokenList.Iterator _cursor(Code)(Java Doc)
TokenList _tokens(Code)(Java Doc)

Methods inherited from edu.rice.cs.drjava.model.definitions.reducedmodel.AbstractReducedModel
protected void _augmentCurrentGap(int length)(Code)(Java Doc)
protected void _augmentGapToLeft(int length)(Code)(Java Doc)
protected boolean _gapToLeft()(Code)(Java Doc)
protected boolean _gapToRight()(Code)(Java Doc)
public void _insertGap(int length)(Code)(Java Doc)
protected void _insertNewGap(int length)(Code)(Java Doc)
int absOffset()(Code)(Java Doc)
protected ReducedToken current()(Code)(Java Doc)
int getBlockOffset()(Code)(Java Doc)
protected ReducedModelState getStateAtCurrent()(Code)(Java Doc)
abstract public void insertChar(char ch)(Code)(Java Doc)
abstract protected void insertGapBetweenMultiCharBrace(int length)(Code)(Java Doc)
public TokenList.Iterator makeCopyCursor()(Code)(Java Doc)
abstract protected ReducedModelState moveWalkerGetState(int relLocation)(Code)(Java Doc)
protected void next()(Code)(Java Doc)
protected void prev()(Code)(Java Doc)
abstract protected void resetWalkerLocationToCursor()(Code)(Java Doc)
void setBlockOffset(int offset)(Code)(Java Doc)
public String simpleString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

w_ww__.__j___a__va2__s___.c__om___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.