cast() private method

private cast ( global par0 ) : global::java.lang.Object
par0 global
return global::java.lang.Object
コード例 #1
0
 public virtual Annotation getAnnotation(Class annotationType)
 {
   Iterator iterator = this.getAnnotations().iterator();
   while (iterator.hasNext())
   {
     Annotation annotation = (Annotation) iterator.next();
     if (annotationType.isInstance((object) annotation))
       return (Annotation) annotationType.cast((object) annotation);
   }
   return (Annotation) null;
 }
コード例 #2
0
 public virtual Annotation getAnnotation(Class annotationType)
 {
   Annotation[] annotationArray = this.fAnnotations;
   int length = annotationArray.Length;
   for (int index = 0; index < length; ++index)
   {
     Annotation annotation = annotationArray[index];
     if (Object.instancehelper_equals((object) annotation.annotationType(), (object) annotationType))
       return (Annotation) annotationType.cast((object) annotation);
   }
   return (Annotation) null;
 }
コード例 #3
0
ファイル: TestClass.cs プロジェクト: NALSS/SmartDashboard.NET
 public virtual List getAnnotatedFieldValues(object test, Class annotationClass, Class valueClass)
 {
   ArrayList arrayList = new ArrayList();
   Iterator iterator = this.getAnnotatedFields(annotationClass).iterator();
   while (iterator.hasNext())
   {
     FrameworkField frameworkField = (FrameworkField) iterator.next();
     try
     {
       ((List) arrayList).add(valueClass.cast(frameworkField.get(test)));
       continue;
     }
     catch (IllegalAccessException ex)
     {
     }
     string str = "How did getFields return a field we couldn't access?";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new RuntimeException(str);
   }
   return (List) arrayList;
 }