DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.standards.asn
Class GradeRangeHelper

java.lang.Object
  extended by org.dlese.dpc.schemedit.standards.asn.GradeRangeHelper
Direct Known Subclasses:
NsdlGradeRangeHelper

public class GradeRangeHelper
extends Object

Helper to translate between controlled vocabs for cataloging grade levels in a particular framework and the numerical grade ranges implied by the vocabs.

Author:
Jonathan Ostwald

Nested Class Summary
 class GradeRangeHelper.GradeRangeItem
          Utility class to associate a gradeRange vocab value with a label suitable for UI, and a range of gradeLevels (min and max)
 
Constructor Summary
GradeRangeHelper()
          Constructor for the GradeRangeHelper read from file at specified path
 
Method Summary
 void addItem(String vocab, int grade)
          Adds a feature to the Item attribute of the GradeRangeHelper object
 void addItem(String vocab, int startGrage, int endGrade)
          Adds a feature to the Item attribute of the GradeRangeHelper object
 void addItem(String vocab, String label, String value, int minGrade, int maxGrade)
          Adds a feature to the Item attribute of the GradeRangeHelper object
 int getEndGrade(String gradeRangeVocab)
          Gets the endGrade of the given gradeRange vocab value.
 int getEndGrade(String[] gradeRangeVocabs)
          Return an integer representing the highest gradeLevel contained in the provided gradeRangeVocab values, or -1 if none are provided
 String getGradeOptionRangeValue(String gradeRangeValue)
          Gets the gradeOptionRangeValue attribute of the GradeRangeHelper object
 GradeRangeHelper.GradeRangeItem getGradeRangeItem(String vocab)
          Gets the gradeRangeItem for the provided vocab value
 String getGradeRangeOptionLabel(String gradeRangeValue)
          Gets the label (for UI purposes) of a gradeRange vocab value.
 Collection getGradeRanges()
          Returns unordered set of GradeRangeVocab values
 int getStartGrade(String gradeRangeVocab)
          * Gets the startGrade of the given gradeRange vocab value.
 int getStartGrade(String[] gradeRangeVocabs)
          Return an integer representing the lowest gradeLevel contained in the provided gradeRangeVocab values, or -1 if none are provided
 void report()
          NOT YET DOCUMENTED
 void showList(List list, String name)
          NOT YET DOCUMENTED
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GradeRangeHelper

public GradeRangeHelper()
Constructor for the GradeRangeHelper read from file at specified path

Method Detail

getGradeRanges

public Collection getGradeRanges()
Returns unordered set of GradeRangeVocab values

Returns:
The gradeRanges value

getGradeRangeItem

public GradeRangeHelper.GradeRangeItem getGradeRangeItem(String vocab)
Gets the gradeRangeItem for the provided vocab value

Parameters:
vocab - a grade range vocab value
Returns:
The gradeRangeItem value or null

getGradeRangeOptionLabel

public String getGradeRangeOptionLabel(String gradeRangeValue)
Gets the label (for UI purposes) of a gradeRange vocab value. E.g., for the value of "DLESE:Primary elementary", the label is "Primary elementary".

Parameters:
gradeRangeValue - NOT YET DOCUMENTED
Returns:
The gradeRangeLabel value

getGradeOptionRangeValue

public String getGradeOptionRangeValue(String gradeRangeValue)
Gets the gradeOptionRangeValue attribute of the GradeRangeHelper object

Parameters:
gradeRangeValue - NOT YET DOCUMENTED
Returns:
The gradeOptionRangeValue value

getStartGrade

public int getStartGrade(String gradeRangeVocab)
* Gets the startGrade of the given gradeRange vocab value. E.g., "DLESE:Primary elementary" would return 0.

Parameters:
gradeRangeVocab - NOT YET DOCUMENTED
Returns:
The startGrade value

getStartGrade

public int getStartGrade(String[] gradeRangeVocabs)
Return an integer representing the lowest gradeLevel contained in the provided gradeRangeVocab values, or -1 if none are provided

Parameters:
gradeRangeVocabs - NOT YET DOCUMENTED
Returns:
The startGrade value

getEndGrade

public int getEndGrade(String gradeRangeVocab)
Gets the endGrade of the given gradeRange vocab value. E.g., "DLESE:Primary elementary" would return 2.

Parameters:
gradeRangeVocab - NOT YET DOCUMENTED
Returns:
The endGrade value

getEndGrade

public int getEndGrade(String[] gradeRangeVocabs)
Return an integer representing the highest gradeLevel contained in the provided gradeRangeVocab values, or -1 if none are provided

Parameters:
gradeRangeVocabs - NOT YET DOCUMENTED
Returns:
The startGrade value

addItem

public void addItem(String vocab,
                    int grade)
Adds a feature to the Item attribute of the GradeRangeHelper object

Parameters:
vocab - The feature to be added to the Item attribute
grade - The feature to be added to the Item attribute

addItem

public void addItem(String vocab,
                    int startGrage,
                    int endGrade)
Adds a feature to the Item attribute of the GradeRangeHelper object

Parameters:
vocab - The feature to be added to the Item attribute
startGrage - The feature to be added to the Item attribute
endGrade - The feature to be added to the Item attribute

addItem

public void addItem(String vocab,
                    String label,
                    String value,
                    int minGrade,
                    int maxGrade)
Adds a feature to the Item attribute of the GradeRangeHelper object

Parameters:
vocab - The feature to be added to the Item attribute
label - The feature to be added to the Item attribute
value - The feature to be added to the Item attribute
minGrade - The feature to be added to the Item attribute
maxGrade - The feature to be added to the Item attribute

report

public void report()
NOT YET DOCUMENTED


showList

public void showList(List list,
                     String name)
NOT YET DOCUMENTED

Parameters:
list - NOT YET DOCUMENTED
name - NOT YET DOCUMENTED

DLESE Tools
v1.6.0