public class Input
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Input.InputPreferences |
Modifier and Type | Field and Description |
---|---|
protected long |
byteCount
the number of bytes of data read so far
|
protected java.io.DataInputStream |
dataInputStream
The input stream.
|
protected EditingPreferences |
ep
editing preferences
|
static ErrorLogger |
errorLogger
Log errors.
|
protected long |
fileLength
The length of the file.
|
protected java.lang.String |
filePath
Name of the file being input.
|
protected java.io.InputStream |
inputStream
The raw input stream.
|
protected java.io.LineNumberReader |
lineReader
The line number reader (text only).
|
protected static int |
READ_BUFFER_SIZE |
Constructor and Description |
---|
Input() |
Modifier and Type | Method and Description |
---|---|
static boolean |
changesQuiet(boolean quiet)
Method to set the subsequent changes to be "quiet".
|
protected void |
closeInput() |
protected boolean |
eofDuring(java.lang.String when)
Method to display an error message because end-of-file was reached.
|
protected java.lang.String |
getAKeyword() |
static Input.InputPreferences |
getInputPreferences(FileType type,
boolean factory)
Return OutputPreferences for a specified FileType.
|
protected java.lang.String |
getLine()
Method to read the next line of text from a file.
|
protected java.lang.String |
getLineFromBinary()
Method to read a line of text, when the file has been opened in binary mode.
|
protected static java.lang.String |
getProgressNote() |
protected java.lang.String |
getRestOfLine()
Method to allow getAKeyword() to read next line next time is invocated.
|
protected Library |
importALibrary(Library lib,
Technology tech,
java.util.Map<Library,Cell> currentCells)
Method to import a library from disk.
|
static Library |
importLibrary(Input.InputPreferences prefs,
java.net.URL fileURL,
FileType type,
Library lib,
Technology tech,
java.util.Map<Library,Cell> currentCells,
Job job)
Method to import Cells from disk.
|
protected void |
initKeywordParsing() |
protected boolean |
isBreakCharacter(char chr)
Helper method for keyword processing which decides whether a character is its own keyword.
|
static boolean |
isChangeQuiet()
Method to tell whether changes are being made quietly.
|
static boolean |
isNewLibraryCreated()
Method to tell if a new library was created for this import operation.
|
protected boolean |
openBinaryInput(java.net.URL fileURL) |
protected boolean |
openStringsInput(java.lang.String[] lines) |
protected boolean |
openTextInput(java.net.URL fileURL) |
protected java.lang.String |
preprocessLine(java.lang.String line)
Helper method for keyword processing which removes comments.
|
protected java.lang.String |
readWholeLine() |
protected static void |
setProgressNote(java.lang.String msg) |
protected static void |
setProgressValue(int value) |
protected static void |
startProgressDialog(java.lang.String type,
java.lang.String filePath) |
protected static void |
stopProgressDialog() |
protected void |
updateProgressDialog(int bytesRead) |
protected static final int READ_BUFFER_SIZE
public static ErrorLogger errorLogger
protected java.lang.String filePath
protected java.io.InputStream inputStream
protected java.io.LineNumberReader lineReader
protected java.io.DataInputStream dataInputStream
protected long fileLength
protected long byteCount
protected EditingPreferences ep
public static boolean isNewLibraryCreated()
public static Library importLibrary(Input.InputPreferences prefs, java.net.URL fileURL, FileType type, Library lib, Technology tech, java.util.Map<Library,Cell> currentCells, Job job)
prefs
- the packaged preferences for reading the type of file.fileURL
- the URL to the disk file.type
- the type of library file (CIF, GDS, etc.)lib
- the library in which to place the circuitry (null to create a new one).tech
- the technology to use for import.currentCells
- this map will be filled with currentCells in Libraries found in library file.job
- the Job that is doing the import.public static Input.InputPreferences getInputPreferences(FileType type, boolean factory)
type
- specified file type.factory
- get factory default values of PrefsInvalidStateException
- on attemt to get current default values of Prefs from server threadprotected Library importALibrary(Library lib, Technology tech, java.util.Map<Library,Cell> currentCells)
lib
- the library to fillcurrentCells
- this map will be filled with currentCells in Libraries found in library fileprotected boolean openBinaryInput(java.net.URL fileURL)
protected boolean openStringsInput(java.lang.String[] lines)
protected boolean openTextInput(java.net.URL fileURL)
protected static void setProgressNote(java.lang.String msg)
protected static java.lang.String getProgressNote()
protected static void startProgressDialog(java.lang.String type, java.lang.String filePath)
protected static void stopProgressDialog()
protected static void setProgressValue(int value)
protected void updateProgressDialog(int bytesRead)
protected void closeInput()
protected java.lang.String getLine() throws java.io.IOException
java.io.IOException
protected java.lang.String getLineFromBinary() throws java.io.IOException
java.io.IOException
protected void initKeywordParsing()
protected java.lang.String getRestOfLine() throws java.io.IOException
java.io.IOException
protected java.lang.String readWholeLine() throws java.io.IOException
java.io.IOException
protected java.lang.String getAKeyword() throws java.io.IOException
java.io.IOException
protected boolean isBreakCharacter(char chr)
chr
- the character in question.protected java.lang.String preprocessLine(java.lang.String line)
line
- a line of text just read.public static boolean isChangeQuiet()
public static boolean changesQuiet(boolean quiet)
protected boolean eofDuring(java.lang.String when)
when
- the statement being read when EOF was reached.