com.novell.admin.ns
Class BooleanStrategy

java.lang.Object
  extended bycom.novell.admin.ns.BooleanStrategy
All Implemented Interfaces:
Strategy, ValueStrategy

public abstract class BooleanStrategy
extends java.lang.Object
implements ValueStrategy

Final class that implements the strategy for the boolean syntax.

This class is not public and no methods should be available to applications.


Constructor Summary
BooleanStrategy()
           
 
Method Summary
 boolean canCreateValue(java.lang.Object obj)
          Test to see if a BooleanValue can be created from the specified object.
 long compare(ValueComponent obj1, ValueComponent obj2)
          Tests to see how two BooleanValues compare.
 ValueComponent createValueComponent()
          Factory a new ValueComponent using default values.
 ValueComponent createValueComponent(java.lang.Object obj)
          Factory a new ValueComponent using specified values.
 boolean equals(ValueComponent obj1, ValueComponent obj2)
          Tests to see if two BooleanValues are identical.
 boolean isWithinBounds(ValueComponent comp, long lowerBound, long upperBound)
          Check to see if a BooleanComponent is within certain bounds.
 java.lang.String toString(ValueComponent obj)
          Converts the ValueComponent 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.ValueStrategy
getSyntax
 

Constructor Detail

BooleanStrategy

public BooleanStrategy()
Method Detail

canCreateValue

public boolean canCreateValue(java.lang.Object obj)
Test to see if a BooleanValue can be created from the specified object.

Specified by:
canCreateValue in interface ValueStrategy
Parameters:
obj - Any object.
Returns:
true if create will succeed, false otherwise.

compare

public long compare(ValueComponent obj1,
                    ValueComponent obj2)
Tests to see how two BooleanValues compare.

Specified by:
compare in interface Strategy
Parameters:
obj1 - Must be a BooleanValue.
obj2 - Must be a BooleanValue.
Returns:
0 if equal, -1 if obj1=false and obj2=true +1 if obj1=true and obj2=false other non-zero number if the syntaxes are different.
See Also:
ValueComponent.compareTo(ValueComponent)

createValueComponent

public ValueComponent createValueComponent()
Factory a new ValueComponent using default values.

Specified by:
createValueComponent in interface Strategy
Returns:
The new BooleanValue initialized to true.

createValueComponent

public ValueComponent createValueComponent(java.lang.Object obj)
                                    throws ComponentCreationException
Factory a new ValueComponent using specified values.

Specified by:
createValueComponent in interface Strategy
Parameters:
obj - The object used as the initial value.
Returns:
The new BooleanValue initialized to true.
Throws:
ComponentCreationException - if 'obj' cannot be used as the initial value.

equals

public boolean equals(ValueComponent obj1,
                      ValueComponent obj2)
Tests to see if two BooleanValues are identical.

Specified by:
equals in interface Strategy
Parameters:
obj1 - Must be a BooleanValue.
obj2 - Any other Value type.
Returns:
true if 'obj1' is equal to 'obj2'.
See Also:
ValueComponent.equals(Object)

isWithinBounds

public boolean isWithinBounds(ValueComponent comp,
                              long lowerBound,
                              long upperBound)
Check to see if a BooleanComponent is within certain bounds.

Specified by:
isWithinBounds in interface Strategy
Parameters:
comp - The ValueComponent holding the values.
lowerBound - The lower bound.
upperBound - The upper bound.
Returns:
Always false.

toString

public java.lang.String toString(ValueComponent obj)
Converts the ValueComponent to a string.

Specified by:
toString in interface Strategy
Parameters:
obj - Must be a BooleanValue.
Returns:
String representation of the value.
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.