📄 archiveinfo.java
字号:
/*
* $Log: ArchiveInfo.java,v $
* Revision 1.8 2003/03/12 17:56:56 willaxt
* it's now Serializable again, there is some bug in externalization
*
* Revision 1.7 2003/02/26 16:24:29 willaxt
* default initialization of name and version with empty String due to NullPointerException
* in externalization
*
* Revision 1.6 2003/02/26 12:55:43 willaxt
* javadoc updates, rename ctor parameter
*
* Revision 1.5 2003/02/22 11:47:13 willaxt
* Externalization is back again.
*
* Revision 1.4 2003/02/04 21:56:27 willaxt
* Changed back to Serialization due to strang NullPointerExceptions during writing to the OutputStream.
*
* Revision 1.3 2003/01/24 15:32:11 willaxt
* added missing default constructor needed for externalization
*
* Revision 1.2 2003/01/23 17:32:26 willaxt
* it's now externalizable
*
* Revision 1.1 2003/01/16 13:09:48 mwulff
* initial version
*/
package de.fhm.jkf.launch.clsv;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serializable;
import java.util.Collection;
/**
* <br><br><center><table border="1" width="80%"><hr>
* <strong><a href="http://jkf.sourceforge.net">The JKF Project</a></strong>
* <p>
* Copyright (C) 2002 by Theodor Willax
* <p>
* this library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* <p>
* this library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS for A PARTICULAR PURPOSE. See the GNU
* Lesser General public License for more details.
* <p>
* You should have received a copy of the <a href="http://www.gnu.org/copyleft/lesser.html">
* GNU Lesser General public License</a> along with this library; if not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
* <hr></table></center>
*
* this class represents information about an java archive.
* It includes the resources contained in the archive, the
* archive name and the archive version.
*
* @author Theodor Willax
*/
public class ArchiveInfo implements Serializable {
/** The name of this archive. */
private String name = "";
/** The version of this archive. */
private String version = "";
/** The resources contained in thsi archive*/
private Collection classList = null;
/**
* Constructs a new <code>ArchiveInfo</code> class with a
* list of the resources contained, the name and the version
* of this archvie.
*
* @param res The resources contained in this archive.
* @param name The name of this archive.
* @param version The version of this archive.
*/
public ArchiveInfo(Collection res, String name, String version) {
if (res == null) {
throw new IllegalArgumentException("resource list null not allowed");
}
if (name == null) {
throw new IllegalArgumentException("name null not allowed");
}
this.name = name;
this.version = version;
this.classList = res;
}
/**
* Returns the name of this archive.
*
* @return name of this archive.
*/
public String getName() {
return name;
}
/**
* Returns the version of this archive.
*
* @return version of this archive.
*/
public String getVersion() {
return version;
}
public Collection getClassList() {
return classList;
}
/**
* Un-externalizes this object.
*
* @todo Read resource names in utf format, not as object.
* @see java.io.Externalizable#readExternal(ObjectInput)
*/
public void readExternal(ObjectInput in)
throws IOException, ClassNotFoundException {
name = in.readUTF();
version = in.readUTF();
classList = (Collection) in.readObject();
}
/**
* Externalizes this object.
*
* @todo Write resource names in utf format, not as object.
* @see java.io.Externalizable#writeExternal(ObjectOutput)
*/
public void writeExternal(ObjectOutput out) throws IOException {
out.writeUTF(name);
out.writeUTF(version);
out.writeObject(classList);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -