|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gstreamer.lowlevel.NativeValue
org.gstreamer.lowlevel.Handle
org.gstreamer.lowlevel.NativeObject
org.gstreamer.Structure
public class Structure
Generic structure containing fields of names and values.
A Structure is a collection of key/value pairs. The keys are expressed as GQuarks and the values can be of any GType.
In addition to the key/value pairs, a Structure also has a name. The name starts with a letter and can be followed by letters, numbers and any of "/-_.:".
Structure is used by various GStreamer subsystems to store information in a flexible and extensible way.
A Structure can be created with new Structure(String)
or
Structure(String, String, Object...)
, which both take a name and an
optional set of key/value pairs along with the types of the values.
Field values can be changed with #setValue
or #set
.
Field values can be retrieved with #getValue
or the more
specific get{Integer,String}() etc functions.
Fields can be removed with removeField(java.lang.String)
or removeFields(java.lang.String...)
Caps
,
Event
Nested Class Summary | |
---|---|
class |
Structure.InvalidFieldException
|
Nested classes/interfaces inherited from class org.gstreamer.lowlevel.NativeObject |
---|
org.gstreamer.lowlevel.NativeObject.Initializer |
Field Summary |
---|
Fields inherited from class org.gstreamer.lowlevel.NativeObject |
---|
defaultInit, LIFECYCLE, ownsHandle |
Constructor Summary | |
---|---|
Structure(org.gstreamer.lowlevel.NativeObject.Initializer init)
Creates a new instance of Structure |
|
Structure(java.lang.String name)
Creates a new, empty #GstStructure with the given name. |
|
Structure(java.lang.String name,
java.lang.String firstFieldName,
java.lang.Object... data)
Creates a new Structure with the given name. |
Method Summary | |
---|---|
Structure |
copy()
|
protected void |
disposeNativeHandle(com.sun.jna.Pointer ptr)
|
boolean |
fixateFieldNearestInteger(java.lang.String field,
java.lang.Integer target)
|
boolean |
fixateNearestInteger(java.lang.String field,
java.lang.Integer value)
|
static Structure |
fromString(java.lang.String data)
Creates a Structure from a string representation. |
boolean |
getBoolean(java.lang.String fieldName)
|
double |
getDouble(java.lang.String fieldName)
|
Fraction |
getFraction(java.lang.String fieldName)
|
int |
getInteger(java.lang.String fieldName)
|
java.lang.String |
getName()
Get the name of @structure as a string. |
java.lang.String |
getString(java.lang.String fieldName)
|
boolean |
hasDoubleField(java.lang.String fieldName)
Check if the Structure contains a double field named fieldName. |
boolean |
hasField(java.lang.String fieldName)
Check if the Structure contains a field named fieldName. |
boolean |
hasField(java.lang.String fieldName,
java.lang.Class<?> fieldType)
Check if the Structure contains a field named fieldName. |
boolean |
hasField(java.lang.String fieldName,
org.gstreamer.lowlevel.GType fieldType)
Check if the Structure contains a field named fieldName. |
boolean |
hasIntField(java.lang.String fieldName)
Check if the Structure contains an integer field named fieldName. |
boolean |
hasName(java.lang.String name)
Checks if the structure has the given name. |
static Structure |
objectFor(com.sun.jna.Pointer ptr,
boolean needRef,
boolean ownsHandle)
|
void |
removeField(java.lang.String fieldName)
Removes the field with the given name from the structure. |
void |
removeFields(java.lang.String... fieldNames)
Removes the fields with the given names. |
void |
setDouble(java.lang.String field,
java.lang.Double value)
|
void |
setDoubleRange(java.lang.String field,
java.lang.Double min,
java.lang.Double max)
|
void |
setInteger(java.lang.String field,
java.lang.Integer value)
Sets an integer field in the structure. |
void |
setIntegerRange(java.lang.String field,
java.lang.Integer min,
java.lang.Integer max)
|
void |
setName(java.lang.String name)
Sets the name of the structure to the given name. |
java.lang.String |
toString()
|
Methods inherited from class org.gstreamer.lowlevel.NativeObject |
---|
classFor, disown, dispose, equals, finalize, getNativeAddress, handle, hashCode, initializer, initializer, instanceFor, invalidate, isDisposed, nativeValue, objectFor, objectFor, objectFor |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Structure(org.gstreamer.lowlevel.NativeObject.Initializer init)
public Structure(java.lang.String name)
name
- The name of new structure.public Structure(java.lang.String name, java.lang.String firstFieldName, java.lang.Object... data)
name
- The name of new structure.firstFieldName
- The name of first field to setdata
- Additional arguments.Method Detail |
---|
public static Structure fromString(java.lang.String data)
data
- A string representation of a Structure.
public Structure copy()
public int getInteger(java.lang.String fieldName)
public double getDouble(java.lang.String fieldName)
public java.lang.String getString(java.lang.String fieldName)
public void setInteger(java.lang.String field, java.lang.Integer value)
field
- the name of the field to set.value
- the value to set for the field.public void setDouble(java.lang.String field, java.lang.Double value)
public void setIntegerRange(java.lang.String field, java.lang.Integer min, java.lang.Integer max)
public void setDoubleRange(java.lang.String field, java.lang.Double min, java.lang.Double max)
public boolean fixateNearestInteger(java.lang.String field, java.lang.Integer value)
public boolean getBoolean(java.lang.String fieldName)
fieldName
-
public Fraction getFraction(java.lang.String fieldName)
public boolean fixateFieldNearestInteger(java.lang.String field, java.lang.Integer target)
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The new name of the structure.public boolean hasName(java.lang.String name)
name
- structure name to check for
public boolean hasField(java.lang.String fieldName)
Structure
contains a field named fieldName.
fieldName
- The name of the field to check.
public boolean hasField(java.lang.String fieldName, org.gstreamer.lowlevel.GType fieldType)
Structure
contains a field named fieldName.
fieldName
- The name of the field to check.fieldType
- The type of the field.
public boolean hasField(java.lang.String fieldName, java.lang.Class<?> fieldType)
Structure
contains a field named fieldName.
fieldName
- The name of the field to check.fieldType
- The type of the field.
public boolean hasIntField(java.lang.String fieldName)
Structure
contains an integer field named fieldName.
fieldName
- The name of the field to check.
public boolean hasDoubleField(java.lang.String fieldName)
Structure
contains a double field named fieldName.
fieldName
- The name of the field to check.
public void removeField(java.lang.String fieldName)
fieldName
- The name of the field to remove.public void removeFields(java.lang.String... fieldNames)
fieldNames
- A list of field names to remove.public java.lang.String toString()
toString
in class org.gstreamer.lowlevel.NativeObject
public static Structure objectFor(com.sun.jna.Pointer ptr, boolean needRef, boolean ownsHandle)
protected void disposeNativeHandle(com.sun.jna.Pointer ptr)
disposeNativeHandle
in class org.gstreamer.lowlevel.NativeObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |