edu.ucla.belief.io
Class NetworkIO
Object
NetworkIO
public class NetworkIO
- extends Object
Method Summary |
static String |
extractFileNameFromPath(String path)
|
static String |
extractNetworkNameFromPath(String path)
|
static URL |
findURL(String pathToResource,
String altPathToFile)
|
static String |
formatPercent(float ratio,
DecimalFormat format)
|
static String |
formatTime(long time)
|
static void |
normalizeEnumProperties(BeliefNetwork bn)
|
static Map |
parseArgs(Set flags,
String[] args,
Map container)
|
static Map |
parseArgs(String[] flags,
String[] args,
Map container)
|
static BeliefNetwork |
read(File fileNetwork)
|
static BeliefNetwork |
read(String path)
|
static BeliefNetwork |
readHuginNet(File networkFile)
Reads a hugin description. |
static Thread |
readHuginNet(File f,
NetworkIO.BeliefNetworkIOListener bnil)
Skims the file once before actually parsing it
in order to estimate network size
for the purposes of
progress monitoring. |
static BeliefNetwork |
readHuginNet(InputStream stream)
Does not try to estimate the network size
for the purposes of progress monitoring. |
static Thread |
readHuginNet(InputStream stream,
String name,
NetworkIO.BeliefNetworkIOListener bnil)
Skims the file once before actually parsing it
in order to estimate network size
for the purposes of
progress monitoring. |
static BeliefNetwork |
readHuginNet(Reader input)
|
static Thread |
readHuginNet(Reader input,
String name,
NetworkIO.BeliefNetworkIOListener bnil)
|
static BeliefNetwork |
readSMILE(File networkFile)
|
static BeliefNetwork |
readSMILE(File networkFile,
FileType type)
|
static Thread |
readSMILE(File networkFile,
FileType type,
NetworkIO.BeliefNetworkIOListener bnil)
|
static Thread |
readSMILE(File networkFile,
NetworkIO.BeliefNetworkIOListener bnil)
|
static boolean |
saveFileAs(BeliefNetwork bn,
File newFile)
|
static boolean |
saveFileAs(BeliefNetwork bn,
File newFile,
File oldFile)
|
static boolean |
saveToSMILEType(GenieNet bn,
File oldFile,
File newFile,
FileType smileType)
|
static boolean |
writeNetwork(BeliefNetwork bn,
File ofile)
|
static void |
writeNetwork(BeliefNetwork bn,
PrintWriter out)
Writes out a network in the Hugin file format. |
static boolean |
xmlAvailable()
|
INT_PRIORITY_READ
public static final int INT_PRIORITY_READ
- See Also:
- Constant Field Values
FORMAT_PROFILE_TIME
public static final DecimalFormat FORMAT_PROFILE_TIME
FORMAT_PROFILE_PERCENT
public static final DecimalFormat FORMAT_PROFILE_PERCENT
BUFFER
public static final StringBuffer BUFFER
FIELDPOSITION
public static final FieldPosition FIELDPOSITION
NetworkIO
public NetworkIO()
parseArgs
public static Map parseArgs(String[] flags,
String[] args,
Map container)
- Since:
- 021005
parseArgs
public static Map parseArgs(Set flags,
String[] args,
Map container)
- Since:
- 021005
xmlAvailable
public static boolean xmlAvailable()
- Since:
- 051903
writeNetwork
public static boolean writeNetwork(BeliefNetwork bn,
File ofile)
throws IOException
- Throws:
IOException
writeNetwork
public static void writeNetwork(BeliefNetwork bn,
PrintWriter out)
- Writes out a network in the Hugin file format.
- Parameters:
bn
- the BeliefNetwork to write out.out
- the stream to write it out to.
normalizeEnumProperties
public static void normalizeEnumProperties(BeliefNetwork bn)
extractFileNameFromPath
public static String extractFileNameFromPath(String path)
- Since:
- 120203
extractNetworkNameFromPath
public static String extractNetworkNameFromPath(String path)
- Since:
- 120203
read
public static BeliefNetwork read(String path)
throws Exception
- Throws:
Exception
- Since:
- 082103
read
public static BeliefNetwork read(File fileNetwork)
throws Exception
- Throws:
Exception
- Since:
- 120103
readHuginNet
public static BeliefNetwork readHuginNet(File networkFile)
throws Exception
- Reads a hugin description.
Does not try to estimate the network size
for the purposes of progress monitoring.
- Parameters:
networkFile
- file to read
- Returns:
- A HuginNet representation described in the file
- Throws:
Exception
readHuginNet
public static BeliefNetwork readHuginNet(Reader input)
throws Exception
- Throws:
Exception
- Since:
- 20040210
readHuginNet
public static BeliefNetwork readHuginNet(InputStream stream)
throws Exception
- Does not try to estimate the network size
for the purposes of progress monitoring.
- Throws:
Exception
- Since:
- 20040210
readSMILE
public static BeliefNetwork readSMILE(File networkFile)
throws Exception
- Throws:
Exception
readSMILE
public static BeliefNetwork readSMILE(File networkFile,
FileType type)
throws Exception
- Throws:
Exception
- Since:
- 20040203
readHuginNet
public static Thread readHuginNet(File f,
NetworkIO.BeliefNetworkIOListener bnil)
- Skims the file once before actually parsing it
in order to estimate network size
for the purposes of
progress monitoring.
- Since:
- 20020521
readHuginNet
public static Thread readHuginNet(InputStream stream,
String name,
NetworkIO.BeliefNetworkIOListener bnil)
- Skims the file once before actually parsing it
in order to estimate network size
for the purposes of
progress monitoring.
- Since:
- 20040210
readHuginNet
public static Thread readHuginNet(Reader input,
String name,
NetworkIO.BeliefNetworkIOListener bnil)
- Since:
- 20040210
readSMILE
public static Thread readSMILE(File networkFile,
NetworkIO.BeliefNetworkIOListener bnil)
- Since:
- 20020521
readSMILE
public static Thread readSMILE(File networkFile,
FileType type,
NetworkIO.BeliefNetworkIOListener bnil)
- Since:
- 20040203
saveFileAs
public static boolean saveFileAs(BeliefNetwork bn,
File newFile)
throws IOException
- Throws:
IOException
- Since:
- 20050601
saveFileAs
public static boolean saveFileAs(BeliefNetwork bn,
File newFile,
File oldFile)
throws IOException
- Throws:
IOException
- Since:
- 20050601
saveToSMILEType
public static boolean saveToSMILEType(GenieNet bn,
File oldFile,
File newFile,
FileType smileType)
throws IOException
- Throws:
IOException
- Since:
- 060105
findURL
public static URL findURL(String pathToResource,
String altPathToFile)
- Since:
- 20060525
formatTime
public static String formatTime(long time)
formatPercent
public static String formatPercent(float ratio,
DecimalFormat format)
Copyright 2010 UCLA Automated Reasoning Group