Results 1 to 2 of 2

Thread: java:type:java.util.Vector

  1. #1
    jesse is offline Registered User
    Name: Jesse Anderson
    Organization: Bright Systems
    Project: Data Moving
    Join Date
    Apr 2007
    Posts
    35

    java:type:java.util.Vector

    In my .ice file I have the following line:

    Code:
    ["java:type:java.util.Vector<Disk>"]
    sequence<Disk> DisksDef;
    However the variable that gets generated is:

    Code:
    public java.util.List<Disk> Disks;
    Instead of creating a Vector it creates a List interface. Am I putting in the wrong metadata tag?

    I realize that Vector implements the List interface. However, having to change from Vector to List will take some effort. I would prefer to keep it a Vector.

  2. #2
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Welcome to the forum.

    As explained in section 10.15.3 of the Ice manual, the syntax for Java custom type metadata is

    java:type:concrete-type[:abstract-type]

    If you don't specify an abstract type, the translator uses java.util.List by default. If you want to use java.util.Vector for both types, you need to modify your definition as shown below:
    Code:
    ["java:type:java.util.Vector<Disk>:java.util.Vector<Disk>"]
    sequence<Disk> DisksDef;
    Take care,
    - Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Java Performance of Ice.Util.createInputStream
    By glennleidy in forum Help Center
    Replies: 9
    Last Post: 12-19-2009, 08:11 AM
  2. Is the ICE for Java based on Java NIO?
    By Jiangyubao in forum Comments
    Replies: 1
    Last Post: 03-30-2008, 06:04 PM
  3. Replies: 2
    Last Post: 11-24-2006, 03:03 AM
  4. Java: going from String to Enum Type
    By nightnday in forum Help Center
    Replies: 2
    Last Post: 03-21-2006, 02:32 PM
  5. Replies: 2
    Last Post: 06-30-2004, 04:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •