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

📄 header.java

📁 Java source code for the Ant Colony Optimization Problem.
💻 JAVA
字号:
package jwo.jpss.spatial;  // Part of the spatial modelling package.
import java.io.Serializable;

//  **************************************************************
/** Stores general header information about a document. Includes
  * information such as title, author, copyright details etc.
  * @author Jo Wood.
  * @version 2.0, 6th September, 2001.
  */
//  **************************************************************

public class Header implements Serializable
{   
    // ------------------- Object variables ----------------------
    
    private String title, author, rights, notes;
    
    // --------------------- Constructors ------------------------
    
    /** Creates a default header with a given title. 
      * @param title Title of object described by the header.
      */
    public Header(String title)
    {
        this (title, "","","");  			
    }

    /** Creates a header with given title, author, rights and notes.
      * @param title Title of object described by the header.
      * @param author Author of object described by the header.
      * @param rights Copyright details of object described by the header.
      * @param notes Miscellaneous notes associated with object.
      */
    public Header(String title, String author, String rights, String notes)
    {    
        this.title = title;
        this.author = author;
        this.rights = rights;
        this.notes  = notes;
    }
    // --------------------- Accessor Methods -----------------------

    /** Reports the title of the object associated with this header.
      * @return Title of object.
      */
    public String getTitle()
    {
        return title;
    }
    
    /** Reports the author of the object associated with this header.
      * @return Author of object.
      */
    public String getAuthor()
    {
        return author;
    }

    /** Reports the copyright details of the object associated
      * with this header.
      * @return Copyright details associated with this object.
      */
    public String getRights()
    {
        return rights;
    }
 
    /** Reports any notes on the object associated with this header.
      * @return Notes associated with object.
      */
    public String getNotes()
    {
        return notes;
    }

    /** Reports the contents of the header as a text string.
      * @return Text representing header.
      */
    public String toString()
    {
        return new String(title+" "+notes);
    }
    // --------------------- Mutator Methods -----------------------

    /** Sets the title of the object associated with this header.
      * @param title New title of object.
      */
    public void setTitle(String title)
    {
        this.title = title;
    }
     
    /** Sets the author of the object associated with this header.
      * @param title New author information associated with object.
      */
    public void setAuthor(String author)
    {
        this.author = author;
    }

    /** Sets the copyright details associated with this header.
      * @param rights New copyright information associated with object.
      */
    public void setRights(String rights)
    {
        this.rights = rights;
    }    

    /** Sets the notes on the object associated with this header.
      * @param notes New notes associated with object.
      */
    public void setNotes(String notes)
    {
        this.notes = notes;
    }
}

⌨️ 快捷键说明

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