home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / un2maiq4 / pjjava / src / pj / awt / pjadspec.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  2.9 KB  |  125 lines

  1. /*---------------------------------------------------------------------------
  2.  
  3.         Written by the Personal Journal developers of Dow Jones & Company, Inc.
  4.  
  5.     Dow Jones makes no representations or warranties about 
  6.     the suitability of this software, either express or 
  7.     implied, including but not limited to the implied warranties 
  8.     of merchantability, fitness for a particular purpose, 
  9.     or non-infringement.  Dow Jones will not be liable for 
  10.     any damages suffered by a user as a result of using, 
  11.     modifying or distributing this software or its derivatives.
  12.  
  13.  
  14.         @(#)PjAdSpec.java   0.00 16-Jan-96
  15.  
  16.         A specification for a Personal Journal advertisement.
  17.  
  18.         Authors:
  19.  
  20.         rphall          Rick Hall
  21.         jlee            James Lee
  22.  
  23.         Version Ident:
  24.  
  25.         $Header: /PjJavaClient/src/pj/awt/PjAdSpec.java 4     1/24/96 1:33a Rphall $
  26.  
  27.         History:
  28.  
  29.         16-Jan-1996 rphall     Initial Creation
  30.         21-Mar-1996 jlee       Added getLinkTitle() that returns the string title of the link
  31.  
  32. ---------------------------------------------------------------------------*/
  33.  
  34. package pj.awt;
  35.  
  36. import pj.net.RemoteImage;
  37. import pj.net.RemoteString;
  38. import pj.net.RemoteURL;
  39.  
  40. import java.awt.Image;
  41. import java.net.URL;
  42.  
  43. /**
  44.  * A specification for a Personal Journal advertisement.
  45.  *
  46.  * @version 0.00 16-Jan-1996
  47.  * @author Rick Hall
  48. */
  49. public class PjAdSpec
  50.     {
  51.  
  52.  
  53.      // --- Instance variables
  54.  
  55.     /**
  56.      * A RemoteImage containing an image for the ad
  57.     */
  58.     RemoteImage riAdImage;
  59.  
  60.     /**
  61.      * A RemoteString containing text copy for the ad
  62.     */
  63.     RemoteString rsAdCopy;
  64.  
  65.     /**
  66.      * A RemoteURL containing a home page link for the ad
  67.     */
  68.     RemoteURL ruAdURL;
  69.  
  70.  
  71.     // --- Public constructors
  72.  
  73.     /**
  74.      * Constructs an PjAdSpec
  75.      *
  76.      * @param ri A RemoteImage containing an image for the ad
  77.      * @param rs A RemoteString containing text copy for the ad
  78.      * @param ru A RemoteURL containing a home page link for the ad
  79.     */
  80.     public PjAdSpec( RemoteImage ri, RemoteString rs, RemoteURL ru)
  81.         {
  82.         riAdImage = ri;
  83.         rsAdCopy  = rs;
  84.         ruAdURL   = ru;
  85.         System.out.println("Debug-PjAdSpec:constructed");
  86.         }
  87.  
  88.     // --- Public operations
  89.  
  90.     /**
  91.      * @return The ad image
  92.     */
  93.     public Image getImage()
  94.         { 
  95.         return riAdImage.getImage(); 
  96.         }
  97.  
  98.     /**
  99.      * @return The ad copy. This operation blocks.
  100.     */
  101.     public String getCopy()
  102.         { 
  103.         return rsAdCopy.getString(); 
  104.         }
  105.  
  106.     /**
  107.      * @return The ad home page link
  108.     */
  109.     public URL getLink()
  110.         { 
  111.         return ruAdURL.getURL(); 
  112.         }
  113.  
  114.     /**
  115.      * @return The link title
  116.     */
  117.     public String getLinkTitle()
  118.         { 
  119.         return ruAdURL.getURLTitle(); 
  120.         }
  121.     
  122.    
  123.  
  124.     } // PjAdSpec
  125.