Coverage Report - org.talos.Container
 
Classes in this File Line Coverage Branch Coverage Complexity
Container
N/A
N/A
0
 
 1  
 package org.talos;
 2  
 
 3  
 import java.util.Collection;
 4  
 
 5  
 import org.talos.model.NamedObject;
 6  
 
 7  
 /**
 8  
  * 
 9  
  * This inteface describes operations that are common among all containers in Talos.
 10  
  * A container is an object that holds a determined type of Talos entity, representing a partition of all the Talos data.
 11  
  *
 12  
  * @param <T> the type of entity the container holds.
 13  
  */
 14  
 public interface Container<T extends NamedObject> {
 15  
 
 16  
         /**
 17  
          * Permanently deletes from Talos all the elements of the container.
 18  
          */
 19  
         void remove();
 20  
 
 21  
         /**
 22  
          * Check if the container is empty.
 23  
          * 
 24  
          * @return true if it is empty, false otherwise.
 25  
          * @see #list()
 26  
          */
 27  
         public boolean isEmpty();
 28  
 
 29  
         /**
 30  
          * Gets all the entities the container holds.
 31  
          * 
 32  
          * @return a collection with all the entities.
 33  
          * @see #contains(String)
 34  
          * @see #containsAll(String[])
 35  
          */
 36  
         public Collection<T> list();
 37  
 
 38  
         /**
 39  
          * Verifies if the container contains an entity with the given name.
 40  
          * 
 41  
          * @param name the name of the entity.
 42  
          * @return true if it contains an entity with the given name, false otherwise.
 43  
          * @see #list()
 44  
          * @see #containsAll(String[])
 45  
          */
 46  
         public boolean contains(String name);
 47  
 
 48  
         /**
 49  
          * Verifies if the container contains all the given entities.
 50  
          * 
 51  
          * @param names the name of each entities.
 52  
          * @return true if it contains all the entities, false otherwise.
 53  
          * @see #contains(String)
 54  
          */
 55  
         public boolean containsAll(String... names);
 56  
 
 57  
         /**
 58  
          * Get an especific element from this container.
 59  
          * 
 60  
          * @param name the name of the element to get.
 61  
          * @return the element if it is found, null if it is not.
 62  
          * @see #list()
 63  
          * @see #contains(String)
 64  
          */
 65  
         public T getElement(String name);
 66  
         
 67  
         /**
 68  
          * Returns the number of elements in this container
 69  
          * 
 70  
          * @return the number of elements in this container
 71  
          * @see #list()
 72  
          * @see #isEmpty()
 73  
          */
 74  
         public int size();
 75  
 
 76  
 }