com.novell.admin.ns
Interface Strategy

All Known Subinterfaces:
ValueStrategy
All Known Implementing Classes:
ListStrategy

public interface Strategy

Contract for all strategy classes.

Applications should not directly use any of these methods. Please refer to Syntax and Value classes instead.


Method Summary
 long compare(ValueComponent component1, ValueComponent component2)
          Returns the difference between to components.
 ValueComponent createValueComponent()
          Creates a ValueComponent.
 ValueComponent createValueComponent(java.lang.Object initialData)
          Creates a ValueComponent.
 boolean equals(ValueComponent component1, ValueComponent component2)
          Tests if two ValueComponents are identical.
 boolean isWithinBounds(ValueComponent comp, long lowerBound, long upperBound)
          Checks if a component is within bounds.
 java.lang.String toString(ValueComponent component)
          Converts a ValueComponent to a String.
 

Method Detail

toString

public java.lang.String toString(ValueComponent component)
Converts a ValueComponent to a String.

This method is used by the ValueComponents toString() method.

Parameters:
component - The component to convert.
Returns:
new String

equals

public boolean equals(ValueComponent component1,
                      ValueComponent component2)
Tests if two ValueComponents are identical.

This method is used by the ValueComponents equals(Object) method.

Parameters:
component1 - First component.
component2 - Second component.
Returns:
True if components are identical.
See Also:
ValueComponent.equals(Object)

compare

public long compare(ValueComponent component1,
                    ValueComponent component2)
Returns the difference between to components.

This method is used by the ValueComponents compareTo(ValueComponent) method.

Parameters:
component1 - First component.
component2 - Second component.
Returns:
The difference between component1 and component2.
See Also:
ValueComponent.compareTo(ValueComponent)

createValueComponent

public ValueComponent createValueComponent()
Creates a ValueComponent.

This method is used when a ValueComponent needs to be constructed but there is no data available.

Returns:
A newly constructed ValueComponent.

createValueComponent

public ValueComponent createValueComponent(java.lang.Object initialData)
                                    throws ComponentCreationException
Creates a ValueComponent.

This method is used when a ValueComponent needs to be constructed and there is initialization data available.

Parameters:
initialData - The data used to initialize the value component.
Returns:
A newly constructed ValueComponent.
Throws:
ComponentCreationException - The 'initialData' object could not be used to create a valueComponent.

isWithinBounds

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

This method is called by the ObjectAttribute class when a ValueComponent is being inserted as an element of the ObjectAttribute and the ObjectAttribute is sized.

Parameters:
comp - ValueComponent that needs to be checked.
lowerBound - The lower limit to check.
upperBound - The upper limit to check.
Returns:
True if within the upper and lower limits (inclusive), false otherwise.


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.