Class EventInMFStringWrapper
java.lang.Object
vrml.eai.field.BaseField
vrml.eai.field.EventIn
vrml.eai.field.EventInMFString
org.web3d.vrml.scripting.external.neteai.EventInMFStringWrapper
- All Implemented Interfaces:
ExternalEvent
Client side implementation of EventInMFString field.
EventIn objects double as buffers for data inbound to the event system.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionEventInMFStringWrapper
(int fieldID, FieldAndNodeRequestProcessor requestProcessor, NetworkEventQueue eventQueue) EventInMFStringWrapper
(int fieldID, FieldAndNodeRequestProcessor requestProcessor, NetworkEventQueue eventQueue, String[] suppliedValue) -
Method Summary
Modifier and TypeMethodDescriptionvoid
doEvent()
The EventIn*Wrapper classes implement doEvent by posting their stored values to the underlying implementation.boolean
Two eventIn's are equal if they point to the same actual node and fieldint
The underlying field IDint
getType()
The type of the underlying field.Get the user data that is associated with this eventInint
hashCode()
In order to make the event queueing system easier, and since an equals method is required by the specification, compute the hashcode based on the field number and underlying node hashcode.boolean
Is the event conglomerating or non-conglomerating.void
loadFieldValue
(DataInputStream input) void
Set a particular string value in the given eventIn array.void
setUserData
(Object data) Associate user data with this event.void
Set the value of the array of strings.void
writeFieldValue
(DataOutputStream output)
-
Constructor Details
-
EventInMFStringWrapper
public EventInMFStringWrapper(int fieldID, FieldAndNodeRequestProcessor requestProcessor, NetworkEventQueue eventQueue) - Parameters:
fieldID
- The network field IDrequestProcessor
- Handler for field serviceseventQueue
- The queue to send events to
-
EventInMFStringWrapper
public EventInMFStringWrapper(int fieldID, FieldAndNodeRequestProcessor requestProcessor, NetworkEventQueue eventQueue, String[] suppliedValue) - Parameters:
fieldID
- The network field IDrequestProcessor
- Handler for field serviceseventQueue
- The queue to send events tosuppliedValue
- The value supplied for this field
-
-
Method Details
-
doEvent
public void doEvent()The EventIn*Wrapper classes implement doEvent by posting their stored values to the underlying implementation.- Specified by:
doEvent
in interfaceExternalEvent
- See Also:
-
equals
-
getFieldID
public int getFieldID()The underlying field ID- See Also:
-
hashCode
-
isConglomerating
public boolean isConglomerating()Description copied from interface:ExternalEvent
Is the event conglomerating or non-conglomerating. Conglomerating events such as the set1Value calls build up in the event buffer.- Specified by:
isConglomerating
in interfaceExternalEvent
- Returns:
- whether event is conglomerating or not
- See Also:
-
setValue
Description copied from class:EventInMFString
Set the value of the array of strings. If value[i] contains a null reference this will not cause an exception to be generated. However, the resulting event that the eventIn receives will be implementation specific as this is not dealt with in the VRML specification.- Specified by:
setValue
in classEventInMFString
- Parameters:
value
- The array of strings.- See Also:
-
set1Value
Description copied from class:EventInMFString
Set a particular string value in the given eventIn array. To the VRML world this will generate a full MFString event with the nominated index value changed.If the index is out of the bounds of the current array of data values an ArrayIndexOutOfBoundsException will be generated. If the value reference is null then the result is implementation specific in terms of the array reference that reaches the eventIn. In any case, an event will reach the destination eventIn, but the values in that array are implementation specific. No exception will be generated in this case.
- Specified by:
set1Value
in classEventInMFString
- Parameters:
index
- The position to set the string valuevalue
- The string value- Throws:
ArrayIndexOutOfBoundsException
- The index value was out of bounds of the current array.- See Also:
-
setUserData
Description copied from class:EventIn
Associate user data with this event. Whenever an event is generated on this eventIn. this data will be available with the Event through its getData method.- Specified by:
setUserData
in classEventIn
- Parameters:
data
- The data to associate with this eventIn instance- See Also:
-
getUserData
Description copied from class:EventIn
Get the user data that is associated with this eventIn- Specified by:
getUserData
in classEventIn
- Returns:
- * @see vrml.eai.field.EventIn#getUserData()
-
loadFieldValue
- Throws:
IOException
- * @see org.web3d.vrml.scripting.external.neteai.EventWrapper#loadFieldValue(java.io.DataInputStream)
-
writeFieldValue
- Throws:
IOException
- * @see org.web3d.vrml.scripting.external.neteai.EventWrapper#writeFieldValue(java.io.DataOutputStream)
-
getType
int getType()The type of the underlying field. Method name chosen to coincide with vrml.eai.field.BaseField.- Returns:
- the type of the underlying field
-