⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 binaryinputpattern.java

📁 基于人工免疫原理的入侵检测系统框架
💻 JAVA
字号:
/*================= * Copyright (C) 2001  Todd Kaplan * * Lisys is a program that monitors TCP SYN packets to detect network * traffic anomalies. * * Licensed under the GNU General Public License (GPL), version 2 or * higher.  Please see the COPYING and PATENT files included with the * Lisys distribution, which can be found at: * *   http://www.cs.unm.edu/~judd/lisys/ * * Also, the current text of the GPL can be found at:  * *   http://www.gnu.org/copyleft/gpl.html *  * Note that Lisys has NO WARRANTY! *=================*/package edu.unm.cs.lisys.detection.bip;import edu.unm.cs.lisys.util.*;import java.util.*;import java.io.*;/**==========  * BinaryInputPattern.java *   A string a bits that represents both TCP connections * and *   detectors. * * Here are the people who have worked on this code in the order they * have worked on it: *   @author Todd Kaplan <kaplan@cs.unm.edu> *   @author Justin Balthrop <judd@cs.unm.edu> *==========*/public abstract class BinaryInputPattern implements Cloneable, Serializable{    static final long serialVersionUID = 179432837854725317L;    protected BitSet binaryString;        public BinaryInputPattern() { }        public BinaryInputPattern(BitSet bits)    {	constructBinaryString(bits);    }        /**==========      * constructBinaryString:     *   Randomly creates a BIP.     *==========*/    public abstract BinaryInputPattern constructBinaryString(KnuthRandom random);        /**==========     * constructBinaryString:     *   Creates BIP by extracting appropriate info from supplied string.     *==========*/    public abstract BinaryInputPattern constructBinaryString(String s);        /**==========     * constructBinaryString:     *   Creates BIP using the supplied BitSet.     *==========*/    public BinaryInputPattern constructBinaryString(BitSet bs)    {	this.binaryString = bs;	return this;    }        public abstract String toString();        public abstract String getConstructorString();        public BitSet getBinaryString()    {	return binaryString;    }        public void setBinaryString(BitSet bits)    {	this.binaryString = bits;    }    abstract public int getLength();    /**==========     * clone:     *   @return an exact copy of the current BIP     *==========*/    public Object clone()    {	BinaryInputPattern bip;	try {	    Class c = Class.forName(this.getClass().getName());	    bip = (BinaryInputPattern) c.newInstance();	    bip.setBinaryString(this.binaryString);	    return bip;	}	catch (Exception e) {	    System.err.println(this.toString() + ": " + e);	}		return new String("clone failed");    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -