wtanaka.praya.gale
Class NWOSubscriptionList

java.lang.Object
  |
  +--wtanaka.praya.gale.NWOSubscriptionList

public class NWOSubscriptionList
extends java.lang.Object

A Subscription List container which supports set-like operations on subscription lists. You can think of simplifying subscription lists in at least two ways:

Return to Sourceforge or the Praya Homepage

Version:
$Name: $ $Date: 2001/09/30 21:14:52 $
Author:
$Author: wtanaka $

Field Summary
(package private)  Subscription[] m_subscriptions
           
 
Constructor Summary
  NWOSubscriptionList()
          The empty subscription list.
  NWOSubscriptionList(java.lang.String nwo, java.lang.String defaultDomain)
          Separates the string on spaces, interprets each part as a literal "-" or a location, and returns a subscription list.
private NWOSubscriptionList(Subscription[] subs)
          Deprecated. is this still being used?
 
Method Summary
 java.lang.String getNWOString()
          Gets the subscription list as a list of space-separated locations
 java.lang.String getOWOString()
          Gets the subscription list as a list of colon-separated categories
 boolean matchesLocation(Location location)
           
 NWOSubscriptionList simplify()
          Tries to simplify this subscription list into a shorter list which matches the same categories.
 NWOSubscriptionList supersetWith(NWOSubscriptionList list)
          Returns a superset of this subscription list combined with the one given passed as a parameter.
(package private)  Subscription[] testCode_getSubscriptionArray()
          For use by test code.
 java.lang.String toString()
           
 NWOSubscriptionList withLocation(Location location)
          Returns a (possibly optimized) subscription list equivalent to this with the given Location appended to the end of it.
 NWOSubscriptionList withoutLocation(Location location)
          Returns a (possibly optimized) subscription list equivalent to this with - location appended to the end of it.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

m_subscriptions

Subscription[] m_subscriptions
Constructor Detail

NWOSubscriptionList

public NWOSubscriptionList()
The empty subscription list.

NWOSubscriptionList

private NWOSubscriptionList(Subscription[] subs)
Deprecated. is this still being used?


NWOSubscriptionList

public NWOSubscriptionList(java.lang.String nwo,
                           java.lang.String defaultDomain)
Separates the string on spaces, interprets each part as a literal "-" or a location, and returns a subscription list.
Parameters:
nwo - a subscription list in GALE_SUBSCRIBE format as described at http://gale.org/revolution/nwo
Method Detail

testCode_getSubscriptionArray

Subscription[] testCode_getSubscriptionArray()
For use by test code.

getOWOString

public java.lang.String getOWOString()
Gets the subscription list as a list of colon-separated categories

getNWOString

public java.lang.String getNWOString()
Gets the subscription list as a list of space-separated locations

matchesLocation

public boolean matchesLocation(Location location)

withLocation

public NWOSubscriptionList withLocation(Location location)
Returns a (possibly optimized) subscription list equivalent to this with the given Location appended to the end of it.

withoutLocation

public NWOSubscriptionList withoutLocation(Location location)
Returns a (possibly optimized) subscription list equivalent to this with - location appended to the end of it.

supersetWith

public NWOSubscriptionList supersetWith(NWOSubscriptionList list)
Returns a superset of this subscription list combined with the one given passed as a parameter. The superset SS between two subscription lists S1 and S2 is defined as follows: (S1.matchesCategory(foo) || S2.matchesCategory (foo)) => SS.matchesCategory(foo)

simplify

public NWOSubscriptionList simplify()
Tries to simplify this subscription list into a shorter list which matches the same categories.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object