add
public boolean add(Object targetChild)
Add an element to this collection.
- add in interface Collection
- true if the collection was modified as a result of this action.
addAll
public boolean addAll(Collection c)
Add the contents of a given collection to this collection.
- addAll in interface Collection
c
- the collection to add.
- true if the collection was modified as a result of this action.
clear
public void clear()
Clear the collection, such that a subsequent call to isEmpty() would
return true.
- clear in interface Collection
contains
public boolean contains(Object o)
Test whether this collection contains a given object as one of its
elements.
- contains in interface Collection
o
- the element to look for.
- true if this collection contains at least one element e such that
o == null ? e == null : o.equals(e)
.
containsAll
public boolean containsAll(Collection c)
Test whether this collection contains every element in a given collection.
- containsAll in interface Collection
c
- the collection to test for.
- true if for every element o in c, contains(o) would return true.
getResource
public URL getResource(String name,
BeanContextChild bcc)
Get a resource. The
BeanContext
will typically
call
ClassLoader.getResource()
, but may do it any
way it wants to. This allows a
BeanContext
to
have its own set of resources separate from the rest of the
system.
Beans should call this method on their parent rather than the
associated
ClassLoader
method.
I am assuming, but am not entirely sure, that if a
BeanContext
cannot find a resource, its
responsibility is to call the
getResource
method
of its parent
BeanContext
.
- getResource in interface BeanContext
- a URL to the requested resource.
getResourceAsStream
public InputStream getResourceAsStream(String name,
BeanContextChild bcc)
Get a resource as a stream. The
BeanContext
will
typically call
ClassLoader.getResourceAsStream()
,
but may do it any way it wants to. This allows a
BeanContext
's children to have their own set of
resources separate from the rest of the system.
Beans should call this method on their parent rather than the
associated
ClassLoader
method.
I am assuming, but am not entirely sure, that if a
BeanContext
cannot find a resource, its
responsibility is to call the
getResourceAsStream
method of its parent
BeanContext
.
- getResourceAsStream in interface BeanContext
- the requested resource as a stream.
isDesignTime
public boolean isDesignTime()
This method should tell whether it is design time or runtime.
- isDesignTime in interface DesignMode
true
if design time, false
if
runtime.
isEmpty
public boolean isEmpty()
Test whether this collection is empty, that is, if size() == 0.
- isEmpty in interface Collection
- true if this collection contains no elements.
iterator
public Iterator iterator()
Obtain an Iterator over this collection.
- iterator in interface Collection
- an Iterator over the elements of this collection, in any order.
remove
public boolean remove(Object targetChild)
Remove a single occurrence of an object from this collection. That is,
remove an element e, if one exists, such that o == null ? e == null
: o.equals(e)
.
- remove in interface Collection
- true if the collection changed as a result of this call, that is,
if the collection contained at least one occurrence of o.
remove
protected boolean remove(Object targetChild,
boolean callChildSetBC)
removeAll
public boolean removeAll(Collection c)
Remove all elements of a given collection from this collection. That is,
remove every element e such that c.contains(e).
- removeAll in interface Collection
c
- The collection of objects to be removed.
- true if this collection was modified as a result of this call.
retainAll
public boolean retainAll(Collection c)
Remove all elements of this collection that are not contained in a given
collection. That is, remove every element e such that !c.contains(e).
- retainAll in interface Collection
c
- The collection of objects to be retained.
- true if this collection was modified as a result of this call.
setDesignTime
public void setDesignTime(boolean dtime)
The environment will call this method on your
BeanContextChild
when it is registered in a parent
BeanContext
or when behavior needs to switch from
design time to runtime behavior (or vice versa).
BeanContext
s are required to fire
PropertyChangeEvent
s when properties change.
designTime
is a property, and therefore when you
implement
setDesignTime()
, you need to fire a
PropertyChangeEvent
with the old value, the new
value and using
PROPERTYNAME
as the property name.
- setDesignTime in interface DesignMode
size
public int size()
Get the number of elements in this collection.
- size in interface Collection
- the number of elements in the collection.
toArray
public Object[] toArray()
Copy the current contents of this collection into an array.
- toArray in interface Collection
- an array of type Object[] and length equal to the size of this
collection, containing the elements currently in this collection, in
any order.
toArray
public Object[] toArray(Object[] array)
Copy the current contents of this collection into an array. If the array
passed as an argument has length less than the size of this collection, an
array of the same run-time type as a, and length equal to the size of this
collection, is allocated using Reflection. Otherwise, a itself is used.
The elements of this collection are copied into it, and if there is space
in the array, the following element is set to null. The resultant array is
returned.
Note: The fact that the following element is set to null is only useful
if it is known that this collection does not contain any null elements.
- toArray in interface Collection
- an array containing the elements currently in this collection, in
any order.
ArrayStoreException
- if the type of any element of the
collection is not a subtype of the element type of a.
BeanContextSupport.java --
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.