From 0340e62fc9fa78cfe0a6718ac07f1ba31260ff5c Mon Sep 17 00:00:00 2001 From: rbuj Date: Tue, 22 Jul 2014 12:33:50 +0200 Subject: ridljar: javadoc & Override MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Javadoc: apply formatting and remove the warning "empty

tag". @Override public String toString() @Override public boolean equals(Object obj) @Override public int hashCode() Change-Id: I64b63d01015535d386ac584831c4ef6e371e863d Reviewed-on: https://gerrit.libreoffice.org/10453 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- ridljar/com/sun/star/uno/Any.java | 66 +++++++++++++++--------- ridljar/com/sun/star/uno/Enum.java | 5 +- ridljar/com/sun/star/uno/IMemberDescription.java | 5 -- ridljar/com/sun/star/uno/IMethodDescription.java | 6 --- ridljar/com/sun/star/uno/ITypeDescription.java | 14 ----- ridljar/com/sun/star/uno/Type.java | 26 ++++++++-- ridljar/com/sun/star/uno/Union.java | 3 +- ridljar/com/sun/star/uno/UnoRuntime.java | 2 +- 8 files changed, 70 insertions(+), 57 deletions(-) diff --git a/ridljar/com/sun/star/uno/Any.java b/ridljar/com/sun/star/uno/Any.java index ba1d9f643b56..8da2bfbcef00 100644 --- a/ridljar/com/sun/star/uno/Any.java +++ b/ridljar/com/sun/star/uno/Any.java @@ -28,19 +28,19 @@ package com.sun.star.uno; * an interprocess connection using an any, you should use this class to add * an explicit interface type, so the remote counterpart doesn't need to invoke * a queryInterface). - *

+ *

