net.sf.opensmus
Class LValue

java.lang.Object
  extended by net.sf.opensmus.LValue
Direct Known Subclasses:
L3dTransform, L3dVector, LColor, LDate, LFloat, LInteger, LList, LMedia, LPoint, LPropList, LRect, LString, LVoid

public class LValue
extends java.lang.Object

Base class representing a Lingo compatible value (LValue for short). Lingo is a trademark of Adobe, Inc. All rights reserved.


Field Summary
protected  short valueType
           
static short vt_3dTransform
           
static short vt_3dVector
           
static short vt_Color
           
static short vt_Date
           
static short vt_Float
           
static short vt_Integer
           
static short vt_List
           
static short vt_Media
           
static short vt_Picture
           
static short vt_Point
           
static short vt_PropList
           
static short vt_Rect
           
static short vt_String
           
static short vt_Symbol
           
static short vt_Void
           
 
Constructor Summary
LValue()
          Constructor
 
Method Summary
 void dump()
          Reserved for internal use of OpenSMUS.
 int extractFromBytes(byte[] rawBytes, int offset)
          Reserved for internal use of OpenSMUS.
static LValue fromRawBytes(byte[] rawBytes, int offset)
          Static function to construct an LValue from a raw byte array containg a Lingo formatted value and associated type information.
 byte[] getBytes()
          Reserved for internal use of OpenSMUS.
static LValue getLValue(byte[] initval)
          Static function to construct an LValue from an array of bytes.
static LValue getLValue(double initval)
          Static function to construct an LValue from a Java double.
static LValue getLValue(float initval)
          Static function to construct an LValue from a Java float.
static LValue getLValue(int initval)
          Static function to construct an LValue from a Java int.
static LValue getLValue(java.lang.String initval)
          Static function to construct an LValue from a Java String.
 short getType()
          Returns the type of an LValue (LValue.vtVoid, LValue.vtString, etc.)
 void setType(short type)
          Sets the type of a newly created LValue.
 byte[] toBytes()
          Base method, returns this LValue as bytes.
 double toDouble()
          Base method, returns this LValue as a double.
 int toInteger()
          Base method, returns this LValue as an integer.
 java.lang.String toString()
          Base method, returns this LValue as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vt_Void

public static final short vt_Void
See Also:
Constant Field Values

vt_Integer

public static final short vt_Integer
See Also:
Constant Field Values

vt_Symbol

public static final short vt_Symbol
See Also:
Constant Field Values

vt_String

public static final short vt_String
See Also:
Constant Field Values

vt_Picture

public static final short vt_Picture
See Also:
Constant Field Values

vt_Float

public static final short vt_Float
See Also:
Constant Field Values

vt_List

public static final short vt_List
See Also:
Constant Field Values

vt_Point

public static final short vt_Point
See Also:
Constant Field Values

vt_Rect

public static final short vt_Rect
See Also:
Constant Field Values

vt_PropList

public static final short vt_PropList
See Also:
Constant Field Values

vt_Color

public static final short vt_Color
See Also:
Constant Field Values

vt_Date

public static final short vt_Date
See Also:
Constant Field Values

vt_Media

public static final short vt_Media
See Also:
Constant Field Values

vt_3dVector

public static final short vt_3dVector
See Also:
Constant Field Values

vt_3dTransform

public static final short vt_3dTransform
See Also:
Constant Field Values

valueType

protected short valueType
Constructor Detail

LValue

public LValue()
Constructor

Method Detail

getLValue

public static LValue getLValue(int initval)
Static function to construct an LValue from a Java int. Returns an LInteger value


getLValue

public static LValue getLValue(java.lang.String initval)
Static function to construct an LValue from a Java String. Returns an LString value


getLValue

public static LValue getLValue(double initval)
Static function to construct an LValue from a Java double. Returns an LFloat value


getLValue

public static LValue getLValue(float initval)
Static function to construct an LValue from a Java float. Returns an LFloat value


getLValue

public static LValue getLValue(byte[] initval)
Static function to construct an LValue from an array of bytes. Returns an LMedia value


setType

public void setType(short type)
Sets the type of a newly created LValue. Type is a short LValue type (LValue.vtVoid, LValue.vtString, etc.)


getType

public short getType()
Returns the type of an LValue (LValue.vtVoid, LValue.vtString, etc.)


extractFromBytes

public int extractFromBytes(byte[] rawBytes,
                            int offset)
Reserved for internal use of OpenSMUS.


getBytes

public byte[] getBytes()
Reserved for internal use of OpenSMUS.


dump

public void dump()
Reserved for internal use of OpenSMUS.


toString

public java.lang.String toString()
Base method, returns this LValue as a String. Not guaranteed to be implemented for all value types.

Overrides:
toString in class java.lang.Object

toInteger

public int toInteger()
Base method, returns this LValue as an integer. Not guaranteed to be implemented for all value types.


toDouble

public double toDouble()
Base method, returns this LValue as a double. Not guaranteed to be implemented for all value types.


toBytes

public byte[] toBytes()
Base method, returns this LValue as bytes. Not guaranteed to be implemented for all value types.


fromRawBytes

public static LValue fromRawBytes(byte[] rawBytes,
                                  int offset)
Static function to construct an LValue from a raw byte array containg a Lingo formatted value and associated type information. Reserved for internal use of OpenSMUS.