org.datanucleus.store.types.sco.simple
Class BitSet

java.lang.Object
  extended by java.util.BitSet
      extended by org.datanucleus.store.types.sco.simple.BitSet
All Implemented Interfaces:
Serializable, Cloneable, SCO

public class BitSet
extends BitSet
implements SCO

A mutable second-class BitSet object.

See Also:
Serialized Form

Field Summary
protected  String fieldName
           
protected  ObjectProvider ownerSM
           
 
Constructor Summary
BitSet(ObjectProvider ownerSM, String fieldName)
          Creates a BitSet object.
 
Method Summary
 void and(BitSet set)
           
 void andNot(BitSet set)
           
 void attachCopy(Object value)
          Method to attached the passed value.
 void clear()
           
 void clear(int bitIndex)
           
 void clear(int fromIndex, int toIndex)
           
 Object clone()
          Creates and returns a copy of this object.
 Object detachCopy(FetchPlanState state)
          Method to detach a copy.
 void flip(int bitIndex)
           
 void flip(int fromIndex, int toIndex)
           
 String getFieldName()
          Accessor for the field name
 Object getOwner()
          Accessor for the owner.
 Object getValue()
          Accessor for the unwrapped value that we are wrapping.
 void initialise()
          Method to initialise the SCO for use.
 void initialise(Object o, boolean forInsert, boolean forUpdate)
          Method to initialise the SCO from an existing value.
 void makeDirty()
          Utility to mark the object as dirty
 void or(BitSet set)
           
 void set(int bitIndex)
           
 void set(int bitIndex, boolean value)
           
 void set(int fromIndex, int toIndex)
           
 void set(int fromIndex, int toIndex, boolean value)
           
 void unsetOwner()
          Utility to unset the owner.
protected  Object writeReplace()
          The writeReplace method is called when ObjectOutputStream is preparing to write the object to the stream.
 void xor(BitSet set)
           
 
Methods inherited from class java.util.BitSet
cardinality, equals, get, get, hashCode, intersects, isEmpty, length, nextClearBit, nextSetBit, size, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ownerSM

protected transient ObjectProvider ownerSM

fieldName

protected transient String fieldName
Constructor Detail

BitSet

public BitSet(ObjectProvider ownerSM,
              String fieldName)
Creates a BitSet object. Assigns owning object and field name.

Parameters:
ownerSM - the owning object
fieldName - the owning field name
Method Detail

initialise

public void initialise()
Method to initialise the SCO for use.

Specified by:
initialise in interface SCO

initialise

public void initialise(Object o,
                       boolean forInsert,
                       boolean forUpdate)
Method to initialise the SCO from an existing value.

Specified by:
initialise in interface SCO
Parameters:
o - The Object
forInsert - Whether the object needs inserting in the datastore with this value
forUpdate - Whether to update the object in the datastore with this value

getValue

public Object getValue()
Accessor for the unwrapped value that we are wrapping.

Specified by:
getValue in interface SCO
Returns:
The unwrapped value

unsetOwner

public void unsetOwner()
Utility to unset the owner.

Specified by:
unsetOwner in interface SCO

getOwner

public Object getOwner()
Accessor for the owner.

Specified by:
getOwner in interface SCO
Returns:
The owner

getFieldName

public String getFieldName()
Accessor for the field name

Specified by:
getFieldName in interface SCO
Returns:
The field name

makeDirty

public void makeDirty()
Utility to mark the object as dirty


detachCopy

public Object detachCopy(FetchPlanState state)
Method to detach a copy.

Specified by:
detachCopy in interface SCO
Parameters:
state - State for detachment process
Returns:
A copy of the object

attachCopy

public void attachCopy(Object value)
Method to attached the passed value.

Specified by:
attachCopy in interface SCO
Parameters:
value - The new value

clone

public Object clone()
Creates and returns a copy of this object.

Mutable second-class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.

Specified by:
clone in interface SCO
Overrides:
clone in class BitSet
Returns:
A clone of the object

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
The writeReplace method is called when ObjectOutputStream is preparing to write the object to the stream. The ObjectOutputStream checks whether the class defines the writeReplace method. If the method is defined, the writeReplace method is called to allow the object to designate its replacement in the stream. The object returned should be either of the same type as the object passed in or an object that when read and resolved will result in an object of a type that is compatible with all references to the object.

Returns:
the replaced object
Throws:
ObjectStreamException

and

public void and(BitSet set)
Overrides:
and in class BitSet

andNot

public void andNot(BitSet set)
Overrides:
andNot in class BitSet

clear

public void clear(int bitIndex)
Overrides:
clear in class BitSet

or

public void or(BitSet set)
Overrides:
or in class BitSet

set

public void set(int bitIndex)
Overrides:
set in class BitSet

xor

public void xor(BitSet set)
Overrides:
xor in class BitSet

clear

public void clear()
Overrides:
clear in class BitSet

clear

public void clear(int fromIndex,
                  int toIndex)
Overrides:
clear in class BitSet

flip

public void flip(int fromIndex,
                 int toIndex)
Overrides:
flip in class BitSet

flip

public void flip(int bitIndex)
Overrides:
flip in class BitSet

set

public void set(int bitIndex,
                boolean value)
Overrides:
set in class BitSet

set

public void set(int fromIndex,
                int toIndex,
                boolean value)
Overrides:
set in class BitSet

set

public void set(int fromIndex,
                int toIndex)
Overrides:
set in class BitSet


Copyright © 2012. All Rights Reserved.