Exemple #1
0
 /**
  * 与えられた軸を持つ場合true、持たない場合falseを戻す。
  *
  * @param oAxis 軸をあらわすオブジェクト
  * @return 軸を持つかどうか
  */
 public boolean hasThisAxis(Axis oAxis) {
   if (oAxis == null) {
     return false;
   }
   Iterator<Axis> it = this.getAxisList().iterator();
   while (it.hasNext()) {
     Axis axis = it.next();
     if (axis.getId().equals(oAxis.getId())) {
       return true;
     }
   }
   return false;
 }
Exemple #2
0
 /**
  * 与えられた軸のエッジにおけるインデックスを求める。 与えられた軸がエッジにない場合は、-1を戻す。
  *
  * @param oAxis 軸をあらわすオブジェクト
  * @return 軸のエッジにおけるインデックス
  */
 public int getAxisIndexInEdge(Axis oAxis) {
   if (oAxis == null) {
     return -1;
   }
   Iterator<Axis> it = this.getAxisList().iterator();
   int i = 0;
   while (it.hasNext()) {
     Axis axis = it.next();
     if (axis.getId().equals(oAxis.getId())) {
       return i;
     }
     i++;
   }
   return -1;
 }
Exemple #3
0
  /**
   * 与えられた軸のエッジ内における次段以降に配置された軸のメンバー数の積を求める。 (セレクタで除外されているものは含まない)
   * ディメンションの持つメンバーリストは一時的に使用される情報であることに注意。
   *
   * @param axis 軸をあらわすオブジェクト
   * @return メンバー数
   */
  public Integer getNextAxesMembersComboNums(Axis axis) {
    if (axis == null) {
      throw new IllegalArgumentException();
    }
    if (this.hasThisAxis(axis) == false) {
      throw new IllegalArgumentException();
    }
    Iterator<Axis> it = this.getAxisList().iterator();
    int i = 0;
    while (it.hasNext()) {
      Axis tmpAxis = it.next();
      if (axis.getId().equals(tmpAxis.getId())) {
        if (i == (this.getAxisList().size() - 1)) { // 最終段が指定された場合
          return null;
        } else {

          // System.out.println("nextAxis:" + nextAxis.getName());
          int nextAxesComboNums = 1;
          while (it.hasNext()) {
            Axis nextAxis = (Axis) it.next();

            if (nextAxis.isUsedSelecter()) { // セレクタによる絞込み中
              Iterator<AxisMember> nextAxisMemIt = nextAxis.getAxisMemberList().iterator();
              int count = 0;
              while (nextAxisMemIt.hasNext()) {
                AxisMember axisMember = nextAxisMemIt.next();
                if (axisMember.isSelected()) {
                  count++;
                }
              }
              nextAxesComboNums = nextAxesComboNums * count;
            } else { // セレクタによる絞込み中ではない

              nextAxesComboNums = nextAxesComboNums * nextAxis.getAxisMemberList().size();
            }
          }

          return new Integer(nextAxesComboNums);
        }
      }
      i++;
    }
    return null;
  }
Exemple #4
0
  /**
   * エッジ内の与えられた軸より前に配置された軸のメンバー数の積を求める。 (セレクタで除外されているものは含まない) ディメンションの持つメンバリストは一時的に使用される情報であることに注意。
   *
   * @param axis 軸をあらわすオブジェクト
   * @return メンバー数
   */
  public Integer getBeforeAxesMembersComboNums(Axis axis) {
    if (axis == null) {
      throw new IllegalArgumentException();
    }
    if (this.hasThisAxis(axis) == false) {
      throw new IllegalArgumentException();
    }
    Iterator<Axis> it = this.getAxisList().iterator();
    ArrayList<Axis> beforeAxisList = new ArrayList<Axis>();
    while (it.hasNext()) {
      Axis tmpAxis = it.next();
      if (axis.getId().equals(tmpAxis.getId())) {
        if (beforeAxisList.size() == 0) { // 0段目が指定された場合
          return null;
        } else {
          int beforeAxesComboNums = 1;

          Iterator<Axis> beforeAxisIt = beforeAxisList.iterator();
          while (beforeAxisIt.hasNext()) {
            Axis beforeAxis = beforeAxisIt.next();
            if (beforeAxis.isUsedSelecter()) { // セレクタによる絞込み中
              Iterator<AxisMember> beforeAxisMemIt = beforeAxis.getAxisMemberList().iterator();
              int count = 0;
              while (beforeAxisMemIt.hasNext()) {
                AxisMember axisMember = beforeAxisMemIt.next();
                if (axisMember.isSelected()) {
                  count++;
                }
              }
              beforeAxesComboNums = beforeAxesComboNums * count;

            } else { // セレクタによる絞込み中ではない
              beforeAxesComboNums = beforeAxesComboNums * beforeAxis.getAxisMemberList().size();
            }
          }
          return new Integer(beforeAxesComboNums);
        }
      }
      beforeAxisList.add(tmpAxis);
    }
    return null;
  }