public class NObject extends NAbstractDisposable
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
NObject.FromHandle |
protected static interface |
NObject.NObjectCallback |
protected static interface |
NObject.NObjectPropertyChangedCallback |
| Modifier and Type | Field and Description |
|---|---|
protected static NObject.NObjectCallback |
changedCallback |
protected static NObject.NObjectCallback |
changingCallback |
static int |
FLAG_REF_RET
Parameter used when object should be returned with incremented reference count.
|
protected static NObject.NObjectPropertyChangedCallback |
propertyChangedCallback |
protected static NObject.NObjectCallback |
stateChangedCallback |
| Modifier | Constructor and Description |
|---|---|
protected |
NObject(HNObject handle,
boolean claimHandle) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(String name,
EventListener listener) |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a "Property changed" event listener to the current object.
|
void |
captureProperties(NPropertyBag properties) |
protected void |
claimHandle() |
Object |
clone()
Creates a copy of specified object.
|
int |
compareTo(Object obj)
Compares the objects.
|
static void |
copyProperties(NObject srcObj,
NObject dstObj)
Copies properties values from one NObject object to another.
|
protected void |
dispose(boolean disposing)
Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
|
static <E extends NObject> |
disposeArray(E[] objects)
Disposes an object array.
|
boolean |
equals(Object obj)
Compares the objects.
|
static <T extends NObject> |
fromHandle(HNObject handle,
boolean ownsHandle,
boolean cache,
Class<T> cls)
Creates a new object of a specified class from a specified handle.
|
static <T extends NObject> |
fromHandle(HNObject handle,
Class<T> cls)
Creates a new object of a specified class from a specified handle.
|
static NObject |
fromObject(Object obj)
Creates a new NObject from the specified object.
|
int |
getFlags()
Gets flags of the object.
|
HNObject |
getHandle()
Gets handle to unmanaged NObject.
|
NType |
getNativeType()
Retrieves native type of object.
|
NObject |
getOwner()
Gets owner of the object.
|
Object |
getProperty(String name)
Gets value of parameter by property name.
|
<E> E |
getProperty(String name,
Class<E> cls)
Gets value of parameter by property name.
|
int |
getSize()
Retrieves the size of current object.
|
int |
getSize(int flags)
Retrieves the size of current object.
|
static <E extends NObject> |
getSizeMany(E[] objects)
Retrieves the size of the array of objects.
|
static <E extends NObject> |
getSizeMany(E[] objects,
int flags)
Retrieves the size of the array of objects.
|
int |
hashCode()
Gets hash code (numeric value) representing the object.
|
Object |
invoke(String name,
NPropertyBag parameters) |
Object |
invoke(String name,
Object[] parameters) |
Object |
invoke(String name,
String parameters) |
boolean |
isDisposed()
Checks the current object is disposed.
|
static NType |
nativeTypeOf()
Retrieves the native type for the enclosing class.
|
static NType |
nObjectCallbackNativeTypeOf() |
static NType |
nObjectPropertyChangedCallbackNativeTypeOf() |
static void |
ref(HNObject hObject)
Increments the reference count for an interface on a specified object.
|
void |
removeListener(String name,
EventListener listener) |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a "Property changed" event listener from the current object.
|
void |
reset()
Resets all NObject parameters to default values.
|
void |
resetProperty(String name)
Resets the value of the property specified by name.
|
NBuffer |
save()
Saves the current object in memory buffer.
|
int |
save(ByteBuffer buffer)
Saves an objects to a memory location with specified size.
|
int |
save(ByteBuffer buffer,
int flags)
Saves an objects to a memory location with specified size.
|
NBuffer |
save(int flags)
Saves the current object in memory buffer.
|
int |
save(NBuffer buffer)
Saves an objects to a memory location with specified size.
|
int |
save(NBuffer buffer,
int flags)
Saves an objects to a memory location with specified size.
|
void |
save(NStream stream) |
void |
save(NStream stream,
int flags) |
void |
save(OutputStream out)
Deprecated.
|
void |
save(OutputStream out,
int flags)
Deprecated.
|
void |
save(WritableByteChannel ch)
Deprecated.
|
void |
save(WritableByteChannel ch,
int flags)
Deprecated.
|
static <E extends NObject> |
saveMany(E[] objects)
Saves a NObject array in a memory buffer.
|
static <E extends NObject> |
saveMany(E[] objects,
ByteBuffer buffer)
Saves a NObject array in a specified memory buffer.
|
static <E extends NObject> |
saveMany(E[] objects,
ByteBuffer buffer,
int flags)
Saves a NObject array in a specified memory buffer.
|
static <E extends NObject> |
saveMany(E[] objects,
int flags)
Saves a NObject array in a memory buffer.
|
static <E extends NObject> |
saveMany(E[] objects,
NBuffer buffer)
Saves a NObject array in a specified memory buffer.
|
static <E extends NObject> |
saveMany(E[] objects,
NBuffer buffer,
int flags)
Saves a NObject array in a specified memory buffer.
|
static <E extends NObject> |
saveMany(E[] objects,
NStream stream) |
static <E extends NObject> |
saveMany(E[] objects,
NStream stream,
int flags) |
static <E extends NObject> |
saveMany(E[] objects,
OutputStream out)
Deprecated.
|
static <E extends NObject> |
saveMany(E[] objects,
OutputStream out,
int flags)
Deprecated.
|
static <E extends NObject> |
saveMany(E[] objects,
WritableByteChannel ch)
Deprecated.
|
static <E extends NObject> |
saveMany(E[] objects,
WritableByteChannel ch,
int flags)
Deprecated.
|
void |
setFlags(int value)
Sets the specified flags on the object.
|
<E> void |
setProperty(String name,
Class<E> cls,
E value)
Sets the value of the property specified by name.
|
void |
setProperty(String name,
Object value)
Sets value of property by property name.
|
static HNObject |
toHandle(NObject obj)
Returns a handle to the specified object.
|
static Object |
toObject(NObject obj)
Creates a new object from the specified NObject.
|
String |
toString()
Returns string representation of the object.
|
String |
toString(String format)
Retrieves a string representation of the current object.
|
static void |
unref(HNObject hObject)
Releases memory resources used by specified object.
|
static void |
unrefArray(com.sun.jna.Pointer arhObjects,
int objectCount)
Releases memory resources used by specified object array.
|
static void |
unrefElements(com.sun.jna.Pointer arhObjects,
int objectCount)
Releases memory resources used by specified element array.
|
check, dispose, finalizeprotected static final NObject.NObjectCallback stateChangedCallback
protected static final NObject.NObjectCallback changingCallback
protected static final NObject.NObjectCallback changedCallback
protected static final NObject.NObjectPropertyChangedCallback propertyChangedCallback
public static final int FLAG_REF_RET
protected NObject(HNObject handle, boolean claimHandle)
public static NType nObjectCallbackNativeTypeOf()
public static NType nObjectPropertyChangedCallbackNativeTypeOf()
public static NType nativeTypeOf()
public static <T extends NObject> T fromHandle(HNObject handle, Class<T> cls)
handle - Handle to the source object.cls - Class of the new object.public static <T extends NObject> T fromHandle(HNObject handle, boolean ownsHandle, boolean cache, Class<T> cls)
handle - Handle to the source object.ownsHandle - true if owns handle; else false.cache - true if created form cache; else false.cls - Class of the new object.public static <E extends NObject> void disposeArray(E[] objects)
objects - The array of objects to be disposed.public static void ref(HNObject hObject)
hObject - The specified object.public static void unref(HNObject hObject)
hObject - Pointer to previously allocated memory block to free.public static void unrefElements(com.sun.jna.Pointer arhObjects,
int objectCount)
arhObjects - Pointer to previously allocated element array to free.objectCount - Number of objects in the array.public static void unrefArray(com.sun.jna.Pointer arhObjects,
int objectCount)
arhObjects - Pointer to previously allocated object array to free.objectCount - Number of objects in the array.public static HNObject toHandle(NObject obj)
obj - The specified object.public static NObject fromObject(Object obj)
obj - The object.public static Object toObject(NObject obj)
obj - The NObject.public static void copyProperties(NObject srcObj, NObject dstObj)
srcObj - Source NObject object which should be copied.dstObj - Destination NObject object where source object will be copied.@Deprecated public static <E extends NObject> void saveMany(E[] objects, OutputStream out) throws IOException
objects - The object array to be saved.out - The target stream.IOException@Deprecated public static <E extends NObject> void saveMany(E[] objects, OutputStream out, int flags) throws IOException
objects - The object array to be saved.out - The target stream.flags - Must be zero.IOException@Deprecated public static <E extends NObject> void saveMany(E[] objects, WritableByteChannel ch) throws IOException
objects - The object array to be saved.ch - The target channel.IOException@Deprecated public static <E extends NObject> void saveMany(E[] objects, WritableByteChannel ch, int flags) throws IOException
objects - The object array to be saved.ch - The target channel.flags - Must be zero.IOExceptionpublic static <E extends NObject> void saveMany(E[] objects, NStream stream) throws IOException
IOExceptionpublic static <E extends NObject> void saveMany(E[] objects, NStream stream, int flags) throws IOException
IOExceptionpublic static <E extends NObject> NBuffer saveMany(E[] objects)
objects - The object array to be saved.public static <E extends NObject> NBuffer saveMany(E[] objects, int flags)
objects - The object array to be saved.flags - Must be zero.public static <E extends NObject> int getSizeMany(E[] objects)
objects - The array of objects.public static <E extends NObject> int getSizeMany(E[] objects, int flags)
objects - The array of objects.flags - Must be zero.public static <E extends NObject> int saveMany(E[] objects, ByteBuffer buffer)
objects - The object array to be saved.buffer - The target buffer.public static <E extends NObject> int saveMany(E[] objects, ByteBuffer buffer, int flags)
objects - The object array to be saved.buffer - The target buffer.flags - Must be zero.public static <E extends NObject> int saveMany(E[] objects, NBuffer buffer)
objects - The object array to be saved.buffer - The target NBuffer.public static <E extends NObject> int saveMany(E[] objects, NBuffer buffer, int flags)
objects - The object array to be saved.buffer - The target NBuffer.flags - Must be zero.protected void claimHandle()
protected void dispose(boolean disposing)
NAbstractDisposabledispose in class NAbstractDisposablepublic final NType getNativeType()
public final Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic final void reset()
public Object getProperty(String name)
name - Name of the property.public <E> E getProperty(String name, Class<E> cls)
name - Name of the property.cls - The class of the object.public void setProperty(String name, Object value)
name - Specifies the name of the propertyvalue - The property value.public <E> void setProperty(String name, Class<E> cls, E value)
name - Name of the property.cls - Class of the object.value - Property value.public void resetProperty(String name)
name - Name of the property to be reset.public final NBuffer save()
public final NBuffer save(int flags)
flags - Must be zero.@Deprecated public final void save(OutputStream out) throws IOException
out - The target stream.IOException@Deprecated public final void save(OutputStream out, int flags) throws IOException
out - The target stream.flags - Must be zero.IOException@Deprecated public final void save(WritableByteChannel ch) throws IOException
ch - The target channel.IOException@Deprecated public final void save(WritableByteChannel ch, int flags) throws IOException
ch - The target channel.flags - Must be zero.IOExceptionpublic final void save(NStream stream) throws IOException
IOExceptionpublic final void save(NStream stream, int flags) throws IOException
IOExceptionpublic final int getSize()
public final int getSize(int flags)
flags - Must be zero.public final int save(ByteBuffer buffer)
buffer - The target buffer.public final int save(ByteBuffer buffer, int flags)
buffer - The target buffer.flags - Must be zero.public final int save(NBuffer buffer)
buffer - The target NBuffer.public final int save(NBuffer buffer, int flags)
buffer - The target NBuffer.flags - Must be zero.public void captureProperties(NPropertyBag properties)
public Object invoke(String name, NPropertyBag parameters)
public void addListener(String name, EventListener listener)
public void removeListener(String name, EventListener listener)
public final boolean isDisposed()
isDisposed in class NAbstractDisposablepublic final HNObject getHandle()
public NObject getOwner()
public int getFlags()
public void setFlags(int value)
value - Flags to be set.public int hashCode()
public boolean equals(Object obj)
public final int compareTo(Object obj)
obj - Other object to be compared with.public final String toString()
public final String toString(String format)
format - Format string.public void addPropertyChangeListener(PropertyChangeListener listener)
listener - The event listener to be added.public void removePropertyChangeListener(PropertyChangeListener listener)
listener - The event listener to be removed.Copyright © 2016 Neurotechnology. All rights reserved.