Top Description Fields Constructors Methods
org.java_websocket.framing

public abstract Class FramedataImpl1

extends Object
implements Framedata
Class Inheritance
All Implemented Interfaces
org.java_websocket.framing.Framedata
Known Direct Subclasses
org.java_websocket.framing.ControlFrame, org.java_websocket.framing.DataFrame
Imports
java.nio.ByteBuffer, org.java_websocket.enums.Opcode, org.java_websocket.exceptions.InvalidDataException, org.java_websocket.util.ByteBufferUtils

Abstract implementation of a frame

Field Summary

Modifier and TypeField and Description
private boolean
fin

Indicates that this is the final fragment in a message.

private Opcode
optcode

Defines the interpretation of the "Payload data".

private boolean
rsv1

Indicates that the rsv1 bit is set or not

private boolean
rsv2

Indicates that the rsv2 bit is set or not

private boolean
rsv3

Indicates that the rsv3 bit is set or not

private boolean
transferemasked

Defines whether the "Payload data" is masked.

private ByteBuffer
unmaskedpayload

The unmasked "Payload data" which was sent in this frame

Constructor Summary

AccessConstructor and Description
public
FramedataImpl1(Opcode
the opcode to use
op
)

Constructor for a FramedataImpl without any attributes set apart from the opcode

Method Summary

Modifier and TypeMethod and Description
public void
append(Framedata nextframe)

Implements org.java_websocket.framing.Framedata.append.

Appends an additional frame to the current frame

This methods does not override the opcode, but does override the fin

public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public static FramedataImpl1

Returns:

the frame with a specific opcode
get
(Opcode
the opcode representing the frame
opcode
)

Get a frame with a specific opcode

public Opcode
getOpcode()

Implements org.java_websocket.framing.Framedata.getOpcode.

Defines the interpretation of the "Payload data".

public ByteBuffer
getPayloadData()

Implements org.java_websocket.framing.Framedata.getPayloadData.

The "Payload data" which was sent in this frame

public boolean
getTransfereMasked()

Implements org.java_websocket.framing.Framedata.getTransfereMasked.

Defines whether the "Payload data" is masked.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isFin()

Implements org.java_websocket.framing.Framedata.isFin.

Indicates that this is the final fragment in a message.

public boolean
isRSV1()

Implements org.java_websocket.framing.Framedata.isRSV1.

Indicates that this frame has the rsv1 bit set.

public boolean
isRSV2()

Implements org.java_websocket.framing.Framedata.isRSV2.

Indicates that this frame has the rsv2 bit set.

public boolean
isRSV3()

Implements org.java_websocket.framing.Framedata.isRSV3.

Indicates that this frame has the rsv3 bit set.

public abstract void
isValid()

Check if the frame is valid due to specification

public void
setFin(boolean
true if fin has to be set
fin
)

Set the fin of this frame to the provided boolean

public void
setPayload(ByteBuffer
the payload which is to set
payload
)

Set the payload of this frame to the provided payload

public void
setRSV1(boolean
true if rsv1 has to be set
rsv1
)

Set the rsv1 of this frame to the provided boolean

public void
setRSV2(boolean
true if rsv2 has to be set
rsv2
)

Set the rsv2 of this frame to the provided boolean

public void
setRSV3(boolean
true if rsv3 has to be set
rsv3
)

Set the rsv3 of this frame to the provided boolean

public void
setTransferemasked(boolean
true if transferemasked has to be set
transferemasked
)

Set the tranferemask of this frame to the provided boolean

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

finback to summary
private boolean fin

Indicates that this is the final fragment in a message.

optcodeback to summary
private Opcode optcode

Defines the interpretation of the "Payload data".

rsv1back to summary
private boolean rsv1

Indicates that the rsv1 bit is set or not

rsv2back to summary
private boolean rsv2

Indicates that the rsv2 bit is set or not

rsv3back to summary
private boolean rsv3

Indicates that the rsv3 bit is set or not

transferemaskedback to summary
private boolean transferemasked

Defines whether the "Payload data" is masked.

unmaskedpayloadback to summary
private ByteBuffer unmaskedpayload

The unmasked "Payload data" which was sent in this frame

Constructor Detail

FramedataImpl1back to summary
public FramedataImpl1(Opcode op)

Constructor for a FramedataImpl without any attributes set apart from the opcode

Parameters
op:Opcode

the opcode to use

Method Detail

appendback to summary
public void append(Framedata nextframe)

Implements org.java_websocket.framing.Framedata.append.

Doc from org.java_websocket.framing.Framedata.append.

Appends an additional frame to the current frame

This methods does not override the opcode, but does override the fin

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getback to summary
public static FramedataImpl1 get(Opcode opcode)

Get a frame with a specific opcode

Parameters
opcode:Opcode

the opcode representing the frame

Returns:FramedataImpl1

the frame with a specific opcode

getOpcodeback to summary
public Opcode getOpcode()

Implements org.java_websocket.framing.Framedata.getOpcode.

Doc from org.java_websocket.framing.Framedata.getOpcode.

Defines the interpretation of the "Payload data".

Annotations
@Override
getPayloadDataback to summary
public ByteBuffer getPayloadData()

Implements org.java_websocket.framing.Framedata.getPayloadData.

Doc from org.java_websocket.framing.Framedata.getPayloadData.

The "Payload data" which was sent in this frame

Annotations
@Override
getTransfereMaskedback to summary
public boolean getTransfereMasked()

Implements org.java_websocket.framing.Framedata.getTransfereMasked.

Doc from org.java_websocket.framing.Framedata.getTransfereMasked.

Defines whether the "Payload data" is masked.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
isFinback to summary
public boolean isFin()

Implements org.java_websocket.framing.Framedata.isFin.

Doc from org.java_websocket.framing.Framedata.isFin.

Indicates that this is the final fragment in a message. The first fragment MAY also be the final fragment.

Annotations
@Override
isRSV1back to summary
public boolean isRSV1()

Implements org.java_websocket.framing.Framedata.isRSV1.

Doc from org.java_websocket.framing.Framedata.isRSV1.

Indicates that this frame has the rsv1 bit set.

Annotations
@Override
isRSV2back to summary
public boolean isRSV2()

Implements org.java_websocket.framing.Framedata.isRSV2.

Doc from org.java_websocket.framing.Framedata.isRSV2.

Indicates that this frame has the rsv2 bit set.

Annotations
@Override
isRSV3back to summary
public boolean isRSV3()

Implements org.java_websocket.framing.Framedata.isRSV3.

Doc from org.java_websocket.framing.Framedata.isRSV3.

Indicates that this frame has the rsv3 bit set.

Annotations
@Override
isValidback to summary
public abstract void isValid() throws InvalidDataException

Check if the frame is valid due to specification

Exceptions
InvalidDataException:
thrown if the frame is not a valid frame
setFinback to summary
public void setFin(boolean fin)

Set the fin of this frame to the provided boolean

Parameters
fin:boolean

true if fin has to be set

setPayloadback to summary
public void setPayload(ByteBuffer payload)

Set the payload of this frame to the provided payload

Parameters
payload:ByteBuffer

the payload which is to set

setRSV1back to summary
public void setRSV1(boolean rsv1)

Set the rsv1 of this frame to the provided boolean

Parameters
rsv1:boolean

true if rsv1 has to be set

setRSV2back to summary
public void setRSV2(boolean rsv2)

Set the rsv2 of this frame to the provided boolean

Parameters
rsv2:boolean

true if rsv2 has to be set

setRSV3back to summary
public void setRSV3(boolean rsv3)

Set the rsv3 of this frame to the provided boolean

Parameters
rsv3:boolean

true if rsv3 has to be set

setTransferemaskedback to summary
public void setTransferemasked(boolean transferemasked)

Set the tranferemask of this frame to the provided boolean

Parameters
transferemasked:boolean

true if transferemasked has to be set

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override