Java Doc for Variant.java in  » Ajax » GWT » org » eclipse » swt » ole » win32 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » GWT » org.eclipse.swt.ole.win32 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.swt.ole.win32.Variant

Variant
final public class Variant (Code)
A Variant is a generic OLE mechanism for passing data of different types via a common interface.

It is used within the OleAutomation object for getting a property, setting a property or invoking a method on an OLE Control or OLE Document.



Field Summary
final public static  intsizeof
     A variant always takes up 16 bytes, no matter what you store in it.

Constructor Summary
public  Variant()
     Create an empty Variant object with type VT_EMPTY.
public  Variant(float val)
     Create a Variant object which represents a Java float as a VT_R4.
public  Variant(double val)
     Create a Variant object which represents a Java double as a VT_R8.
public  Variant(int val)
     Create a Variant object which represents a Java int as a VT_I4.
public  Variant(int ptr, short byRefType)
     Create a Variant object which contains a reference to the data being transferred.
public  Variant(OleAutomation automation)
     Create a Variant object which represents an IDispatch interface as a VT_Dispatch.
public  Variant(IDispatch idispatch)
     Create a Variant object which represents an IDispatch interface as a VT_Dispatch.
public  Variant(IUnknown unknown)
     Create a Variant object which represents an IUnknown interface as a VT_UNKNOWN.
public  Variant(long val)
     Create a Variant object which represents a Java long as a VT_I8.
public  Variant(String string)
     Create a Variant object which represents a Java String as a VT_BSTR.
public  Variant(short val)
     Create a Variant object which represents a Java short as a VT_I2.
public  Variant(boolean val)
     Create a Variant object which represents a Java boolean as a VT_BOOL.

Method Summary
public  voiddispose()
     Calling dispose will release resources associated with this Variant.
public  OleAutomationgetAutomation()
     Returns the OleAutomation object represented by this Variant.

If this Variant does not contain an OleAutomation object, an attempt is made to coerce the Variant type into an OleAutomation object.

public  booleangetBoolean()
     Returns the Java boolean represented by this Variant.

If this Variant does not contain a Java boolean, an attempt is made to coerce the Variant type into a Java boolean.

public  intgetByRef()
     Returns a pointer to the referenced data represented by this Variant.
public  bytegetByte()
     Returns the Java byte represented by this Variant.

If this Variant does not contain a Java byte, an attempt is made to coerce the Variant type into a Java byte.

public  chargetChar()
     Returns the Java char represented by this Variant.

If this Variant does not contain a Java char, an attempt is made to coerce the Variant type into a Java char.

 voidgetData(int pData)
    
public  IDispatchgetDispatch()
     Returns the IDispatch object represented by this Variant.

If this Variant does not contain an IDispatch object, an attempt is made to coerce the Variant type into an IDIspatch object.

public  doublegetDouble()
     Returns the Java double represented by this Variant.

If this Variant does not contain a Java double, an attempt is made to coerce the Variant type into a Java double.

public  floatgetFloat()
     Returns the Java float represented by this Variant.

If this Variant does not contain a Java float, an attempt is made to coerce the Variant type into a Java float.

public  intgetInt()
     Returns the Java int represented by this Variant.

If this Variant does not contain a Java int, an attempt is made to coerce the Variant type into a Java int.

public  longgetLong()
     Returns the Java long represented by this Variant.

If this Variant does not contain a Java long, an attempt is made to coerce the Variant type into a Java long.

public  shortgetShort()
     Returns the Java short represented by this Variant.

If this Variant does not contain a Java short, an attempt is made to coerce the Variant type into a Java short.

public  StringgetString()
     Returns the Java String represented by this Variant.

If this Variant does not contain a Java String, an attempt is made to coerce the Variant type into a Java String.

public  shortgetType()
     Returns the type of the variant type.
public  IUnknowngetUnknown()
     Returns the IUnknown object represented by this Variant.

If this Variant does not contain an IUnknown object, an attempt is made to coerce the Variant type into an IUnknown object.

public  voidsetByRef(boolean val)
     Update the by reference value of this variant with a new boolean value.
public  voidsetByRef(float val)
     Update the by reference value of this variant with a new float value.
public  voidsetByRef(int val)
     Update the by reference value of this variant with a new integer value.
public  voidsetByRef(short val)
     Update the by reference value of this variant with a new short value.
 voidsetData(int pData)
    
public  StringtoString()
     Returns a string containing a concise, human-readable description of the receiver.
public static  voidwin32_copy(int pVarDest, Variant varSrc)
     Invokes platform specific functionality to copy a variant into operating system memory.

IMPORTANT: This method is not part of the public API for Variant.

public static  Variantwin32_new(int pVariant)
     Invokes platform specific functionality to wrap a variant.

IMPORTANT: This method is not part of the public API for GC.


Field Detail
sizeof
final public static int sizeof(Code)
A variant always takes up 16 bytes, no matter what you store in it. Objects, strings, and arrays are not physically stored in the Variant; in these cases, four bytes of the Variant are used to hold either an object reference, or a pointer to the string or array. The actual data are stored elsewhere.




Constructor Detail
Variant
public Variant()(Code)
Create an empty Variant object with type VT_EMPTY.
since:
   2.0



Variant
public Variant(float val)(Code)
Create a Variant object which represents a Java float as a VT_R4.
Parameters:
  val - the Java float value that this Variant represents



Variant
public Variant(double val)(Code)
Create a Variant object which represents a Java double as a VT_R8.
Parameters:
  val - the Java double value that this Variant represents
since:
   3.2



Variant
public Variant(int val)(Code)
Create a Variant object which represents a Java int as a VT_I4.
Parameters:
  val - the Java int value that this Variant represents



Variant
public Variant(int ptr, short byRefType)(Code)
Create a Variant object which contains a reference to the data being transferred.

When creating a VT_BYREF Variant, you must give the full Variant type including VT_BYREF such as

short byRefType = OLE.VT_BSTR | OLE.VT_BYREF
.
Parameters:
  ptr - a pointer to the data being transferred.
Parameters:
  byRefType - the type of the data being transferred such as OLE.VT_BSTR | OLE.VT_BYREF



Variant
public Variant(OleAutomation automation)(Code)
Create a Variant object which represents an IDispatch interface as a VT_Dispatch.
Parameters:
  automation - the OleAutomation object that this Variant represents



Variant
public Variant(IDispatch idispatch)(Code)
Create a Variant object which represents an IDispatch interface as a VT_Dispatch.

The caller is expected to have appropriately invoked unknown.AddRef() before creating this Variant.
since:
   2.0
Parameters:
  idispatch - the IDispatch object that this Variant represents




Variant
public Variant(IUnknown unknown)(Code)
Create a Variant object which represents an IUnknown interface as a VT_UNKNOWN.

The caller is expected to have appropriately invoked unknown.AddRef() before creating this Variant.
Parameters:
  unknown - the IUnknown object that this Variant represents




Variant
public Variant(long val)(Code)
Create a Variant object which represents a Java long as a VT_I8.
Parameters:
  val - the Java long value that this Variant represents
since:
   3.2



Variant
public Variant(String string)(Code)
Create a Variant object which represents a Java String as a VT_BSTR.
Parameters:
  string - the Java String value that this Variant represents



Variant
public Variant(short val)(Code)
Create a Variant object which represents a Java short as a VT_I2.
Parameters:
  val - the Java short value that this Variant represents



Variant
public Variant(boolean val)(Code)
Create a Variant object which represents a Java boolean as a VT_BOOL.
Parameters:
  val - the Java boolean value that this Variant represents




Method Detail
dispose
public void dispose()(Code)
Calling dispose will release resources associated with this Variant. If the resource is an IDispatch or IUnknown interface, Release will be called. If the resource is a ByRef pointer, nothing is released.
since:
   2.1



getAutomation
public OleAutomation getAutomation()(Code)
Returns the OleAutomation object represented by this Variant.

If this Variant does not contain an OleAutomation object, an attempt is made to coerce the Variant type into an OleAutomation object. If this fails, an error is thrown. Note that OleAutomation objects must be disposed when no longer needed. the OleAutomation object represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into an OleAutomation object



getBoolean
public boolean getBoolean()(Code)
Returns the Java boolean represented by this Variant.

If this Variant does not contain a Java boolean, an attempt is made to coerce the Variant type into a Java boolean. If this fails, an error is thrown. the Java boolean represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into a boolean



getByRef
public int getByRef()(Code)
Returns a pointer to the referenced data represented by this Variant.

If this Variant does not contain a reference to data, zero is returned. a pointer to the referenced data represented by this Variant or 0




getByte
public byte getByte()(Code)
Returns the Java byte represented by this Variant.

If this Variant does not contain a Java byte, an attempt is made to coerce the Variant type into a Java byte. If this fails, an error is thrown. the Java byte represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into a byte

since:
   3.3



getChar
public char getChar()(Code)
Returns the Java char represented by this Variant.

If this Variant does not contain a Java char, an attempt is made to coerce the Variant type into a Java char. If this fails, an error is thrown. the Java char represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into a char

since:
   3.3



getData
void getData(int pData)(Code)



getDispatch
public IDispatch getDispatch()(Code)
Returns the IDispatch object represented by this Variant.

If this Variant does not contain an IDispatch object, an attempt is made to coerce the Variant type into an IDIspatch object. If this fails, an error is thrown.
since:
   2.0 the IDispatch object represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into an IDispatch object



getDouble
public double getDouble()(Code)
Returns the Java double represented by this Variant.

If this Variant does not contain a Java double, an attempt is made to coerce the Variant type into a Java double. If this fails, an error is thrown. the Java double represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into a double

since:
   3.2



getFloat
public float getFloat()(Code)
Returns the Java float represented by this Variant.

If this Variant does not contain a Java float, an attempt is made to coerce the Variant type into a Java float. If this fails, an error is thrown. the Java float represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into a float



getInt
public int getInt()(Code)
Returns the Java int represented by this Variant.

If this Variant does not contain a Java int, an attempt is made to coerce the Variant type into a Java int. If this fails, an error is thrown. the Java int represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into a int



getLong
public long getLong()(Code)
Returns the Java long represented by this Variant.

If this Variant does not contain a Java long, an attempt is made to coerce the Variant type into a Java long. If this fails, an error is thrown. the Java long represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into a long

since:
   3.2



getShort
public short getShort()(Code)
Returns the Java short represented by this Variant.

If this Variant does not contain a Java short, an attempt is made to coerce the Variant type into a Java short. If this fails, an error is thrown. the Java short represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into a short



getString
public String getString()(Code)
Returns the Java String represented by this Variant.

If this Variant does not contain a Java String, an attempt is made to coerce the Variant type into a Java String. If this fails, an error is thrown. the Java String represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into a String



getType
public short getType()(Code)
Returns the type of the variant type. This will be an OLE.VT_* value or a bitwise combination of OLE.VT_* values as in the case of OLE.VT_BSTR | OLE.VT_BYREF. the type of the variant data
since:
   2.0



getUnknown
public IUnknown getUnknown()(Code)
Returns the IUnknown object represented by this Variant.

If this Variant does not contain an IUnknown object, an attempt is made to coerce the Variant type into an IUnknown object. If this fails, an error is thrown. the IUnknown object represented by this Variant
exception:
  SWTException -

  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant can not be coerced into an IUnknown object



setByRef
public void setByRef(boolean val)(Code)
Update the by reference value of this variant with a new boolean value.
Parameters:
  val - the new boolean value
exception:
  SWTException -
  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant is not a (VT_BYREF | VT_BOOL) object

since:
   2.1



setByRef
public void setByRef(float val)(Code)
Update the by reference value of this variant with a new float value.
Parameters:
  val - the new float value
exception:
  SWTException -
  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant is not a (VT_BYREF | VT_R4) object

since:
   2.1



setByRef
public void setByRef(int val)(Code)
Update the by reference value of this variant with a new integer value.
Parameters:
  val - the new integer value
exception:
  SWTException -
  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant is not a (VT_BYREF | VT_I4) object

since:
   2.1



setByRef
public void setByRef(short val)(Code)
Update the by reference value of this variant with a new short value.
Parameters:
  val - the new short value
exception:
  SWTException -
  • ERROR_CANNOT_CHANGE_VARIANT_TYPE when type of Variant is not a (VT_BYREF | VT_I2) object

since:
   2.1



setData
void setData(int pData)(Code)



toString
public String toString()(Code)
Returns a string containing a concise, human-readable description of the receiver. a string representation of the Variant



win32_copy
public static void win32_copy(int pVarDest, Variant varSrc)(Code)
Invokes platform specific functionality to copy a variant into operating system memory.

IMPORTANT: This method is not part of the public API for Variant. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.


Parameters:
  pVarDest - destination pointer to a variant
Parameters:
  varSrc - source Variant
since:
   3.3



win32_new
public static Variant win32_new(int pVariant)(Code)
Invokes platform specific functionality to wrap a variant.

IMPORTANT: This method is not part of the public API for GC. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.


Parameters:
  pVariant - pointer to a variant a new GC
since:
   3.3



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.