📄 upnpactionargument.java
字号:
package no.auc.one.portableplayer.communication.upnphosting;
/**
* Argument for an action of a UPnP Service.
*
* The name of the argument is the same as the object instance. E.g. for this
* code: UPnPActionArgument myArgument; the name of the argument becomes
* myArgument. Should be name of a state variable that models an effect the
* action causes. Should be < 32 characters.
*/
public final class UPnPActionArgument {
/**
* For input argument.
*/
public final static int ARGUMENT_DIRECTION_IN = 0;
/**
* For output argument.
*/
public final static int ARGUMENT_DIRECTION_OUT = 1;
private boolean isInDirection;
private boolean isReturnValue;
private String relatedStateVariable;
private Object value;
private String name;
/**
* New UPnPActionArgument. isReturnValue will be false.
*/
public UPnPActionArgument(String name, int direction, String relatedStateVariable) {
isInDirection = (direction == ARGUMENT_DIRECTION_IN) ? true : false;
this.relatedStateVariable = relatedStateVariable;
isReturnValue = false;
this.name = name;
}
/**
* New UPnPActionArgument. Can set isReturnValue to true/false.
*/
public UPnPActionArgument(
String name,
int direction,
String relatedStateVariable,
boolean isReturnValue)
{
this.name = name;
isInDirection = (direction == ARGUMENT_DIRECTION_IN) ? true : false;
this.relatedStateVariable = relatedStateVariable;
this.isReturnValue = isReturnValue;
}
/**
* Returns the current direction of this argument.
*/
public int getDirection() {
return (isInDirection) ? ARGUMENT_DIRECTION_IN : ARGUMENT_DIRECTION_OUT;
}
/**
* Change the direction of this argument.
*/
/*
public void setDirection(int newDirection) {
isInDirection = (newDirection == ARGUMENT_DIRECTION_IN) ? true : false;
}
*/
/**
* Is this argument to be considered a return value?
*/
public boolean isReturnValue() {
return isReturnValue;
}
/**
* Change if the argument is to be considered a return value or not.
*/
/*
public void setIsReturnValue(boolean newRetVal) {
isReturnValue = newRetVal;
}
*/
/**
* Returns the related state variable for this action argument.
*/
public String getRelatedStateVariable() {
return relatedStateVariable;
}
/**
* Changes the related state variable for this action argument.
*/
/*
public void setRelatedStateVariable(String newRelatedStateVariable) {
relatedStateVariable = newRelatedStateVariable;
}
*/
public Object getValue() {
return value;
}
public void setValue(Object newValue) {
value = newValue;
}
public String getName() {
return name;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -