Java Doc for History.java in  » IDE » DrJava » edu » rice » cs » drjava » model » repl » 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.repl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.rice.cs.drjava.model.repl.History

History
public class History implements OptionConstants,Serializable(Code)
History class that records what has been typed in the interactions pane. This class is not thread safe; it is only accessed from InteractionsDocument which takes responsibility for synchronization.
version:
   $Id: History.java 4264 2007-11-15 01:33:48Z mgricken $


Field Summary
final public static  StringHISTORY_FORMAT_VERSION_2
     Version flag at the beginning of saved history file format If this is not present in a saved history, it is assumed to be the original format.
final public static  StringINTERACTION_SEPARATOR
    
final public  OptionListener<Integer>historyOptionListener
    

Constructor Summary
public  History()
     Constructor, so we can add a listener to the Config item being used.
public  History(int maxSize)
     Creates a new History with the given size.

Method Summary
public  voidadd(String item)
     Adds an item to the history and moves the cursor to point to the place after it. Note: Items are not inserted if they are empty.
public  voidclear()
    
public  voidforwardSearch(String currentInteraction)
     Forward-searches the history for the next matching string.
public  StringgetCurrent()
     Returns item in history at current position; returns "" if no current item exists.
public  StringgetHistoryAsString()
     Returns the history as a string by concatenating each string in the vector separated by the delimiting character.
public  StringgetHistoryAsStringWithSemicolons()
     Returns the history as a string by concatenating each string in the vector separated by the delimiting character.
public  OptionListener<Integer>getHistoryOptionListener()
    
public  booleanhasNext()
     Returns whether moveNext() would succeed right now.
public  booleanhasPrevious()
     Returns whether movePrevious() would succeed right now.
public  StringlastEntry()
     Returns the last entry from the history.
public  voidmoveEnd()
     Move the cursor to just past the end.
public  voidmoveNext(String entry)
     Moves cursor forward 1, or throws exception if there is none.
public  voidmovePrevious(String entry)
     Moves cursor back 1, or throws exception if there is none.
public  StringremoveLast()
     Returns the last element and removes it, or returns null if the history is empty.
public  voidreverseSearch(String currentInteraction)
     Reverse-searches the history for the previous matching string.
public  voidsetEditedEntry(String entry)
     Sets the edited entry to the given value.
public  voidsetMaxSize(int newSize)
     Changes the maximum number of interactions remembered by this History.
public  intsize()
     Returns the number of items in this History.
public  voidwriteToFile(FileSaveSelector selector)
     Writes this (unedited) History to the file selected in the FileSaveSelector.
public static  voidwriteToFile(FileSaveSelector selector, String editedVersion)
     Writes this History to the file selected in the FileSaveSelector.

Field Detail
HISTORY_FORMAT_VERSION_2
final public static String HISTORY_FORMAT_VERSION_2(Code)
Version flag at the beginning of saved history file format If this is not present in a saved history, it is assumed to be the original format.



INTERACTION_SEPARATOR
final public static String INTERACTION_SEPARATOR(Code)



historyOptionListener
final public OptionListener<Integer> historyOptionListener(Code)
The OptionListener for HISTORY_MAX_SIZE




Constructor Detail
History
public History()(Code)
Constructor, so we can add a listener to the Config item being used.



History
public History(int maxSize)(Code)
Creates a new History with the given size. An option listener is not added for the config framework.
Parameters:
  maxSize - Number of lines to remember in the history.




Method Detail
add
public void add(String item)(Code)
Adds an item to the history and moves the cursor to point to the place after it. Note: Items are not inserted if they are empty. (This is in accordance with bug #522123, but in divergence from feature #522213 which originally excluded sequential duplicate entries from ever being stored.) Thus, to access the newly inserted item, you must movePrevious first.



clear
public void clear()(Code)
Clears the vector



forwardSearch
public void forwardSearch(String currentInteraction)(Code)
Forward-searches the history for the next matching string.
Parameters:
  currentInteraction - the current interaction



getCurrent
public String getCurrent()(Code)
Returns item in history at current position; returns "" if no current item exists.



getHistoryAsString
public String getHistoryAsString()(Code)
Returns the history as a string by concatenating each string in the vector separated by the delimiting character.



getHistoryAsStringWithSemicolons
public String getHistoryAsStringWithSemicolons()(Code)
Returns the history as a string by concatenating each string in the vector separated by the delimiting character. A semicolon is added to the end of every statement that didn't already end with one.



getHistoryOptionListener
public OptionListener<Integer> getHistoryOptionListener()(Code)



hasNext
public boolean hasNext()(Code)
Returns whether moveNext() would succeed right now.



hasPrevious
public boolean hasPrevious()(Code)
Returns whether movePrevious() would succeed right now.



lastEntry
public String lastEntry()(Code)
Returns the last entry from the history. Throw array indexing exception if no such entry.



moveEnd
public void moveEnd()(Code)
Move the cursor to just past the end. Thus, to access the last element, you must movePrevious.



moveNext
public void moveNext(String entry)(Code)
Moves cursor forward 1, or throws exception if there is none.
Parameters:
  entry - the current entry (perhaps edited from what is in history)



movePrevious
public void movePrevious(String entry)(Code)
Moves cursor back 1, or throws exception if there is none.
Parameters:
  entry - the current entry (perhaps edited from what is in history)



removeLast
public String removeLast()(Code)
Returns the last element and removes it, or returns null if the history is empty. last element before it was removed, or null if history is empty



reverseSearch
public void reverseSearch(String currentInteraction)(Code)
Reverse-searches the history for the previous matching string.
Parameters:
  currentInteraction - the current interaction



setEditedEntry
public void setEditedEntry(String entry)(Code)
Sets the edited entry to the given value.
Parameters:
  entry - the string to set



setMaxSize
public void setMaxSize(int newSize)(Code)
Changes the maximum number of interactions remembered by this History.
Parameters:
  newSize - New number of interactions to remember.



size
public int size()(Code)
Returns the number of items in this History.



writeToFile
public void writeToFile(FileSaveSelector selector) throws IOException(Code)
Writes this (unedited) History to the file selected in the FileSaveSelector.
Parameters:
  selector - File to save to



writeToFile
public static void writeToFile(FileSaveSelector selector, String editedVersion) throws IOException(Code)
Writes this History to the file selected in the FileSaveSelector. The saved file will still include any tags or extensions needed to recognize it as a saved interactions file.
Parameters:
  selector - File to save to
Parameters:
  editedVersion - The edited version of the text to be saved.



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)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.