mark.nlp.data
Interface Bag

All Known Implementing Classes:
ArrayBag, HashBag, SparseBag, SparseBagInstance

public interface Bag

An interface for a bag of objects.


Method Summary
 java.util.Iterator iterator()
          Returns an iterator over the object types.
 double num()
          Returns the number of object occurrences in the bag.
 double num(java.lang.Object o)
          Returns the number of object type o occurrences in the bag.
 int numTypes()
          Returns the number of object types with non-zero occurrences.
 

Method Detail

numTypes

public int numTypes()
Returns the number of object types with non-zero occurrences.

Returns:
the number of object types with non-zero occurrences.

iterator

public java.util.Iterator iterator()
Returns an iterator over the object types.

Returns:
the iterator.

num

public double num(java.lang.Object o)
Returns the number of object type o occurrences in the bag.

Parameters:
o - the object.
Returns:
the number of o occurrences.

num

public double num()
Returns the number of object occurrences in the bag.

Returns:
the number of object occurrences.