Class BitSet
- java.lang.Object
-
- java.util.BitSet
-
- org.datanucleus.store.types.wrappers.BitSet
-
- All Implemented Interfaces:
Serializable,Cloneable,SCO<BitSet>
public class BitSet extends BitSet implements SCO<BitSet>
A mutable second-class BitSet object.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractMemberMetaDataownerMmdprotected ObjectProviderownerOP
-
Constructor Summary
Constructors Constructor Description BitSet(ObjectProvider op, AbstractMemberMetaData mmd)Creates a BitSet object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidand(BitSet set)voidandNot(BitSet set)voidattachCopy(BitSet value)Method to attached the passed value.voidclear()voidclear(int bitIndex)voidclear(int fromIndex, int toIndex)Objectclone()Creates and returns a copy of this object.BitSetdetachCopy(FetchPlanState state)Method to detach a copy.voidflip(int bitIndex)voidflip(int fromIndex, int toIndex)StringgetFieldName()Accessor for the field nameObjectgetOwner()Accessor for the owner.BitSetgetValue()Accessor for the unwrapped value that we are wrapping.voidinitialise()Method to initialise the SCO for use, and allowing the SCO to be loaded from the datastore (when we have a backing store).voidinitialise(BitSet set)Method to initialise the SCO for use with the provided initial value.voidinitialise(BitSet newValue, Object oldValue)Method to initialise the SCO for use, where replacing an old value with a new value such as when calling a setter field passing in a new value.voidmakeDirty()Utility to mark the object as dirtyvoidor(BitSet set)voidset(int bitIndex)voidset(int bitIndex, boolean value)voidset(int fromIndex, int toIndex)voidset(int fromIndex, int toIndex, boolean value)voidunsetOwner()Utility to unset the owner.protected ObjectwriteReplace()The writeReplace method is called when ObjectOutputStream is preparing to write the object to the stream.voidxor(BitSet set)-
Methods inherited from class java.util.BitSet
cardinality, equals, get, get, hashCode, intersects, isEmpty, length, nextClearBit, nextSetBit, previousClearBit, previousSetBit, size, stream, toByteArray, toLongArray, toString, valueOf, valueOf, valueOf, valueOf
-
-
-
-
Field Detail
-
ownerOP
protected transient ObjectProvider ownerOP
-
ownerMmd
protected transient AbstractMemberMetaData ownerMmd
-
-
Constructor Detail
-
BitSet
public BitSet(ObjectProvider op, AbstractMemberMetaData mmd)
Creates a BitSet object. Assigns owning object and field name.- Parameters:
op- ObjectProvider for the owning objectmmd- Metadata for the member
-
-
Method Detail
-
initialise
public void initialise()
Description copied from interface:SCOMethod to initialise the SCO for use, and allowing the SCO to be loaded from the datastore (when we have a backing store). This can be utilised to perform any eager loading of information from the datastore.- Specified by:
initialisein interfaceSCO<BitSet>
-
initialise
public void initialise(BitSet newValue, Object oldValue)
Description copied from interface:SCOMethod to initialise the SCO for use, where replacing an old value with a new value such as when calling a setter field passing in a new value. Note that oldValue is marked as Object since for cases where the member type is Collection the newValue could be, for example, ArrayList, and the oldValue of type Collection (representing null).- Specified by:
initialisein interfaceSCO<BitSet>- Parameters:
newValue- New value (to wrap)oldValue- Old value (to use in deciding what needs deleting etc)
-
initialise
public void initialise(BitSet set)
Description copied from interface:SCOMethod to initialise the SCO for use with the provided initial value. This is used, for example, when retrieving the field from the datastore and setting it in the persistable object.- Specified by:
initialisein interfaceSCO<BitSet>- Parameters:
set- the object from which to copy the value.
-
getValue
public BitSet getValue()
Accessor for the unwrapped value that we are wrapping.
-
unsetOwner
public void unsetOwner()
Utility to unset the owner.- Specified by:
unsetOwnerin interfaceSCO<BitSet>
-
getOwner
public Object getOwner()
Accessor for the owner.
-
getFieldName
public String getFieldName()
Accessor for the field name- Specified by:
getFieldNamein interfaceSCO<BitSet>- Returns:
- The field name
-
makeDirty
public void makeDirty()
Utility to mark the object as dirty
-
detachCopy
public BitSet detachCopy(FetchPlanState state)
Method to detach a copy.- Specified by:
detachCopyin interfaceSCO<BitSet>- Parameters:
state- State for detachment process- Returns:
- A copy of the object
-
attachCopy
public void attachCopy(BitSet value)
Method to attached the passed value.- Specified by:
attachCopyin interfaceSCO<BitSet>- 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 persistable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.
-
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- if an error occurs
-
-