public class IntComponent extends AbstractMessageComponent
Constructor and Description |
---|
IntComponent(java.lang.String name)
Construct an IntComponent with no content.
|
IntComponent(java.lang.String name,
int value)
Construct an IntComponent with a specific value.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue()
Get the value of this message component.
|
void |
read(java.io.InputStream in)
Read this component from a stream.
|
void |
setValue(int value)
Set the value of this message component.
|
java.lang.String |
toString() |
void |
write(java.io.OutputStream out)
Write this component to a stream.
|
getName
public IntComponent(java.lang.String name)
name
- The name of the component.public IntComponent(java.lang.String name, int value)
name
- The name of the component.value
- The value of this component.public int getValue()
public void setValue(int value)
value
- The value of the component.public void write(java.io.OutputStream out) throws java.io.IOException
MessageComponent
out
- The stream to write to.java.io.IOException
- If the write fails.public void read(java.io.InputStream in) throws java.io.IOException
MessageComponent
in
- The stream to read from.java.io.IOException
- If the read fails.public java.lang.String toString()
toString
in class java.lang.Object