|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.kpro.main.Gio
public class Gio
Field Summary | |
---|---|
private java.util.logging.FileHandler |
fh
create logger object |
private java.util.Properties |
genProps
creates filehandler for logging |
private static java.util.logging.Logger |
logger
|
private java.util.Properties |
newWeights
the loaded weights file. |
private NetworkR |
nr
Policy database object |
private java.util.Properties |
origWeights
holds all the property values |
private PolicyDatabase |
pdb
means of interacting with the user |
private PolicyObject |
po
Network Resource (community advice database) |
private UserIO |
userInterface
the revised weights, following LearnAlgorithm. |
Constructor Summary | |
---|---|
Gio(java.lang.String[] args)
Constructor fo gio class. |
|
Gio(java.lang.String[] args,
UserIO ui)
A constructor permitting a user interface class to launch everything and be in control. |
Method Summary | |
---|---|
void |
configUI()
call the user interface's general configuration method if the userInit option is true, and a user interface exists |
boolean |
fileExists(java.lang.String filepath)
GUI classes should use this to ensure the user passes valid files to load. |
CBR |
getCBR()
returns the CBR to use |
double |
getConfLevel()
gets the confidence level threshold from the configuration |
NetworkR |
getNR()
|
PolicyDatabase |
getPDB()
returns the only policy database |
PolicyObject |
getPO()
|
java.util.Properties |
getWeights()
returns the originally imported set of weights |
boolean |
isBuilding()
returns the true if it should only build |
private void |
loadCLO(java.lang.String[] args)
accepts the direct commandline options, then parses & implements them. |
private void |
loadCLPolicies()
loads [additional] policies from commandline (either -p or -f) |
void |
loadDB()
Loads the case history into cache. |
java.util.Properties |
loadFromConfig(java.lang.String fileLoc)
Loads the general configuration file, either from provided string, or default location (./PrivacyAdviser.cfg) |
void |
loadPO()
returns the policy object from the policyObject option |
java.util.Properties |
loadWeights()
Loads the weights configuration file, from the provided location |
private Action |
parseAct(java.lang.String optionValue)
Should parse a string to select, initialize, and return one of the actions (result of checking an object) coded. |
private CBR |
parseCBR(java.lang.String string)
converts a string into a valid CBR |
private void |
selectPDB(java.lang.String optionValue)
Should parse a string to select, initialize, and return one of the policy databases coded |
private void |
selectUI(java.lang.String optionValue)
Should parse a string to select, initialize, and return the user interface selected |
void |
setGenProps(java.util.Properties genProps)
|
void |
setWeights(java.util.Properties newWeightP)
saves the new weights to a buffer variable before writing in the shutdown call |
void |
showDatabase()
shows the database on the user interface, if the user interface exists and no user response is specied and there is no 'blanketAccept' option. |
void |
shutdown()
closes resources and write everything to file |
java.util.logging.Logger |
startLogger(java.lang.String logLoc,
java.lang.String logLevel)
startLogger initializes and returns a file at logLoc with the results of logging at level logLevel. |
private void |
startNetwork()
Starts the NetworkR specificied by the configuration settings. |
PolicyObject |
userResponse(PolicyObject n)
Generates handles response. |
private void |
writePropertyFile(java.util.Properties wprops,
java.lang.String wloc)
writes a property file to disk |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.logging.Logger logger
private java.util.logging.FileHandler fh
private java.util.Properties genProps
private java.util.Properties origWeights
private java.util.Properties newWeights
private UserIO userInterface
private PolicyDatabase pdb
private NetworkR nr
private PolicyObject po
Constructor Detail |
---|
public Gio(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
- Mostly from loadWeights, but should also happen for loadFromConfigpublic Gio(java.lang.String[] args, UserIO ui) throws java.lang.Exception
args
- any commandline arguementsui
- the known UserIO object
java.lang.Exception
- Mostly from loadWeights, but should also happen for loadFromConfigMethod Detail |
---|
public void configUI()
public void setGenProps(java.util.Properties genProps)
private void loadCLO(java.lang.String[] args)
args
- private CBR parseCBR(java.lang.String string) throws java.lang.Exception
string
- the string to parse
java.lang.Exception
private void selectPDB(java.lang.String optionValue)
optionValue
- the string to parseprivate void selectUI(java.lang.String optionValue)
optionValue
- the string to parseprivate Action parseAct(java.lang.String optionValue)
optionValue
- the string to parse
public java.util.Properties loadFromConfig(java.lang.String fileLoc)
location
- of configuration file
public java.util.Properties loadWeights() throws java.lang.Exception
location
- of configuration file <---- ????
java.lang.Exception
- if there's an issue reading the file (if it doesn't exist, or has an IO error)public java.util.logging.Logger startLogger(java.lang.String logLoc, java.lang.String logLevel)
logLoc
- location of the output log file- a stringlogLevel
- logging level (is parsed by level.parse())
public void loadDB()
dLoc
- the location of the databaseprivate void loadCLPolicies()
public PolicyDatabase getPDB()
public void shutdown()
private void writePropertyFile(java.util.Properties wprops, java.lang.String wloc)
wprops
- the property file to writewloc
- where to write topublic PolicyObject userResponse(PolicyObject n)
n
- the processed policy object
public void loadPO()
public PolicyObject getPO()
public boolean isBuilding()
public void setWeights(java.util.Properties newWeightP)
newWeightP
- the new weights file to savepublic CBR getCBR() throws java.lang.Exception
java.lang.Exception
public java.util.Properties getWeights()
public void showDatabase()
public boolean fileExists(java.lang.String filepath)
filepath
- path of the file to check
private void startNetwork() throws java.lang.ClassNotFoundException, java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.SecurityException
java.lang.IllegalArgumentException
public NetworkR getNR()
public double getConfLevel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |