Java Doc for AbstractReducedModel.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

All known Subclasses:   edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelComment,  edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelBrace,
AbstractReducedModel
abstract public class AbstractReducedModel implements ReducedModelStates(Code)
A refactoring of the common code between ReducedModelComment and ReducedModelBrace. Both of the refactored classes extend this class.
version:
   $Id: AbstractReducedModel.java 4255 2007-08-28 19:17:37Z mgricken $
author:
   JavaPLT


Field Summary
final public static  charPTR_CHAR
     The character that represents the cursor in toString().
 TokenList.Iterator_cursor
     Keeps track of cursor position in document.
 TokenList_tokens
     The reduced model for a document is a list of ReducedTokens (braces and gaps).

Constructor Summary
public  AbstractReducedModel()
     Constructor.

Method Summary
protected  void_augmentCurrentGap(int length)
     Assuming there is a gap to the right, this function increases the size of that gap.
protected  void_augmentGapToLeft(int length)
     Assuming there is a gap to the left, this function increases the size of that gap.
protected  boolean_gapToLeft()
     Determines if there is a gap immediately to the left of the cursor.
protected  boolean_gapToRight()
     Determines if there is a Gap immediately to the right of the cursor.
public  void_insertGap(int length)
     Inserts a block of text into the reduced model which has no special consideration in the reduced model.
protected  void_insertNewGap(int length)
     Helper function for _insertGap.
 intabsOffset()
     Package private absolute offset for tests.
protected  ReducedTokencurrent()
     Get the ReducedToken currently pointed at by the cursor.
 intgetBlockOffset()
     Get the offset into the current ReducedToken.
protected  ReducedModelStategetStateAtCurrent()
     Wrapper for TokenList.Iterator.getStateAtCurrent that returns the current state for some iterator.
abstract public  voidinsertChar(char ch)
     Inserts a character into the reduced model.
abstract protected  voidinsertGapBetweenMultiCharBrace(int length)
     Inserts a gap between a multiple character brace. Because ReducedModelBrace does not keep track of multiple character braces, only (),{}, and [], it differed in its implementation of inserGap(int) from ReducedModelComment's.
public  TokenList.IteratormakeCopyCursor()
     Make a copy of the token list's iterator.
abstract protected  ReducedModelStatemoveWalkerGetState(int relLocation)
    
protected  voidnext()
     Move to the token immediately right.
protected  voidprev()
     Move to the token immediately left. This function forwards its responsibilities to the TokenList iterator.
abstract protected  voidresetWalkerLocationToCursor()
     Resets the walker to the current position in document.
 voidsetBlockOffset(int offset)
     Change the offset into the current ReducedToken.
public  StringsimpleString()
     A toString() replacement for testing - easier to read.

Field Detail
PTR_CHAR
final public static char PTR_CHAR(Code)
The character that represents the cursor in toString(). @see #toString()



_cursor
TokenList.Iterator _cursor(Code)
Keeps track of cursor position in document.
See Also:   ModelList.Iterator



_tokens
TokenList _tokens(Code)
The reduced model for a document is a list of ReducedTokens (braces and gaps).
See Also:   ModelList




Constructor Detail
AbstractReducedModel
public AbstractReducedModel()(Code)
Constructor. Creates a new reduced model with the cursor at the start of a blank "page."




Method Detail
_augmentCurrentGap
protected void _augmentCurrentGap(int length)(Code)
Assuming there is a gap to the right, this function increases the size of that gap.
Parameters:
  length - the amount of increase



_augmentGapToLeft
protected void _augmentGapToLeft(int length)(Code)
Assuming there is a gap to the left, this function increases the size of that gap.
Parameters:
  length - the amount of increase



_gapToLeft
protected boolean _gapToLeft()(Code)
Determines if there is a gap immediately to the left of the cursor.



_gapToRight
protected boolean _gapToRight()(Code)
Determines if there is a Gap immediately to the right of the cursor.



_insertGap
public void _insertGap(int length)(Code)
Inserts a block of text into the reduced model which has no special consideration in the reduced model.
  1. atStart: if gap to right, augment first gap, else insert
  2. atEnd: if gap to left, augment left gap, else insert
  3. inside a gap: grow current gap, move offset by length
  4. inside a multiple character brace:
    1. break current brace
    2. insert new gap
  5. gap to left: grow that gap and set offset to zero
  6. gap to right: this case handled by inside gap (offset invariant)
  7. between two braces: insert new gap
    Parameters:
      length - the length of the inserted text



_insertNewGap
protected void _insertNewGap(int length)(Code)
Helper function for _insertGap. Performs the actual insert and marks the offset appropriately.
Parameters:
  length - size of gap to insert



absOffset
int absOffset()(Code)
Package private absolute offset for tests. We don't keep track of absolute offset as it causes too much confusion and trouble.



current
protected ReducedToken current()(Code)
Get the ReducedToken currently pointed at by the cursor. the current token



getBlockOffset
int getBlockOffset()(Code)
Get the offset into the current ReducedToken. the number of characters into the token where the cursor sits



getStateAtCurrent
protected ReducedModelState getStateAtCurrent()(Code)
Wrapper for TokenList.Iterator.getStateAtCurrent that returns the current state for some iterator. Convenience method to return the current state in the cursor iterator.



insertChar
abstract public void insertChar(char ch)(Code)
Inserts a character into the reduced model. A method to be implemented in each specific reduced sub-model.



insertGapBetweenMultiCharBrace
abstract protected void insertGapBetweenMultiCharBrace(int length)(Code)
Inserts a gap between a multiple character brace. Because ReducedModelBrace does not keep track of multiple character braces, only (),{}, and [], it differed in its implementation of inserGap(int) from ReducedModelComment's. To pull out the otherwise identical code and place it here, we created this function to do something meaningful in ReducedModelComment and to throw an exception in ReducedModelBrace.



makeCopyCursor
public TokenList.Iterator makeCopyCursor()(Code)
Make a copy of the token list's iterator.



moveWalkerGetState
abstract protected ReducedModelState moveWalkerGetState(int relLocation)(Code)
Returns the state at the relLocation, where relLocation is the location relative to the walker
Parameters:
  relLocation - distance from walker to get state at.



next
protected void next()(Code)
Move to the token immediately right. This function forwards its responsibilities to the cursor. If the cursor is at the end, it will throw an exception.



prev
protected void prev()(Code)
Move to the token immediately left. This function forwards its responsibilities to the TokenList iterator. If the cursor is at the start, it will throw an exception.



resetWalkerLocationToCursor
abstract protected void resetWalkerLocationToCursor()(Code)
Resets the walker to the current position in document.



setBlockOffset
void setBlockOffset(int offset)(Code)
Change the offset into the current ReducedToken.
Parameters:
  offset - the number of characters into the token to set the cursor



simpleString
public String simpleString()(Code)
A toString() replacement for testing - easier to read.



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__w___w.j_av_a___2s.__c_o__m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.