⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dimensioncursor.java

📁 一个数据挖掘软件ALPHAMINERR的整个过程的JAVA版源代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
  public void setFetchSize(int arg0) throws OLAPException {

  }

  public void clearWarnings() throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public void getWarnings() throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public long getExtent() throws OLAPException {

     return extents[leftNr];
  }

  protected int[] getExtents() {

    return extents;
  }

  protected void setExtents(int[] extents) throws OLAPException{

    this.extents = extents;
  }

  protected int getLeftNr() {

    return leftNr;
  }

  protected void setLeftNr(int leftNr) {

    this.leftNr = leftNr;
  }

  // -----------------------------------------------------------------------
  //  RowDataAccessor methods
  // -----------------------------------------------------------------------
  public InputStream getAsciiStream(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public InputStream getAsciiStream(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public BigDecimal getBigDecimal(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public BigDecimal getBigDecimal(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public InputStream getBinaryStream(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public InputStream getBinaryStream(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Blob getBlob(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Blob getBlob(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public boolean getBoolean(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public boolean getBoolean(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public byte getByte(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public byte getByte(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public byte[] getBytes(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public byte[] getBytes(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Reader getCharacterStream(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Reader getCharacterStream(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Clob getClob(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Clob getClob(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public void getDate(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public void getDate(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public void getDate(int arg0, Calendar arg1) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public void getDate(String arg0, Calendar arg1) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public javax.olap.cursor.RowDataMetaData getMetaData() throws OLAPException {

    try {
      int nAtt          = attIndexes.length;
      String[] attNames = new String[nAtt];
      int[] attTypes    = new int[nAtt];
      MiningDataSpecification metaData = edgeCursor.edgeStream.getMetaData();
      for (int i = 0; i < nAtt; i++) {
        MiningAttribute ma = metaData.getMiningAttribute(attIndexes[i]);
        attNames[i] = ma.getName();
        if (ma instanceof CategoricalAttribute) attTypes[i] = 1;
      };
      return new RowDataMetaData(nAtt, attNames, attTypes);
    }
    catch (MiningException ex) {
      throw new OLAPException( ex.toString() );
    }
  }

  public double getDouble(int arg0) throws OLAPException {

    ObjectValue ov = getValue(arg0);
    return ov.getValue();
  }

  public double getDouble(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public float getFloat(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public float getFloat(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public int getInt(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public int getInt(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public long getLong(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public long getLong(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Object getObject(int arg0) throws OLAPException {

    ObjectValue ov = getValue(arg0);
    if ( ov.isCategory() )
      return ov.getCategory();
    else
      return new Double( ov.getValue() );
  }

  public Object getObject(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Object getObject(int arg0, Map arg1) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Object getObject(String arg0, Map arg1) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public short getShort(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public short getShort(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public String getString(int arg0) throws OLAPException {

    ObjectValue ov = getValue(arg0);
    if ( ov.isCategory() )
      return ov.getCategory().getDisplayValue();
    else
      return String.valueOf( ov.getValue() );
  }

  public String getString(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Time getTime(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Time getTime(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Time getTime(int arg0, Calendar arg1) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Time getTime(String arg0, Calendar arg1) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Timestamp getTimestamp(int arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Timestamp getTimestamp(String arg0) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Timestamp getTimestamp(int arg0, Calendar arg1) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  public Timestamp getTimestamp(String arg0, Calendar arg1) throws OLAPException {
          throw new UnsupportedOperationException();
  }

  /**
   * Returns value at specified position.
   *
   * @param arg0 position from 1, ..., nAtt.
   * @return value holder object
   * @throws OLAPException cannot get value
   */
  protected ObjectValue getValue(int arg0) throws OLAPException {

    int nAtt = attIndexes.length;
    if (arg0 == 0)
      throw new OLAPException("argument " + arg0 + " must be positive");
    if (arg0 > nAtt)
      throw new OLAPException("argument " + arg0 + " > " + nAtt);

    MiningVector mv = edgeCursor.read();
    double value    = mv.getValue(attIndexes[arg0-1]);
    if ( Category.isMissingValue(value) )
      throw new OLAPException("cursor out of bounds");
    MiningDataSpecification metaData = mv.getMetaData();
    MiningAttribute ma = metaData.getMiningAttribute(attIndexes[arg0-1]);
    Category cat = null;
    if (ma instanceof CategoricalAttribute)
      cat = ((CategoricalAttribute)ma).getCategory(value);

    return new ObjectValue(value, cat);
  }

/**
 * Class for value holder that may be either a numeric value or a category.
 * In case of category, the numeric value is the key of the category.
 */
private class ObjectValue {

    private double value = Category.MISSING_VALUE;
    private Category cat = null;
    private boolean isCategory = false;

    ObjectValue(double value, Category cat) {
      this.value = value;
      this.cat   = cat;
      if (cat != null) isCategory = true;
    }

    double getValue() { return value; }
    Category getCategory() { return cat; }
    boolean isCategory() { return isCategory; }
}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -