public class LineEvent extends EventObject
LineEventclass encapsulates information that a line sends its listeners whenever the line opens, closes, starts, or stops. Each of these four state changes is represented by a corresponding type of event. A listener receives the event as a parameter to its
updatemethod. By querying the event, the listener can learn the type of event, the line responsible for the event, and how much data the line had processed when the event occurred.
Although this class implements Serializable, attempts to
LineEvent object will fail.
|Modifier and Type||Class and Description|
The LineEvent.Type inner class identifies what kind of event occurred on a line.
|Constructor and Description|
Constructs a new event of the specified type, originating from the specified line.
|Modifier and Type||Method and Description|
Obtains the position in the line's audio data when the event occurred, expressed in sample frames.
Obtains the audio line that is the source of this event.
Obtains the event's type.
Obtains a string representation of the event.
public LineEvent(Line line, LineEvent.Type type, long position)
public final Line getLine()
public final LineEvent.Type getType()
public final long getFramePosition()
Note that this field is relevant only to certain events generated by
data lines, such as
events generated by lines that do not count sample frames, and for any
other events for which this value is not known, the position value
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.