Holger's
Java API

com.antelmann.db
Class Taggable.Adapter<T extends Tag>

java.lang.Object
  extended by com.antelmann.db.Taggable.Adapter<T>
All Implemented Interfaces:
Taggable<T>, Forgeable<Taggable<T>>, Serializable, Iterable<T>
Enclosing interface:
Taggable<T extends Tag>

public static class Taggable.Adapter<T extends Tag>
extends Object
implements Taggable<T>, Serializable, Iterable<T>, Forgeable<Taggable<T>>

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.antelmann.db.Taggable
Taggable.Adapter<T extends Tag>
 
Constructor Summary
Taggable.Adapter()
           
 
Method Summary
 boolean add(T tag)
          makes this instance member of the given group
 boolean addAll(Collection<T> col)
           
 void clear()
           
 boolean equals(Object obj)
           
 Collection<T> getTags()
          lists all groups that this instance is currently a member of (the data is essentially derived from a set)
 String[] getTagStrings()
          provides a sorted array of the tag names
static String[] getTagStrings(Taggable<?> t)
          provides a sorted array of the tag names
 int hashCode()
           
 boolean isTagged(T tag)
          allows to determine the membership of the given tag or group
 Iterator<T> iterator()
           
 boolean remove(T tag)
          terminates the membership of this instance to the given group
 void setAllFrom(Taggable<T> t)
          copies the properties of the given object and applies them to this instance, so that its behavior in regards to the given object can be matched to the extend that the implementing class supports that behavior.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Taggable.Adapter

public Taggable.Adapter()
Method Detail

add

public boolean add(T tag)
            throws IllegalArgumentException
Description copied from interface: Taggable
makes this instance member of the given group

Specified by:
add in interface Taggable<T extends Tag>
Parameters:
tag - the Group object that this instance is to become a member of
Returns:
true only if the group was actually added to this instance or false if it already was a member of that group
Throws:
IllegalArgumentException - if this instance cannot be part of the given group

size

public int size()

clear

public void clear()

addAll

public boolean addAll(Collection<T> col)

setAllFrom

public void setAllFrom(Taggable<T> t)
                throws NullPointerException
Description copied from interface: Forgeable
copies the properties of the given object and applies them to this instance, so that its behavior in regards to the given object can be matched to the extend that the implementing class supports that behavior.

Specified by:
setAllFrom in interface Forgeable<Taggable<T extends Tag>>
Parameters:
t - the object whose behavior is to be copied to this instance
Throws:
NullPointerException - if the given object parameter is null

getTagStrings

public String[] getTagStrings()
provides a sorted array of the tag names


getTagStrings

public static String[] getTagStrings(Taggable<?> t)
provides a sorted array of the tag names


iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T extends Tag>

getTags

public Collection<T> getTags()
Description copied from interface: Taggable
lists all groups that this instance is currently a member of (the data is essentially derived from a set)

Specified by:
getTags in interface Taggable<T extends Tag>

isTagged

public boolean isTagged(T tag)
Description copied from interface: Taggable
allows to determine the membership of the given tag or group

Specified by:
isTagged in interface Taggable<T extends Tag>

remove

public boolean remove(T tag)
Description copied from interface: Taggable
terminates the membership of this instance to the given group

Specified by:
remove in interface Taggable<T extends Tag>
Parameters:
tag - the Group that this instance is to be removed from as a member
Returns:
true only if this instance was previously a member of the given group.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads