com.novell.admin.ns
Class HexStrategy

java.lang.Object
  |
  +--com.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 NDS 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.
 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
 

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.

createValueComponent

public ValueComponent createValueComponent()
Factory a new ValueComponent using default values.
Returns:
The new HexValue.

createValueComponent

public ValueComponent createValueComponent(java.lang.Object obj)
                                    throws ComponentCreationException
Factory a new HexValue using specified values.
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.
Parameters:
obj1 - First ValueComponent which must be a HexValue.
obj2 - Second ValueComponent.
Returns:
true if 'obj1' is equal to 'obj2'.

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.
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 obj1

toString

public java.lang.String toString(ValueComponent obj)
Converts a HexValue to a string.
Parameters:
obj - The ValueComponent to convert must be a HexValue.
Returns:
The HexValue string.


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.