📄 edgecursor.java
字号:
}
public void moveDimensionCursorBefore(javax.olap.cursor.DimensionCursor before, javax.olap.cursor.DimensionCursor input) throws OLAPException {
dimensionCursor.moveBefore(before, input);
}
public void moveDimensionCursorAfter(javax.olap.cursor.DimensionCursor before, javax.olap.cursor.DimensionCursor input) throws OLAPException {
dimensionCursor.moveAfter(before, input);
}
public void setPageOwner(javax.olap.cursor.CubeCursor input) throws OLAPException {
this.pageOwner = (CubeCursor) input;
}
public javax.olap.cursor.CubeCursor getPageOwner() throws OLAPException {
return pageOwner;
}
public void setOrdinateOwner(javax.olap.cursor.CubeCursor input) throws OLAPException {
this.ordinateOwner = (CubeCursor) input;
}
public javax.olap.cursor.CubeCursor getOrdinateOwner() throws OLAPException {
return ordinateOwner;
}
public void setCurrentSegment(Segment input) throws OLAPException {
throw new UnsupportedOperationException();
}
public Segment getCurrentSegment() throws OLAPException {
throw new UnsupportedOperationException();
}
// -----------------------------------------------------------------------
// RowDataNavigation methods
// -----------------------------------------------------------------------
public boolean next() throws OLAPException {
try {
boolean res = edgeStream.next();
if (!isPage) ordinateOwner.updateSelection( read() );
return res;
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
public boolean previous() throws OLAPException {
try {
int cursorPosition = edgeStream.getCursorPosition();
cursorPosition--;
if (cursorPosition >= 0) {
edgeStream.move(cursorPosition);
if (!isPage) ordinateOwner.updateSelection( read() );
return true;
}
else {
beforeFirst();
return false;
}
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
public boolean relative(int arg0) throws OLAPException {
try {
int cursorPosition = edgeStream.getCursorPosition();
cursorPosition += arg0;
if (cursorPosition >= edgeStream.getVectorsNumber()) {
afterLast();
return false;
}
else if (cursorPosition < 0) {
beforeFirst();
return false;
}
else {
edgeStream.move(cursorPosition);
if (!isPage) ordinateOwner.updateSelection( read() );
return true;
}
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
public boolean isBeforeFirst() throws OLAPException {
return edgeStream.getCursorPosition() < 0;
}
public boolean isAfterLast() throws OLAPException {
try {
return edgeStream.getCursorPosition() >= edgeStream.getVectorsNumber();
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
public void beforeFirst() throws OLAPException {
try {
edgeStream.reset();
if (!isPage) ordinateOwner.updateSelection( read() );
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
public void afterLast() throws OLAPException {
try {
edgeStream.move(edgeStream.getVectorsNumber()-1);
edgeStream.next();
if (!isPage) ordinateOwner.updateSelection( read() );
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
public boolean isFirst() throws OLAPException {
return edgeStream.getCursorPosition() == 0;
}
public boolean isLast() throws OLAPException {
try {
return edgeStream.getCursorPosition() == edgeStream.getVectorsNumber() - 1;
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
public boolean first() throws OLAPException {
try {
if (edgeStream.getVectorsNumber() > 0) {
edgeStream.move(0);
if (!isPage) ordinateOwner.updateSelection( read() );
return true;
}
else
return false;
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
public boolean last() throws OLAPException {
try {
if (edgeStream.getVectorsNumber() > 0) {
edgeStream.move(edgeStream.getVectorsNumber()-1);
if (!isPage) ordinateOwner.updateSelection( read() );
return true;
}
else
return false;
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
public void setPosition(long position) throws OLAPException {
try {
edgeStream.move((int)position);
if (!isPage) ordinateOwner.updateSelection( read() );
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
public long getPosition() throws OLAPException {
return edgeStream.getCursorPosition();
}
public void close() throws OLAPException {
}
public int getType() throws OLAPException {
throw new UnsupportedOperationException();
}
public int getFetchDirection() throws OLAPException {
throw new UnsupportedOperationException();
}
public void setFetchDirection(int arg0) throws OLAPException {
throw new UnsupportedOperationException();
}
public int getFetchSize() throws OLAPException {
return 0;
}
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 {
throw new UnsupportedOperationException();
}
/**
* Reads mining vector at current cursor position.
*
* @return mining vector at current position, emptyVector if cursor out of range
* @throws OLAPException can't read mining vector
*/
public MiningVector read() throws OLAPException {
try {
if (isBeforeFirst() || isAfterLast())
return emptyVector;
else
return edgeStream.read();
}
catch (MiningException ex) {
throw new OLAPException( ex.toString() );
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -