Package org.sentrysoftware.jawk.jrt
Interface VariableManager
- All Known Implementing Classes:
AVM
public interface VariableManager
The AWK Variable Manager.
It provides getter/setter methods for global AWK variables.
Its purpose is to expose a variable management interface to
the JRT, even though the implementation is provided by
the AWK script at script compile-time.
The getters/setters here do not access all
special AWK variables, such as RSTART
and ENVIRON
. That's because these variables
are not referred to within the JRT.
- Author:
- Danny Daglas
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assignVariable
(String name, Object value) Set the contents of a user-defined AWK variable.getARGC()
getARGC.getARGV()
getARGV.getCONVFMT.getFS()
getFS.getOFS()
getOFS.getORS()
getORS.getRS()
getRS.getSUBSEP.void
incFNR()
Increases the FNR variable by 1.void
incNR()
Increases the NR variable by 1.void
resetFNR()
Resets the FNR variable to 0.void
setFILENAME
(String fileName) Set the contents of the FILENAME variable.void
Set the contents of the NF variable.
-
Method Details
-
getARGC
Object getARGC()getARGC.
- Returns:
- the contents of the ARGC variable.
-
getARGV
Object getARGV()getARGV.
- Returns:
- the contents of the ARGV variable.
-
getCONVFMT
Object getCONVFMT()getCONVFMT.
- Returns:
- the contents of the CONVFMT variable.
-
getFS
Object getFS()getFS.
- Returns:
- the contents of the FS variable.
-
getRS
Object getRS()getRS.
- Returns:
- the contents of the RS variable.
-
getOFS
Object getOFS()getOFS.
- Returns:
- the contents of the OFS variable.
-
getORS
Object getORS()getORS.
- Returns:
- the contents of the ORS variable.
-
getSUBSEP
Object getSUBSEP()getSUBSEP.
- Returns:
- the contents of the SUBSEP variable.
-
setFILENAME
Set the contents of the FILENAME variable.- Parameters:
fileName
- File name
-
setNF
Set the contents of the NF variable.- Parameters:
newNf
- Value for NF
-
incNR
void incNR()Increases the NR variable by 1. -
incFNR
void incFNR()Increases the FNR variable by 1. -
resetFNR
void resetFNR()Resets the FNR variable to 0. -
assignVariable
Set the contents of a user-defined AWK variable. Used when processing name=value command-line arguments (either via -v or via ARGV).- Parameters:
name
- The AWK variable name.value
- The new contents of the variable.
-