Re: Help with Date and SimpleDateFormat

From: Michael Borgwardt (brazil_at_brazils-animeland.de)
Date: 10/24/03


Date: Fri, 24 Oct 2003 13:20:21 +0200

Kyote wrote:
[API docs]
>>Again: what problems exactly do you run into when using them?
[]
> The layout of the methods table is what seems to toss me for a spin.
> Here's an example:
>
> void applyLocalizedPattern(String pattern)
> Apply the given localized pattern string to this date
> format.
>
> void
>
> Okay, void is in the left hand column of the table:
>
> applyLocalizedPattern(String pattern)
>
> applyLocalizedPattern(String pattern) is in the right hand along with
> a description. I can't for the life of me remember what's what. I
> think void is the return type?

What else could it be? I really don't see how this could pose a problem.

> rather quickly I'm sorry to say. Not to mention that I'm not too sure
> of the right hand column... Is there a help file that explains all of
> it in detail? Something I can refer to when I forget, which is likely,
> at least at first?

To me, it was all nearly obvious right from the beginning. It sounds like
you just need to get used to the structure. Maybe it's just confusing to you
because you keep jumping into the middle of huge classe descriptions.
Try browsing through the API docs for some classes that have only
a couple of methods. The structure should be easier to understand there.

>>Where do you look first, where and why do you give up?
>
> I usually give up when I can't understand where to go after looking at
> the methods. Well, I will actually look at several methods before
> actually giving up. But when I try something from the API that I think
> I understand only to get an exception from the attempt, it makes me
> think that my understanding of the API is flawed. THAT's when I give
> up.

OK, that part I can understand. Note that the detailed method descriptions
also often list the exceptions that can be throw, and what the reason would
be. Unfortunately, these descriptions are often missing or incomplete, and
of course the can't cover stuff like NullPointerException or
ArrayIndexOutOfBoundException that can crop up almost everywhere.

In a case where an API library method throws an unexplainable exception,
it can help to look at the source code where the exception is thrown.
The SDK comes with the complete API library source, and a good IDE
should be able to include it so that you can jump directly to it from
the method call in your code. The sources also include the documentation
as JavaDoc comments, and nowadays I rarely look at the HTML docs anymore.



Relevant Pages

  • [md-accel PATCH 04/19] async_tx: add the async_tx api
    ... The async_tx api provides methods for describing a chain of asynchronous ... channel pool is organized as a per-cpu array of channel pointers. ... * under the terms and conditions of the GNU General Public License, ... +static void ...
    (Linux-Kernel)
  • Re: Proposed addition of malloc_size_np()
    ... Consider that the allocator must know how large allocations are so that it can do the right thing for reallocand free. ... Following is a much more reasonable API that doesn't burden the allocator with information that the application should be able to provide: ... this isn't about reinventing a perfect wheel -- it's about filing off a rough edge on the stone wheel we're stuck with. ...
    (freebsd-arch)
  • [PATCH 11/14/] Doc. sources: expose hpet
    ... the rtc.c driver. ... There is a user space API and a kernel space API. ... -static void ...
    (Linux-Kernel)
  • Re: Receiving a boolean from an InputBuffer ?
    ... Of course memcpy et al are functions defined in an Application Programmers ... like any well behaved API ... void main ... >>> go and learn api programming first, but this particular api is the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: MiniDumpWriteDump
    ... I changed the structure to use pointers instead of using the types inline ... Now, when an exception occurs, and is caught my me (see sample code in same ... (Please forget my last posting's question about whether the API can access ... >>> End Sub ...
    (microsoft.public.vb.winapi)