public int compareTo(AttributeLocator o) {
    int		result;
    int		i;
    
    result = 0;
    
    // 1. check type
    if (this.getType() < o.getType()) {
      result = -1;
    }
    else if (this.getType() > o.getType()) {
      result = 1;
    }
    else {
      // 2. check indices
      if (this.getAllowedIndices().length < o.getAllowedIndices().length) {
	result = -1;
      }
      else if (this.getAllowedIndices().length > o.getAllowedIndices().length) {
	result = 1;
      }
      else {
	for (i = 0; i < this.getAllowedIndices().length; i++) {
	  if (this.getAllowedIndices()[i] < o.getAllowedIndices()[i]) {
	    result = -1;
	    break;
	  }
	  else if (this.getAllowedIndices()[i] > o.getAllowedIndices()[i]) {
	    result = 1;
	    break;
	  }
	  else {
	    result = 0;
	  }
	}
      }
    }
    
    return result;
  }