uvascript
Class Editor

java.lang.Object
  extended byuvascript.Editor

public class Editor
extends java.lang.Object


Field Summary
static char[] CRLF
           
static char[] LF
           
 char[] lineDelimiter
           
 
Constructor Summary
Editor(java.io.File f)
          Opens the file.
 
Method Summary
 void append(java.lang.String text)
          Appends a line at the end of the file.
 java.lang.String get(int lineNo)
          Returns the line at the specified line number.
 void insert(int lineNo, java.lang.String newText)
          Inserts the line at the specified line number.
 java.lang.String remove(int lineNo)
          Removes the line at the specified line number.
 java.lang.String replace(int lineNo, java.lang.String newText)
          Replaces the line at the specified line number.
 void save()
          Saves the file.
 void save(java.io.File f)
          Saves the file.
 void save(java.lang.String name)
          Saves the file with the given name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRLF

public static final char[] CRLF

LF

public static final char[] LF

lineDelimiter

public char[] lineDelimiter
Constructor Detail

Editor

public Editor(java.io.File f)
Opens the file.

Method Detail

save

public void save()
Saves the file.


save

public void save(java.lang.String name)
Saves the file with the given name.

Parameters:
name - file name.

save

public void save(java.io.File f)
Saves the file.

Parameters:
f - the path name.

get

public java.lang.String get(int lineNo)
Returns the line at the specified line number.


replace

public java.lang.String replace(int lineNo,
                                java.lang.String newText)
Replaces the line at the specified line number.

Parameters:
lineNo - line number
newText - substituted line

insert

public void insert(int lineNo,
                   java.lang.String newText)
Inserts the line at the specified line number.

Parameters:
lineNo - line number
newText - inserted line

append

public void append(java.lang.String text)
Appends a line at the end of the file.


remove

public java.lang.String remove(int lineNo)
Removes the line at the specified line number.

Returns:
the removed line.


UvaScript. Copyright (C) 2004 Shigeru Chiba. All Rights Reserved.