org.mobicents.media.server.spi.format
Class Formats

java.lang.Object
  extended by org.mobicents.media.server.spi.format.Formats

public class Formats
extends Object

Represents collection of formats.

Author:
kulikov

Field Summary
static int DEFAULT_SIZE
           
 
Constructor Summary
Formats()
          Creates new collection with default size;
Formats(int size)
          Creates collection with specified size.
 
Method Summary
 void add(Format format)
          Adds specified format to this collection.
 void addAll(Formats other)
          Adds multiple formats.
 void clean()
          Removes all formats from the collection.
 boolean contains(Format format)
          Checks that collection has specified format.
 Format get(int i)
          Gets the collection element.
 void intersection(Formats other, Formats intersection)
          Find the intersection between this collection and other
 boolean isEmpty()
          Checks collection's size.
 void remove(Format format)
          Removes specified format from this collection.
 int size()
          Gets the number of formats contained inside collection.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SIZE

public static final int DEFAULT_SIZE
See Also:
Constant Field Values
Constructor Detail

Formats

public Formats()
Creates new collection with default size;


Formats

public Formats(int size)
Creates collection with specified size.

Parameters:
size - the size of the collection.
Method Detail

add

public void add(Format format)
Adds specified format to this collection.

Parameters:
format - the format object to be added

addAll

public void addAll(Formats other)
Adds multiple formats.

Parameters:
other - the collection of formats to be added to this collection.

remove

public void remove(Format format)
Removes specified format from this collection.

Parameters:
format - the format object to be removed.

get

public Format get(int i)
Gets the collection element.

Parameters:
i - the position of the element in collection
Returns:
format descriptor.

contains

public boolean contains(Format format)
Checks that collection has specified format.

Parameters:
format - the format to be checked
Returns:
true if collection contains specified format and false otherwise

size

public int size()
Gets the number of formats contained inside collection.

Returns:
the number of objects in the collection.

isEmpty

public boolean isEmpty()
Checks collection's size.

Returns:
true if collection is empty and its size equals to zero.

clean

public void clean()
Removes all formats from the collection.


intersection

public void intersection(Formats other,
                         Formats intersection)
Find the intersection between this collection and other

Parameters:
other - the other collection
intersection - the resulting collection.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.