net.sourceforge.nite.datainspection.data
Class Classification

java.lang.Object
  extended by net.sourceforge.nite.datainspection.data.Classification

public class Classification
extends java.lang.Object

A Classification is data store for a judgement. It is a mapping from the Items judged to a Value given by a judge to the Item
SEE PACKAGE DOCUMENTATION

Author:
Rieks op den Akker

Field Summary
 java.util.List items
           
 java.lang.String name
           
 java.util.List values
           
 
Constructor Summary
Classification(java.lang.String name)
          make empty Classification with a given name
Classification(java.lang.String name, java.lang.String[] items, java.lang.String[] values)
          makes a Classification with StringItems and StringValues from two equal length arrays of Strings as items and Strings as values
 
Method Summary
 void add(Item item, Value value)
           
 Item getItem(int n)
           
 Value getValue(int n)
           
 Value getValue(Item item)
           
 java.util.List items()
           
 java.lang.String itemString()
           
 int nrOfValues(Value val)
           
 double proportionValue(Value val)
          return the proportion of the Value val assigned to an Item in this classification
 void show()
          prints items and values each on a line on SO
 int size()
           
 java.util.List valueList()
           
 java.util.List values()
           
 java.lang.String valueString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

items

public java.util.List items

values

public java.util.List values

name

public java.lang.String name
Constructor Detail

Classification

public Classification(java.lang.String name)
make empty Classification with a given name

Parameters:
name - the name of this data

Classification

public Classification(java.lang.String name,
                      java.lang.String[] items,
                      java.lang.String[] values)
makes a Classification with StringItems and StringValues from two equal length arrays of Strings as items and Strings as values

Parameters:
name - of this classification
items - and values must be equally long and not null
Method Detail

getItem

public Item getItem(int n)

getValue

public Value getValue(int n)

getValue

public Value getValue(Item item)
Returns:
the Value for the given Item

add

public void add(Item item,
                Value value)

size

public int size()
Returns:
number of pairs in this Classification

values

public java.util.List values()
Returns:
the List of values as they have been assigned to the items, in their proper order.

items

public java.util.List items()
Returns:
the List of items

valueString

public java.lang.String valueString()

itemString

public java.lang.String itemString()

nrOfValues

public int nrOfValues(Value val)
Returns:
the number of times Value val is assigned to an Item in this Classification

proportionValue

public double proportionValue(Value val)
return the proportion of the Value val assigned to an Item in this classification

Returns:
nrOfValues(val) / size()

valueList

public java.util.List valueList()
Returns:
the List with the distinct Values that occur in this Classification (each Value once)

show

public void show()
prints items and values each on a line on SO