wtanaka.praya.gale
Class SubscriptionList
java.lang.Object
|
+--wtanaka.praya.gale.SubscriptionList
- public class SubscriptionList
- 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:
- a tree whose edges represent characters. The path to a given
node in a tree represents the string constructed by concatenating
the characters on the edges along the path. Each node in the tree
contains a boolean representing whether strings starting with that
node's path-string are contained in the subscription list. A null
child for a node is equivalent to the entire subtree for that
character containing the same boolean as the node itself.
Simplification in this case consists of finding nodes whose
children all contain the same value, and removing all of those
children.
- An ordered list of subscriptions. Each subscription can "hide"
previous subscriptions by making them irrelevant. Simplification
in this case consists of removing all items in the list which are
hidden by later items.
Return to
or the Praya Homepage
- Version:
- $Name: $ $Date: 2001/09/30 21:14:52 $
- Author:
- $Author: wtanaka $
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
m_subscriptions
java.lang.String[] m_subscriptions
m_simpleVersion
private volatile SubscriptionList m_simpleVersion
SubscriptionList
public SubscriptionList()
- The empty subscription list.
SubscriptionList
public SubscriptionList(java.lang.String subs)
SubscriptionList
private SubscriptionList(java.lang.String[] subs)
getSubscriptionArray
public java.lang.String[] getSubscriptionArray()
concatenateWithSeparator
private java.lang.String concatenateWithSeparator(char separator)
getOWOString
public java.lang.String getOWOString()
matchesCategory
public boolean matchesCategory(java.lang.String category)
withCategory
public SubscriptionList withCategory(java.lang.String category)
- Returns a (possibly optimized) subscription list equivalent to
this with ":category" appended to the end of it.
withoutCategory
public SubscriptionList withoutCategory(java.lang.String category)
- Returns a (possibly optimized) subscription list equivalent to
this with ":-category" appended to the end of it.
supersetWith
public SubscriptionList supersetWith(SubscriptionList 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)
populateSimpleVersion
private void populateSimpleVersion()
simplify
public SubscriptionList 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