Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## avrora.core
Class LoadableProgram

    java.lang.Object
      avrora.core.LoadableProgram

public class LoadableProgram
extends java.lang.Object

The `LoadableProgram` class represents a reference to a program on the disk. Since the user may want to reload the program (after recompiling it, for example), this class supports the ability to reload the program from disk.

Field Summary
`java.io.File` | `file`
`java.lang.String` | `fname`
`protected Program` | `program`

Constructor Summary
`LoadableProgram(java.io.File f)` The constructor for the `LoadableProgram` class creates a new instance with a reference to the file on the disk.
`LoadableProgram(java.lang.String fname)` The constructor for the `LoadableProgram` class creates a new instance with a reference to the file on the disk.

Method Summary
`java.lang.String` | `getName()` The `getName()` method returns the name of the program, i.e. the name of the file containing the program.
`Program` | `getProgram()` The `getProgram()` method gets the current representation of the program stored in this object.
`void` | `load()` The `load()` method loads (or reloads) the program from the disk.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### fname

    public final java.lang.String fname

### file

    public final java.io.File file

### program

    protected Program program

Constructor Detail

### LoadableProgram

    public LoadableProgram(java.io.File f)

  The constructor for the `LoadableProgram` class creates a new instance with a reference to the file on the disk. The program is NOT automatically loaded.

Parameters:
  `f` - the file containing the program

### LoadableProgram

    public LoadableProgram(java.lang.String fname)

  The constructor for the `LoadableProgram` class creates a new instance with a reference to the file on the disk. The program is NOT automatically loaded.

Parameters:
  `fname` - the filename of the file containing the program

Method Detail

### getProgram

    public Program getProgram()

  The `getProgram()` method gets the current representation of the program stored in this object. It will NOT load the program if it has not been loaded yet.

  Returns:
    A program representing a "compiled" version of the file

### load

    public void load()
              throws java.lang.Exception

  The `load()` method loads (or reloads) the program from the disk.

  Throws:
    `java.lang.Exception`

### getName

    public java.lang.String getName()

  The `getName()` method returns the name of the program, i.e. the name of the file containing the program.

  Returns:
    the name of the file without its absolute path

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD