com.novell.xsl.process
Class StripList

java.lang.Object
  extended bycom.novell.xsl.process.StripList

public class StripList
extends Object

This class contains ElementMatch objects for the purpose of source tree whitespace stripping


Constructor Summary
StripList()
           
 
Method Summary
 void add(ElementMatch match)
          Adds the ElementMatch object to this list.
 boolean checkStrip(Node node)
          Check the passed node against the strip/preserve sets.
 void clear()
          Clear all items from this list
 void dump(PrintWriter out, int indent)
          Dumps this object to the specified output stream.
 ElementMatch[] getList()
          Optimizes this StripList for matching (if it isn't already optimized) and returns the optimized ElementMatch objects.
 void optimize()
          Optimizes this StripList for matching.
 int size()
          Return number of objects in list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StripList

public StripList()
Method Detail

add

public void add(ElementMatch match)
Adds the ElementMatch object to this list. This method causes this StripList to become unoptimized.

Parameters:
match - The Element match to be added.

clear

public void clear()
Clear all items from this list


size

public int size()
Return number of objects in list

Returns:
Number of ElementMatch objects in list

getList

public ElementMatch[] getList()
Optimizes this StripList for matching (if it isn't already optimized) and returns the optimized ElementMatch objects. The returned objects are sorted according to the ElementMatch compareTo method. The returned array must not be modified even though there is no enforcement mechanism.

Returns:
this StripList's optimized ElementMatch objects

checkStrip

public boolean checkStrip(Node node)
Check the passed node against the strip/preserve sets. This will return false if the passed node isn't part of the strip set. This may be because it is in an explicit preserve set, or because the node isn't an element, or because the node wasn't found in any explicit set.

Parameters:
node - The node to check.
Returns:
true is the node is in a strip set

dump

public void dump(PrintWriter out,
                 int indent)
Dumps this object to the specified output stream.

Parameters:
out - the output stream to write to
indent - number of tabs to indent

optimize

public void optimize()
Optimizes this StripList for matching.