SynSoft Java Standard Library

synsoft.org


org.synsoft.base
Class InOutParameter

java.lang.Object
  |
  +--org.synsoft.base.InOutParameter

public class InOutParameter
extends java.lang.Object

This class represents a proxy to a reference for an object, providing a simple generic mechanism for implementing true call-by-reference semantics with Java class methods.


Field Summary
protected  java.lang.Object m_object
          The actual reference to the object.
static Version scm_version
          Constant instance of version information for class.
 
Constructor Summary
InOutParameter()
          Constructs an empty object InOutParameter.
InOutParameter(java.lang.Object object)
          Constructs the object InOutParameter on the given object
 
Method Summary
 java.lang.Object getReference()
          Gets the object reference
 int hashCode()
          Returns a hash code value for the object This function actually returns the hashCode() result of the referent
 void setReference(java.lang.Object object)
          Sets the object reference
static void swap(InOutParameter p1, InOutParameter p2)
          Swaps the reference of two InOutParameter objects
 java.lang.Object swapReference(java.lang.Object object)
          Sets the object reference, and returns the previous reference
 java.lang.String toString()
          Returns a string representation of the object This function actually returns the toString() result of the referent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

m_object

protected java.lang.Object m_object
The actual reference to the object.

scm_version

public static final Version scm_version
Constant instance of version information for class.
Constructor Detail

InOutParameter

public InOutParameter()
Constructs an empty object InOutParameter.

InOutParameter

public InOutParameter(java.lang.Object object)
Constructs the object InOutParameter on the given object
Parameters:
object - The object on which to hold a InOutParameter
Method Detail

setReference

public void setReference(java.lang.Object object)
Sets the object reference
Parameters:
object - The object on which to hold a reference

getReference

public final java.lang.Object getReference()
Gets the object reference
Returns:
The referenced object

swapReference

public java.lang.Object swapReference(java.lang.Object object)
Sets the object reference, and returns the previous reference
Parameters:
object - The object on which to hold a reference
Returns:
The previously referenced object

swap

public static void swap(InOutParameter p1,
                        InOutParameter p2)
Swaps the reference of two InOutParameter objects
Parameters:
p1 - The first object ref (its contents will be swapped with those of p2)
p2 - The second object ref (its contents will be swapped with those of p1)

toString

public final java.lang.String toString()
Returns a string representation of the object This function actually returns the toString() result of the referent
Overrides:
toString in class java.lang.Object

hashCode

public final int hashCode()
Returns a hash code value for the object This function actually returns the hashCode() result of the referent
Overrides:
hashCode in class java.lang.Object

version 2.0.1.231

Copyright © Synesis Software. Licensed according to the Synesis Software Standard Public License