Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #8577

Re: optional operation

Date 2011-10-05 10:30 -0700
From Patricia Shanahan <pats@acm.org>
Newsgroups comp.lang.java.programmer
Subject Re: optional operation
References <5eb0fcba-199f-46e4-b913-2f3e851d89fc@q26g2000vby.googlegroups.com>
Message-ID <c_idnaoeDvisCRHTnZ2dnUVZ_rWdnZ2d@earthlink.com> (permalink)

Show all headers | View raw


On 10/5/2011 9:49 AM, bob wrote:
> I'm looking at the docs for FloatBuffer, and in many places it says
> "(optional operation)".  What's the deal with this?  Can we use the
> operation or not?

The term "optional operation" is used in interface and abstract class
declarations to indicate a method that the implementation may be allowed
to throw UnsupportedOperationException.

There are two useful places to look for more information:

1. The full description of the method. For example, FloatBuffer's array
method is defined to throw UnsupportedOperationException "If this buffer
is not backed by an accessible array".

2. Especially in java.util, there are interfaces with many different
implementing classes, and you may need to look at the API documentation
for the implementing class you are using to find out which operations it
supports.

Patricia

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

optional operation bob <bob@coolgroups.com> - 2011-10-05 09:49 -0700
  Re: optional operation Patricia Shanahan <pats@acm.org> - 2011-10-05 10:30 -0700
    Re: optional operation bob <bob@coolgroups.com> - 2011-10-05 14:20 -0700
      Re: optional operation markspace <-@.> - 2011-10-05 15:51 -0700
        Re: optional operation markspace <-@.> - 2011-10-05 16:05 -0700
          Re: optional operation bob <bob@coolgroups.com> - 2011-10-05 23:46 -0700
            Re: optional operation Lew <lewbloch@gmail.com> - 2011-10-06 06:47 -0700

csiph-web