org.aksw.commons.collections
Class Sample<T>

java.lang.Object
  extended by org.aksw.commons.collections.Sample<T>

public class Sample<T>
extends Object

Created by Claus Stadler Date: Oct 12, 2010 Time: 5:51:59 PM A pair of sets of positives and negative examples. This class is intended to be used e.g. for training sets, test sets, in information retrieval / machine learning scenarios and such. But also for keeping track of the sets of constant values a variable in e.g. jena expression may have.


Constructor Summary
Sample(Set<T> positives, Set<T> negatives)
           
 
Method Summary
 void addAll(Collection<? extends T> positives, Collection<? extends T> negatives)
           
 void addAll(Sample<T> other)
           
 void clear()
           
static
<T> Sample<T>
create()
           
static
<T> Sample<T>
create(Sample<T> other)
           
static
<T> Sample<T>
create(Set<T> positives, Set<T> negatives)
           
static
<T> Sample<T>
createCopy(Collection<T> positives, Collection<T> negatives)
           
static
<T> Sample<T>
createCopy(Sample<T> other)
           
 Set<T> getNegatives()
           
 Set<T> getPositives()
           
 boolean isEmpty()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sample

public Sample(Set<T> positives,
              Set<T> negatives)
Method Detail

create

public static <T> Sample<T> create()

createCopy

public static <T> Sample<T> createCopy(Sample<T> other)

createCopy

public static <T> Sample<T> createCopy(Collection<T> positives,
                                       Collection<T> negatives)

create

public static <T> Sample<T> create(Sample<T> other)

create

public static <T> Sample<T> create(Set<T> positives,
                                   Set<T> negatives)

getPositives

public Set<T> getPositives()

getNegatives

public Set<T> getNegatives()

addAll

public void addAll(Sample<T> other)

addAll

public void addAll(Collection<? extends T> positives,
                   Collection<? extends T> negatives)

clear

public void clear()

isEmpty

public boolean isEmpty()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.