程序包 weka.core.xml
类 SerialUIDChanger
java.lang.Object
weka.core.xml.SerialUIDChanger
- 所有已实现的接口:
RevisionHandler
This class enables one to change the UID of a serialized object and therefore
not losing the data stored in the binary format.
- 版本:
- $Revision: 1.3 $
- 作者:
- FracPete (fracpete at waikato dot ac dot nz)
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static void
binaryToKOML
(String binary, String koml) converts a binary file into a KOML XML filestatic void
changes the oldUID into newUID from the given file (binary/KOML) into the other one (binary/KOML).Returns the revision string.static boolean
checks whether the given filename ends with ".koml"static void
komlToBinary
(String koml, String binary) converts a KOML file into a binary onestatic void
exchanges an old UID for a new one.
-
构造器详细资料
-
SerialUIDChanger
public SerialUIDChanger()
-
-
方法详细资料
-
isKOML
checks whether the given filename ends with ".koml"- 参数:
filename
- the filename to check- 返回:
- whether it is a KOML file or not
- 另请参阅:
-
binaryToKOML
converts a binary file into a KOML XML file- 参数:
binary
- the binary file to convertkoml
- where to store the XML output- 抛出:
Exception
- if conversion fails
-
komlToBinary
converts a KOML file into a binary one- 参数:
koml
- the filename with the XML databinary
- the name of the- 抛出:
Exception
-
changeUID
public static void changeUID(long oldUID, long newUID, String fromFile, String toFile) throws Exception changes the oldUID into newUID from the given file (binary/KOML) into the other one (binary/KOML). it basically does a replace in the XML, i.e. it looks for " uid='oldUID'" and replaces it with " uid='newUID'".- 参数:
oldUID
- the old UID to changenewUID
- the new UID to usefromFile
- the original file with the old UIDtoFile
- the new file where to store the modified UID- 抛出:
Exception
- if conversion fails
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-
main
exchanges an old UID for a new one. a file that doesn't end with ".koml" is considered being binary. takes four arguments: oldUID newUID oldFilename newFilename- 参数:
args
- the command line parameters- 抛出:
Exception
- 另请参阅:
-