Holger's Java API

## com.antelmann.cddb
Class Group

    java.lang.Object
      com.antelmann.cddb.Resource
          com.antelmann.cddb.Group

All Implemented Interfaces:
  Serializable, Comparable<Resource>

    public class Group

extends Resource

Group is a resource made up by multiple individual resources; this could be an artist, a band, an orchestra, a chorus or anything similar - including yet another group.

Though normally a group would normally contain Artists rather than plain Resources, it is conceivable that a group also just contains Resource objects (let's say an orchestra or group is famous for using a specific instrument or something similar).

Author:
  Holger Antelmann
See Also:
  `Role`, `Artist`, `Resource`, `Composition`, Serialized Form

Constructor Summary
`Group(String name, String description)`

Method Summary
`boolean` `add(Resource resource)`
`boolean` `contains(Resource resource)` only looks at the directly added resources (ignores matches in sub-groups)
`boolean` `find(Resource resource)` searches through sub-groups as well
`Set<Resource>` `getCompositionContributions()` provides an unmodifiable view of the embedded resources
`boolean` `remove(Resource resource)`

Methods inherited from class com.antelmann.cddb.Resource
`compareTo, equals, getDescription, getName, hashCode, setDescription, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Group

    public Group(String name,
                 String description)

Method Detail

### contains

    public boolean contains(Resource resource)

  only looks at the directly added resources (ignores matches in sub-groups)

### find

    public boolean find(Resource resource)

  searches through sub-groups as well

### add

    public boolean add(Resource resource)
                throws RecursiveCycleException

  Throws:
    `RecursiveCycleException` - if the resource is a group that is already contained in a sub-level

### remove

    public boolean remove(Resource resource)

### getCompositionContributions

    public Set<Resource> getCompositionContributions()

  provides an unmodifiable view of the embedded resources

  Returns:
    Set of Resource objects

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