Package jgromacs.ui

# Class Application

java.lang.Object
jgromacs.ui.Application

Direct Known Subclasses:
  `TemplateApplication`

public abstract class Application extends Object
Parent class of JGromacs applications. You can extend this class to write JGromacs applications. (See TemplateApplication.java !)

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`XMLFileName`
XML configuration file name

## Constructor Summary

Constructors
Constructor
Description
`Application()`
Constructor

## Method Summary

Modifier and Type
Method
Description
`protected int`
`askIndexSetFromUser(IndexSetList list)`
Asks the user which index set is to be selected from the index set list
`protected int`
`askIndexSetFromUser(IndexSetList list, String question)`
Asks the user which index set is to be selected from the index set list
`protected void`
`canRunWithoutArgument(boolean can)`
Sets if the application can run without argument
`protected String`
`getArgumentValue(String flag)`
Returns the value defined by the given attribute flag
`protected String`
`getLogFileName()`
Returns the name of log file
`protected boolean`
`isArgumentGiven(String flag)`
Returns true if the attribute defined by the given flag was called by the user
`protected void`
`run(String[] args)`
Don't override this method!
`protected abstract void`
`runCore()`
You can override this method to include your own code.
`protected void`
`setLogFileName(String filename)`
Sets the name of log file
`protected void`
`setWritingToLogFile(boolean write)`
Sets if the application writes log file
`protected void`
`writeToLogFile(String text)`
Sets if the application writes log file

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### XMLFileName

protected String XMLFileName
XML configuration file name

## Constructor Details

### Application

public Application()
Constructor

## Method Details

### run

protected void run(String[] args)
Don't override this method!

### runCore

protected abstract void runCore()
You can override this method to include your own code. This is the entry point of your program.

### isArgumentGiven

protected boolean isArgumentGiven(String flag)
Returns true if the attribute defined by the given flag was called by the user

Parameters:
  `flag` - attribute flag

### getArgumentValue

protected String getArgumentValue(String flag)
Returns the value defined by the given attribute flag

Parameters:
  `flag` - attribute flag
Returns:
  value

### askIndexSetFromUser

protected int askIndexSetFromUser(IndexSetList list, String question)
Asks the user which index set is to be selected from the index set list

Parameters:
  `list` - index set list to select from
  `question` - question to be asked
Returns:
  list index of selected index set

### askIndexSetFromUser

protected int askIndexSetFromUser(IndexSetList list)
Asks the user which index set is to be selected from the index set list

Parameters:
  `list` - index set list to select from
Returns:
  list index of selected index set

### canRunWithoutArgument

protected void canRunWithoutArgument(boolean can)
Sets if the application can run without argument

Parameters:
  `can` - true if the application runs without argument

### setWritingToLogFile

protected void setWritingToLogFile(boolean write)
Sets if the application writes log file

Parameters:
  `write` - true if the application writes log file

### setLogFileName

protected void setLogFileName(String filename)
Sets the name of log file

Parameters:
  `filename` - name of log file

### writeToLogFile

protected void writeToLogFile(String text)
Sets if the application writes log file

Parameters:
  `write` - true if the application writes log file

### getLogFileName

protected String getLogFileName()
Returns the name of log file

Returns:
  name of log file