Interface Types

All Superinterfaces:
Iterable<Type>
All Known Implementing Classes:
TypeEnumSet, TypeRefSet, TypeSet

public interface Types extends Iterable<Type>
A collection of org.osid.type.Types, each uniquely identified by its namespace, authority, and identifier. It is designed to help a provider track which types it supports. The interface is Iterable, so the supported types can be walked with a for-each loop. null types are rejected. Implementations differ in how repeated adds are handled: a plain set (TypeSet) ignores them, while a reference-counted set (TypeRefSet) keeps a type until every add is matched by a remove.
  • Method Details

    • add

      void add(Type type)
      Tracks a supported type.
      Parameters:
      type - the type to add
      Throws:
      NullArgumentException - type is null
    • remove

      void remove(Type type)
      Removes a type.
      Parameters:
      type - the type to remove
      Throws:
      NullArgumentException - type is null
    • contains

      boolean contains(Type type)
      Tests for the existience of a type.
      Parameters:
      type - the type to test for
      Returns:
      true if the type exists, false otherwise
      Throws:
      NullArgumentException - type is null
    • toCollection

      Collection<Type> toCollection()
      Gets an iterable collection of the types.
      Returns:
      a collection
    • toArray

      Type[] toArray()
      Gets an array of the types.
      Returns:
      an array of types
    • clear

      void clear()
      Removes all types.