com.langner.jmatic2
Class PLCValue

java.lang.Object
  extended bycom.langner.jmatic2.PLCValue
All Implemented Interfaces:
IPLCValue

public class PLCValue
extends java.lang.Object
implements IPLCValue

This class represents the value access of a PLCAlias object.

Version:
2.0
Author:
Langner Communications AG
Copyright:
Langner (c) 2001-2005

Method Summary
 java.lang.Object clone()
          Clones the PLCValue object.
 byte[] getBinary()
          Retrieve the data as raw binary values.
 java.lang.Boolean getBoolean()
          Retrieve the data as a boolean value.
 java.util.Date getDate()
          Retrieve the data as a Date value.
 java.lang.Float getFloat()
          Retrieve the data as a real value.
 java.lang.Long getLong()
          Retrieve the data as a long value.
 java.lang.String getString()
          Retrieve the data as a string.
 java.lang.Long getTime()
          Retrieve the data as a long value used as milliseconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBinary

public byte[] getBinary()
Retrieve the data as raw binary values. The PLCAlias object must be of type BINARY.

Specified by:
getBinary in interface IPLCValue
Returns:
The value or null if the type of the alias does not match.

getBoolean

public java.lang.Boolean getBoolean()
Retrieve the data as a boolean value. The PLCAlias object must be of type BOOLEAN.

Specified by:
getBoolean in interface IPLCValue
Returns:
The value or null if the type of the alias does not match.

getDate

public java.util.Date getDate()
Retrieve the data as a Date value. The PLCAlias object must be of type DATE, TOD or DT.

Specified by:
getDate in interface IPLCValue
Returns:
The value or null if the type of the alias does not match.

getFloat

public java.lang.Float getFloat()
Retrieve the data as a real value. The PLCAlias object must be of type REAL.

Specified by:
getFloat in interface IPLCValue
Returns:
The value or null if the type of the alias does not match.

getLong

public java.lang.Long getLong()
Retrieve the data as a long value. The PLCAlias object must be of type BYTE, INT, DINT, WORD or DWORD.

Specified by:
getLong in interface IPLCValue
Returns:
The value or null if the type of the alias does not match.

getString

public java.lang.String getString()
Retrieve the data as a string. The PLCAlias object can be of any data type.

Specified by:
getString in interface IPLCValue
Returns:
The String value of the alias or the string representation of the value.

getTime

public java.lang.Long getTime()
Retrieve the data as a long value used as milliseconds. The PLCAlias object must be of type S5TIME or TIME.

Specified by:
getTime in interface IPLCValue
Returns:
The value or null if the type of the alias does not match.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the PLCValue object.

Returns:
New PLCValue object.
Throws:
java.lang.CloneNotSupportedException - is thrown, if the data type was not clonable


Copyright © 2001-2005 Langner Communications AG. All Rights Reserved.