View Javadoc

1   /*
2    * This file is part of NetPisteur.
3    * 
4    * Copyright 2001-2002 : Olivier CORNEC, David BOUANCHEAU, Loic LOPEZ,
5    *                       Gaetan BOUDARD, Mael LE LANNOU, Julien ROBINEAU
6    * 
7    * Copyright 2002-2003 : Olivier BRIENS, Simon DEZE, Florence FRIGOULT,
8    *                       Olivier JOURNEAULT, Francois MARTINIER, Damien RAUDE-MORVAN
9    * 
10   * Copyright 2004-2007 : Damien RAUDE-MORVAN
11   * 
12   * NetPisteur is free software; you can redistribute it and/or modify
13   * it under the terms of the GNU General Public License as published by
14   * the Free Software Foundation; either version 2 of the License, or
15   * (at your option) any later version.
16   *
17   * NetPisteur is distributed in the hope that it will be useful,
18   * but WITHOUT ANY WARRANTY; without even the implied warranty of
19   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20   * GNU General Public License for more details.
21   *
22   * You should have received a copy of the GNU General Public License
23   * along with NetPisteur; if not, write to the Free Software
24   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
25   *
26   * $Author: drazzib $
27   * $Date: 2004-07-07 21:39:49 +0200 (Wed, 07 Jul 2004) $
28   * $Id: Adress.java 24 2004-07-07 19:39:49Z drazzib $
29   */
30  package com.drazzib.netpisteur.monitor;
31  
32  import java.net.URL;
33  
34  /**
35   * This class allows to create an object adress whose contains the Url visited
36   * and the date when the url was visited
37   * 
38   * @author NetPisteur Team
39   */
40  
41  public class Address {
42  
43  	// Attributs
44  	private URL _url;
45  
46  	private String _time;
47  
48  	/**
49  	 * Constructors
50  	 * 
51  	 * @param url
52  	 *            the url adress
53  	 * @param time
54  	 *            the current date
55  	 */
56  	public Address(URL url, String time) {
57  		this._url = url;
58  		this._time = time;
59  	}
60  
61  	/**
62  	 * Constructors
63  	 */
64  	public Address() {
65  		this._url = null;
66  		this._time = null;
67  	}
68  
69  	// Modificateurs
70  
71  	/**
72  	 * modify the url of th object adress
73  	 * 
74  	 * @param url
75  	 *            the new url
76  	 */
77  	public void setURL(URL url) {
78  		this._url = url;
79  	}
80  
81  	/**
82  	 * modify the time of th object adress
83  	 * 
84  	 * @param time
85  	 *            the new time
86  	 */
87  	public void setTime(String time) {
88  		this._time = time;
89  	}
90  
91  	// Accesseurs
92  
93  	/**
94  	 * return the url of the object adress
95  	 * 
96  	 * @return _url the url of the object adress
97  	 */
98  	public URL getURL() {
99  		return this._url;
100 	}
101 
102 	/**
103 	 * return the time of the object adress
104 	 * 
105 	 * @return _url the time of the object adress
106 	 */
107 	public String getTime() {
108 		return this._time;
109 	}
110 
111 	/**
112 	 * allow to dispay an object adress.
113 	 * 
114 	 * @return ret
115 	 */
116 	public String toString() {
117 		return getURL() + "  " + getTime();
118 	}
119 }