com.novell.admin.ns
Class HexStrategy

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

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

Final class that implements the strategy for the OCTET_STRING syntax.

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


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

HexStrategy

public HexStrategy()
Method Detail

canCreateValue

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

Specified by:
canCreateValue in interface ValueStrategy
Parameters:
obj - Must be a byte[] or String object.
Returns:
true if create will succeed, false otherwise.

compare

public long compare(ValueComponent obj1,
                    ValueComponent obj2)
Tests to see how two HexValue compare. It not intended for finding the difference of two ValueComponents but for sorting the ValueComponents.

Specified by:
compare in interface Strategy
Parameters:
obj1 - Must be a HexValue.
obj2 - Must be a HexValue.
Returns:
0 if equal, greater than 1 for obj1>obj2 or less than 1 for obj1See Also:
ValueComponent.compareTo(ValueComponent)

createValueComponent

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

Specified by:
createValueComponent in interface Strategy
Returns:
The new HexValue.

createValueComponent

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

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

equals

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

Specified by:
equals in interface Strategy
Parameters:
obj1 - First ValueComponent which must be a HexValue.
obj2 - Second ValueComponent.
Returns:
true if 'obj1' is equal to 'obj2'.
See Also:
ValueComponent.equals(Object)

isWithinBounds

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

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:
true if within the upper and lower limits (inclusive), false otherwise.

toString

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

Specified by:
toString in interface Strategy
Parameters:
obj - The ValueComponent to convert must be a HexValue.
Returns:
The HexValue 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.