public class CfgInstance extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EOL
Flag value separating lines in the string
|
Constructor and Description |
---|
CfgInstance()
Creates a new inistance of CfgInstance but does not fill it with data
|
CfgInstance(File inFile)
Creates a new instance of CfgFile
|
CfgInstance(InputStream inStream)
Creates a new instance of CfgFile
|
CfgInstance(String fileName)
Creates a new instance of CfgFile
|
Modifier and Type | Method and Description |
---|---|
void |
addLine(int position,
String newToken)
Adds a token to the instance ArrayList at a specified position
|
void |
addToken(String newToken)
Adds a token to the end of the instance ArrayList
|
int |
getLength()
Returns the length in tokens of the context free grammar instance
|
String |
getToken(int position)
Retrieves the specified token of the CfgInstance
|
public static final String EOL
public CfgInstance()
public CfgInstance(String fileName) throws FileNotFoundException
fileName
- path to file containing the CFG documentFileNotFoundException
public CfgInstance(File inFile) throws FileNotFoundException
inFile
- file containing the CFG documentFileNotFoundException
public CfgInstance(InputStream inStream)
inStream
- input stream from which context free grammar instance is to be readpublic void addToken(String newToken)
newToken
- String being added to the instance Vectorpublic void addLine(int position, String newToken)
position
- location in the Vector to add the new linenewToken
- String being added to the instance Vectorpublic String getToken(int position)
position
- token number of the CfgInstance to returnpublic int getLength()