1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 package com.sun.star.lib.uno.typeinfo;
24 
25 import com.sun.star.uno.Type;
26 
27 public class MethodTypeInfo extends TypeInfo
28 {
29 	protected int m_index;
30     private final Type m_unoType; // @since UDK 3.2
31 
32     /**
33        Create a method type info with a UNO return type that cannot
34        unambiguously be represented as a Java 1.2 type.
35 
36        @param name the name of this method; must not be <code>null</code>
37 
38        @param index the index among the direct members
39 
40        @param flags any flags (<code>ONEWAY</code>, <code>UNSIGNED</code>,
41        <code>ANY</code>, <code>INTERFACE</code>)
42 
43        @param unoType the exact UNO return type; or <code>null</code> if the UNO
44        type is already unambiguously represented by the Java&nbsp;1.2 type
45 
46        @since UDK 3.2
47      */
MethodTypeInfo(String name, int index, int flags, Type unoType)48     public MethodTypeInfo(String name, int index, int flags, Type unoType) {
49         super(name, flags);
50         m_index = index;
51         m_unoType = unoType;
52     }
53 
MethodTypeInfo(String name, int index, int flags)54 	public MethodTypeInfo(String name, int index, int flags)
55 	{
56         this(name, index, flags, null);
57 	}
58 
getIndex()59 	public int getIndex()
60     {
61 		return m_index;
62 	}
63 
isReturnUnsigned()64 	public boolean isReturnUnsigned()
65 	{
66 		return isUnsigned();
67 	}
68 
isOneway()69 	public boolean isOneway()
70 	{
71 		return (m_flags & TypeInfo.ONEWAY) != 0;
72 	}
73 
isConst()74 	public boolean isConst()
75 	{
76 		return (m_flags & TypeInfo.CONST) != 0;
77 	}
78 
79     /**
80        Get the exact UNO return type of this method type info, in case it cannot
81        unambiguously be represented as a Java&nbsp;1.2 type.
82 
83        @return the exact UNO return type of this method type info, or
84        <code>null</code> if the UNO type is already unambiguously represented by
85        the Java&nbsp;1.2 type
86 
87        @since UDK 3.2
88      */
getUnoType()89     public final Type getUnoType() {
90         return m_unoType;
91     }
92 }
93 
94 
95