{
  public boolean matches(Node context)  {    short nodeType = context.getNodeType();    switch (axis)      {      case CHILD:        if (nodeType == Node.ATTRIBUTE_NODE)          {            return false;          }        break;      case ATTRIBUTE:      case NAMESPACE:        if (nodeType != Node.ATTRIBUTE_NODE)          {            return false;          }        break;      case DESCENDANT_OR_SELF:        return true;      default:        return false;      }    int tlen = tests.length;    if (tlen > 0)      {        int pos = getContextPosition(context);        int len = getContextSize(context);        for (int j = 0; j < tlen && len > 0; j++)          {            Test test = tests[j];            if (!test.matches(context, pos, len))              {                return false;              }          }      }    return true;  }