class AnnotationBorder
{
    float[] dashArray = null;
    boolean underline = false;
    float width = 0;

    // return border info. BorderStyle must be provided as parameter because
    // method is not available in the base class
    static AnnotationBorder getAnnotationBorder(PDAnnotation annotation,
            PDBorderStyleDictionary borderStyle)
    {<FILL_FUNCTION_BODY>}
}

        AnnotationBorder ab = new AnnotationBorder();
        if (borderStyle == null)
        {
            COSArray border = annotation.getBorder();
            if (border.size() >= 3 && border.getObject(2) instanceof COSNumber)
            {
                ab.width = ((COSNumber) border.getObject(2)).floatValue();
            }
            if (border.size() > 3)
            {
                COSBase base3 = border.getObject(3);
                if (base3 instanceof COSArray)
                {
                    ab.dashArray = ((COSArray) base3).toFloatArray();
                }
            }
        }
        else
        {
            ab.width = borderStyle.getWidth();
            if (borderStyle.getStyle().equals(PDBorderStyleDictionary.STYLE_DASHED))
            {
                ab.dashArray = borderStyle.getDashStyle().getDashArray();
            }
            if (borderStyle.getStyle().equals(PDBorderStyleDictionary.STYLE_UNDERLINE))
            {
                ab.underline = true;
            }
        }
        if (ab.dashArray != null)
        {
            boolean allZero = true;
            for (float f : ab.dashArray)
            {
                if (Float.compare(f, 0) != 0)
                {
                    allZero = false;
                    break;
                }
            }
            if (allZero)
            {
                ab.dashArray = null;
            }
        }
        return ab;
    
<no_super_class>