com.novell.admin.ns
Class ListStrategy

java.lang.Object
  |
  +--com.novell.admin.ns.ListStrategy
All Implemented Interfaces:
Strategy

public abstract class ListStrategy
extends java.lang.Object
implements Strategy

Abstract class for all stategies that support value lists.

See Also:
ValueList

Field Summary
protected static int TOSTRING_LIMIT
          Max string length returned by toString().
 
Constructor Summary
ListStrategy()
           
 
Method Summary
 boolean canInsertComponent(ValueList list, ValueComponent comp)
          Default test to see if the associated ValueList can have a specific type of ValueComponent inserted as an aggregate.
 boolean canRemoveComponent(ValueList list, ValueComponent comp)
          Default test to see if a specific ValueComponent can be removed from the associated ValueList.
 long compare(ValueComponent component1, ValueComponent component2)
          Default algorithym to compare two ValueComponent objects.
abstract  java.lang.Object createFacade(ValueComponent comp)
          Create a facade for the syntax associated with this strategy.
 boolean equals(ValueComponent component1, ValueComponent component2)
          Default algorithym to test if two ValueComponent objects are identical.
 java.util.Vector getAddableSyntaxes(ValueList list)
          Get a Vector of all possible syntaxes that can be constructed and added as aggregates of the associated ValueList.
 boolean isWithinBounds(ValueComponent comp, long lowerBound, long upperBound)
          Used to test if a component is within bounds.
 java.lang.String toString(ValueComponent component)
          Default algorithym to convert a ValueList to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOSTRING_LIMIT

protected static final int TOSTRING_LIMIT
Max string length returned by toString().
Constructor Detail

ListStrategy

public ListStrategy()
Method Detail

getAddableSyntaxes

public java.util.Vector getAddableSyntaxes(ValueList list)
Get a Vector of all possible syntaxes that can be constructed and added as aggregates of the associated ValueList.

By default, an empty vector is returned. Composite syntaxes that allow components to be aggregated must override this method and supply an appropriately populated vector.

Returns:
An empty vector.

canInsertComponent

public boolean canInsertComponent(ValueList list,
                                  ValueComponent comp)
Default test to see if the associated ValueList can have a specific type of ValueComponent inserted as an aggregate.
Parameters:
comp - ValueComponent to test.
Returns:
false is always returned.

canRemoveComponent

public boolean canRemoveComponent(ValueList list,
                                  ValueComponent comp)
Default test to see if a specific ValueComponent can be removed from the associated ValueList.
Parameters:
comp - ValueComponent to test.
Returns:
false is always returned.

toString

public java.lang.String toString(ValueComponent component)
Default algorithym to convert a ValueList to a String.
Specified by:
toString in interface Strategy
Parameters:
component - ValueComponent to convert. Should be a ValueList.
Returns:
new String

equals

public boolean equals(ValueComponent component1,
                      ValueComponent component2)
Default algorithym to test if two ValueComponent objects are identical.
Specified by:
equals in interface Strategy
Parameters:
component1 - First ValueComponent which must be a ValueList.
component2 - Second ValueComponent.
Returns:
true if component1 and component2 are identical.

compare

public long compare(ValueComponent component1,
                    ValueComponent component2)
Default algorithym to compare two ValueComponent objects.
Specified by:
compare in interface Strategy
Parameters:
component1 - First ValueComponent object which must be a ValueList.
component2 - Second ValueComponent object which must be a ValueList.
Returns:
0 if equal, greater than 1 for component1>component2 or less than 1 for component1

createFacade

public abstract java.lang.Object createFacade(ValueComponent comp)
                                       throws IncompatibleComponentException
Create a facade for the syntax associated with this strategy.
Parameters:
comp - The component that the facade is to be associated with.
Throws:
IncompatibleComponentException - 'comp' was not of the proper syntax.

isWithinBounds

public boolean isWithinBounds(ValueComponent comp,
                              long lowerBound,
                              long upperBound)
Used to test if a component is within bounds.

Most composite syntaxes do not support limits. Therefore, the default behavior is to return false. This behavior must be overridden when needed!

Specified by:
isWithinBounds in interface Strategy
Parameters:
comp - ValueComponent that needs to be checked.
lowerBound - lower limit to check.
upperBound - upper limit to check.
Returns:
false under all conditions.


API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated December 17 2003 1746.