*/ public class Any { /** * The type of the any. - *

+ * * @see #getType */ protected Type _type; /** * The data of the any. - *

+ * * @see #getObject */ protected Object _object; @@ -52,7 +52,7 @@ public class Any { /** * Constructs a new any. - *

+ * * @param zInterface the type of the any. * @param object the data of the any. * @deprecated as of UDK 2.0 @@ -61,9 +61,11 @@ public class Any { this(new Type(zInterface), object); } - /** Constructs a new any with a given type and value - @param type the UNO type of the any. - @param object the value of the any. + /** + * Constructs a new any with a given type and value + * + * @param type the UNO type of the any. + * @param object the value of the any. */ public Any(Type type, Object object) { if (type.equals(Type.ANY)) { @@ -74,15 +76,13 @@ public class Any { } /** - Complete a UNO ANY (make sure it is wrapped up as an - Any instance). - - @param any a Java value representing a UNO ANY value. - - @return a complete Java value (that is, an Any instance) - representing the same UNO ANY value as the given argument. - - @since UDK 3.2.3 + * Complete a UNO ANY (make sure it is wrapped up as an + * Any instance). + * + * @param any a Java value representing a UNO ANY value. + * @return a complete Java value (that is, an Any instance) + * representing the same UNO ANY value as the given argument. + * @since UDK 3.2.3 */ public static final Any complete(Object any) { return any instanceof Any @@ -93,8 +93,8 @@ public class Any { /** * Gets the type of the value within the any. - *

- * @return the type of the value within the any. + * + * @return the type of the value within the any. */ public Type getType() { return _type; @@ -102,14 +102,22 @@ public class Any { /** * Gets the value within the any. - *

- * @return gets the value within the any. + * + * @return gets the value within the any. */ public Object getObject() { return _object; } - // @see java.lang.Object#equals + /** + * Indicates whether some other object is equal to this one. + * + * @param obj the reference object with which to compare. + * @return true if this object is the same as the obj argument; + * false otherwise. + * @see java.lang.Object#equals + */ + @Override public boolean equals(Object obj) { return obj instanceof Any && _type.equals(((Any) obj)._type) && (_object == null @@ -117,13 +125,25 @@ public class Any { : _object.equals(((Any) obj)._object)); } - // @see java.lang.Object#hashCode + /** + * Returns a hash code value for the object. + * + * @return a hash code value for this object. + * @see java.lang.Object#hashCode + */ + @Override public int hashCode() { return _type.hashCode() * 13 + (_object == null ? 0 : _object.hashCode()); } - // @see java.lang.Object#toString + /** + * Returns a string representation of the object. + * + * @return a string representation of the object. + * @see java.lang.Object#toString + */ + @Override public String toString() { return "Any[" + _type + ", " + _object + "]"; } diff --git a/ridljar/com/sun/star/uno/Enum.java b/ridljar/com/sun/star/uno/Enum.java index 0203347adb53..53615cb87c5f 100644 --- a/ridljar/com/sun/star/uno/Enum.java +++ b/ridljar/com/sun/star/uno/Enum.java @@ -21,18 +21,18 @@ package com.sun.star.uno; /** * The Enum class is the base class for all classes generated * as java binding for the IDL type enum. + *

* Each java mapped enum class provides static member of this class * which represents the enum values. * You cannot create a object of this class or subclass direct, to * avoid enum values with integer values outside the defined range. - *

+ *

*/ public abstract class Enum { private int m_value; /** * Constructs a enum value. - *

* @param value the integer value of this enum value. */ protected Enum(int value) { @@ -41,7 +41,6 @@ public abstract class Enum { /** * Get the integer value of an enum value. - *

* @return the integer value. */ public final int getValue() { diff --git a/ridljar/com/sun/star/uno/IMemberDescription.java b/ridljar/com/sun/star/uno/IMemberDescription.java index c38094452474..605616f0d67e 100644 --- a/ridljar/com/sun/star/uno/IMemberDescription.java +++ b/ridljar/com/sun/star/uno/IMemberDescription.java @@ -30,28 +30,24 @@ package com.sun.star.uno; public interface IMemberDescription { /** * Gives the name of this member. - *

* @return the name */ String getName(); /** * Indicates if this member is unsigned. (Not useful for IMethodDescription). - *

* @return the unsigned state */ boolean isUnsigned(); /** * Indicates if this member is an any. - *

* @return the any state */ boolean isAny(); /** * Indicates if this member is an interface. - *

* @return the interface state */ boolean isInterface(); @@ -59,7 +55,6 @@ public interface IMemberDescription { /** * Gives the relative index of this member in the declaring * interface or struct (including superclasses). - *

* @return the relative index of this member */ int getIndex(); diff --git a/ridljar/com/sun/star/uno/IMethodDescription.java b/ridljar/com/sun/star/uno/IMethodDescription.java index f8f509e1bcd9..f58e194f2efd 100644 --- a/ridljar/com/sun/star/uno/IMethodDescription.java +++ b/ridljar/com/sun/star/uno/IMethodDescription.java @@ -34,14 +34,12 @@ public interface IMethodDescription extends IMemberDescription { /** * Indicates if this method is oneWay, * respectively if this method may become executed asynchronously. - *

* @return true means may execute asynchronously . */ boolean isOneway(); /** * Indicates if this method is const. - *

* @return true means it is const. */ boolean isConst(); @@ -49,7 +47,6 @@ public interface IMethodDescription extends IMemberDescription { /** * Gives any array of ITypeDescription of * the [in] parameters. - *

* @return the in parameters */ ITypeDescription[] getInSignature(); @@ -57,7 +54,6 @@ public interface IMethodDescription extends IMemberDescription { /** * Gives any array of ITypeDescription of * the [out] parameters. - *

* @return the out parameters */ ITypeDescription[] getOutSignature(); @@ -65,14 +61,12 @@ public interface IMethodDescription extends IMemberDescription { /** * Gives the ITypeDescription of * the return type. - *

* @return the return type ITypeDescription */ ITypeDescription getReturnSignature(); /** * Gives native java method of this method. - *

* @return the java methodd */ Method getMethod(); diff --git a/ridljar/com/sun/star/uno/ITypeDescription.java b/ridljar/com/sun/star/uno/ITypeDescription.java index 62a399b6a7a3..b326e9c421bc 100644 --- a/ridljar/com/sun/star/uno/ITypeDescription.java +++ b/ridljar/com/sun/star/uno/ITypeDescription.java @@ -21,7 +21,6 @@ package com.sun.star.uno; /** * The ITypeDescription allows to examine a type * in detail (e.g. it is used for marshaling/unmarshaling). - * * @deprecated This interface does not cover all the features supported by the * corresponding (unpublished) implementation. But no client code should need * to access this functionality, anyway. @@ -30,7 +29,6 @@ public interface ITypeDescription { /** * Gets the ITypeDescription of the * super, if it exists. - *

* @return the ITypeDescription. */ ITypeDescription getSuperType(); @@ -39,7 +37,6 @@ public interface ITypeDescription { * Gets the IMethodDescription for every * method, if this type is an interface. Otherwise * returns null. - *

* @return the IMethodDescription[]. */ IMethodDescription []getMethodDescriptions(); @@ -48,7 +45,6 @@ public interface ITypeDescription { * Gets the IMethodDescription for the * method with index methodId, if it exists, otherwise * returns null. - *

* @return the IMethodDescription. */ IMethodDescription getMethodDescription(int methodId); @@ -57,7 +53,6 @@ public interface ITypeDescription { * Gets the IMethodDescription for the * method with the name name, if it exists, * otherwise returns null. - *

* @return the IMethodDescription. */ IMethodDescription getMethodDescription(String name); @@ -66,7 +61,6 @@ public interface ITypeDescription { * Gets the IFieldDescription for every * field, if this type is an interface. Otherwise * returns null. - *

* @return the IFieldDescription[]. */ IFieldDescription []getFieldDescriptions(); @@ -75,14 +69,12 @@ public interface ITypeDescription { * Gets the IFieldDescription for the * field with the name name, if it exists, * otherwise returns null. - *

* @return the IFieldDescription. */ IFieldDescription getFieldDescription(String name); /** * Gets the IDL TypeClass of the type. - *

* @return the TypeClass. */ TypeClass getTypeClass(); @@ -90,14 +82,12 @@ public interface ITypeDescription { /** * Gets the component ITypeDescription if * this is an array type, otherwise returns null. - *

* @return the ITypeDescription */ ITypeDescription getComponentType(); /** * Gets the (UNO) type name. - * * * * @@ -150,14 +140,12 @@ public interface ITypeDescription { * a simple name S, the corresponding type name consists of the * same sequence of module names and simple name, with "." * separating the individual elements.

- * * @return the type name. */ String getTypeName(); /** * Gets the (Java) array type name. - * *

The array type name is defined to be the Java class name (as returned * by Class.forName) of the Java array class that corresponds * to the UNO sequence type with this type (the UNO type represented by this @@ -165,14 +153,12 @@ public interface ITypeDescription { * ITypeDescription instance representing the UNO type VOID, * the array type name is defined to be * "[Ljava.lang.Void;".

- * * @return the array type name. */ String getArrayTypeName(); /** * Gets the corresponding java class for the type. - *

* @return the corresponding java class. */ Class getZClass(); diff --git a/ridljar/com/sun/star/uno/Type.java b/ridljar/com/sun/star/uno/Type.java index c5f1b5c7bd71..adbcebdd51c3 100644 --- a/ridljar/com/sun/star/uno/Type.java +++ b/ridljar/com/sun/star/uno/Type.java @@ -410,19 +410,39 @@ public class Type { } } - // @see java.lang.Object#equals + /** + * Indicates whether some other object is equal to this one. + * + * @param obj the reference object with which to compare. + * @return true if this object is the same as the obj argument; + * false otherwise. + * @see java.lang.Object#equals + */ + @Override public boolean equals(Object obj) { return obj instanceof Type && _typeClass == ((Type) obj)._typeClass && _typeName.equals(((Type) obj)._typeName); } - // @see java.lang.Object#hashCode + /** + * Returns a hash code value for the object. + * + * @return a hash code value for this object. + * @see java.lang.Object#hashCode + */ + @Override public int hashCode() { return _typeName.hashCode(); } - // @see java.lang.Object#toString + /** + * Returns a string representation of the object. + * + * @return a string representation of the object. + * @see java.lang.Object#toString + */ + @Override public String toString() { return "Type[" + _typeName + "]"; } diff --git a/ridljar/com/sun/star/uno/Union.java b/ridljar/com/sun/star/uno/Union.java index 6a35d667fb3a..88080954c5e8 100644 --- a/ridljar/com/sun/star/uno/Union.java +++ b/ridljar/com/sun/star/uno/Union.java @@ -26,8 +26,7 @@ package com.sun.star.uno; public class Union { /** * Get the value in the union. - * The representation of the value is an any. - *

+ *

The representation of the value is an any.

* @return the any value. */ public final Object getValue() { diff --git a/ridljar/com/sun/star/uno/UnoRuntime.java b/ridljar/com/sun/star/uno/UnoRuntime.java index 1ebde7d98094..8178b51a2750 100644 --- a/ridljar/com/sun/star/uno/UnoRuntime.java +++ b/ridljar/com/sun/star/uno/UnoRuntime.java @@ -31,7 +31,7 @@ import com.sun.star.lib.util.WeakMap; * *

The methods queryInterface and areSame delegate * calls to the implementing objects and are used instead of casts, - * instanceof, ==, and equals.

+ * instanceof, ==, and equals.

* *

For historic reasons, this class is not final, and has a * public constructor. These artifacts are considered mistakes, -- cgit

Mapping from UNO types to type names