DLESE Tools
v1.6.0

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

java.lang.Object
  extended by org.dlese.dpc.schemedit.standards.asn.GradeRangeHelper
      extended by org.dlese.dpc.schemedit.standards.asn.NsdlGradeRangeHelper

public class NsdlGradeRangeHelper
extends GradeRangeHelper

GradeRangeHelper that accomodates the "nsdlEdLevel" vocabs, which are defined by the nsdl schemas but which are also used by others, including MSP2, res_qual, commcore, etc. The nsdlEdLevel vocab is a flat controlled vocabulary that contains values that are interpreted hierarchically. For example, "Early Elementary" is interpreted as containing "Kindergarten", "Grade 1" and "Grade 2". The problem is, that the metadata editor cannot enforce the implicit hierarchical structure without substantial ....". NOTE: at this point we decided to enforce these semantics in the metadata editor, which might change everything ..... To Be completed!

Author:
Jonathan Ostwald

Nested Class Summary
 class NsdlGradeRangeHelper.GrItemComparator
          NOT YET DOCUMENTED
 
Nested classes/interfaces inherited from class org.dlese.dpc.schemedit.standards.asn.GradeRangeHelper
GradeRangeHelper.GradeRangeItem
 
Constructor Summary
NsdlGradeRangeHelper()
          Constructor for the NsdlGradeRangeHelper read from file at specified path
 
Method Summary
 GradeRange getDerivedGradeRange(String[] gradeRangeVocabs)
          Gets the gradeRange "extents" of a group of gradeRangeVocabs.
 int getEndGrade(String[] gradeRangeVocabs)
          Return an integer representing the highest gradeLevel contained in the provided gradeRangeVocab values, or -1 if none are provided
 int getStartGrade(String[] gradeRangeVocabs)
          Return an integer representing the lowest gradeLevel contained in the provided gradeRangeVocab values, or -1 if none are provided
 List makeSortedGRList(String[] values)
          Create a sorted list of gradeRangeItems using GrItemComparator.
 List pruneSortedGRList(List sorted)
          Removes GradeRangeItems that contain the item in front of them.
 
Methods inherited from class org.dlese.dpc.schemedit.standards.asn.GradeRangeHelper
addItem, addItem, addItem, getEndGrade, getGradeOptionRangeValue, getGradeRangeItem, getGradeRangeOptionLabel, getGradeRanges, getStartGrade, report, showList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NsdlGradeRangeHelper

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

Method Detail

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

Overrides:
getStartGrade in class GradeRangeHelper
Parameters:
gradeRangeVocabs - NOT YET DOCUMENTED
Returns:
The startGrade 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

Overrides:
getEndGrade in class GradeRangeHelper
Parameters:
gradeRangeVocabs - NOT YET DOCUMENTED
Returns:
The startGrade value

makeSortedGRList

public List makeSortedGRList(String[] values)
Create a sorted list of gradeRangeItems using GrItemComparator.

NOTE: gradeRange values that do not have a corresponding GradeRangeItem are ignored.

Parameters:
values - grade range vocab values
Returns:
sorted list of GradeRangeItems

pruneSortedGRList

public List pruneSortedGRList(List sorted)
Removes GradeRangeItems that contain the item in front of them.

Parameters:
sorted - a list of GradeRangeItems sorted by GrItemComparator
Returns:
list of GradeRangeItems with no containing ranges.

getDerivedGradeRange

public GradeRange getDerivedGradeRange(String[] gradeRangeVocabs)
Gets the gradeRange "extents" of a group of gradeRangeVocabs.

Parameters:
gradeRangeVocabs - vocab values selected in an itemDocument
Returns:
the lowest and highest gradeLevels in non-containing gradeRanges.

DLESE Tools
v1.6.0