com.novell.admin.ns
Class ListStrategy

java.lang.Object
  extended bycom.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 algorithm 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 algorithm 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 algorithm 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
 
Methods inherited from interface com.novell.admin.ns.Strategy
createValueComponent, createValueComponent
 

Field Detail

TOSTRING_LIMIT

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

See Also:
Constant Field Values
Constructor Detail

ListStrategy

public ListStrategy()
Method Detail

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.

compare

public long compare(ValueComponent component1,
                    ValueComponent component2)
Default algorithm 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 component1See Also:
ValueComponent.compareTo(ValueComponent)

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.

equals

public boolean equals(ValueComponent component1,
                      ValueComponent component2)
Default algorithm 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.
See Also:
ValueComponent.equals(Object)

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.

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.

toString

public java.lang.String toString(ValueComponent component)
Default algorithm to convert a ValueList to a String.

The length of the string returned for a ValueList object by this method is limited to 256 bytes.

Specified by:
toString in interface Strategy
Parameters:
component - ValueComponent to convert. Should be a ValueList.
Returns:
new String
See Also:
ValueComponent.toString()


API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated September 2 2004 0111.