org.hd.d.pg2k.webSvr.ads
Class GoogleAdSenseUnitBean

java.lang.Object
  extended by org.hd.d.pg2k.webSvr.ads.GoogleAdSenseUnitBean
All Implemented Interfaces:
AdBeanInterface

public final class GoogleAdSenseUnitBean
extends java.lang.Object
implements AdBeanInterface

This implements the Google AdSense/AdLink bean. This picks colours, etc, to blend into the site as appropriate, and shows alternate ads or collapses units as appropriate.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hd.d.pg2k.webSvr.ads.AdBeanInterface
AdBeanInterface.Context
 
Field Summary
static java.lang.String AD_FORMAT_AS_ADLINKS_NARROW_BOX
          Parameter value to select narrow (120x90) AdLinks box with 4 or 5 lines; shows alternate content rather than PSA.
static java.lang.String AD_FORMAT_AS_ADLINKS_WIDE_BOX
          Parameter value to select wide (160x90) AdLinks box with 4 or 5 lines; shows alternate content rather than PSA.
private  java.lang.String selectedFormat
          Requested ad format or null; volatile to allow lock-less thread-safe access.
 
Constructor Summary
GoogleAdSenseUnitBean()
           
 
Method Summary
 boolean canMakeHTMLBodyInsert(AdBeanInterface.Context ctxt)
          Can make an HTML body-text insert in the given context.
 java.lang.String getHTMLBodyInsert(AdBeanInterface.Context ctxt, java.util.Random source)
          Make HTML body text in the given context, or null if none can be made.
 AdBeanInterface setParams(java.lang.String rawParams)
          Can be used to set general parameters for the bean, or can be null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AD_FORMAT_AS_ADLINKS_WIDE_BOX

public static final java.lang.String AD_FORMAT_AS_ADLINKS_WIDE_BOX
Parameter value to select wide (160x90) AdLinks box with 4 or 5 lines; shows alternate content rather than PSA.

See Also:
Constant Field Values

AD_FORMAT_AS_ADLINKS_NARROW_BOX

public static final java.lang.String AD_FORMAT_AS_ADLINKS_NARROW_BOX
Parameter value to select narrow (120x90) AdLinks box with 4 or 5 lines; shows alternate content rather than PSA.

See Also:
Constant Field Values

selectedFormat

private volatile java.lang.String selectedFormat
Requested ad format or null; volatile to allow lock-less thread-safe access.

Constructor Detail

GoogleAdSenseUnitBean

public GoogleAdSenseUnitBean()
Method Detail

setParams

public AdBeanInterface setParams(java.lang.String rawParams)
Can be used to set general parameters for the bean, or can be null.

Specified by:
setParams in interface AdBeanInterface
Returns:
instance so as to allow pure expression constructions of form (new ...Bean()).setParams().getHTMLBodyInsert(xxx, rnd)

canMakeHTMLBodyInsert

public boolean canMakeHTMLBodyInsert(AdBeanInterface.Context ctxt)
Can make an HTML body-text insert in the given context. Always true for AdSense.

Specified by:
canMakeHTMLBodyInsert in interface AdBeanInterface

getHTMLBodyInsert

public java.lang.String getHTMLBodyInsert(AdBeanInterface.Context ctxt,
                                          java.util.Random source)
Make HTML body text in the given context, or null if none can be made.

Specified by:
getHTMLBodyInsert in interface AdBeanInterface
Parameters:
ctxt - not used
source - not used

DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.