/** * Creates a new phase for this AVL tree. * * @throws IOException If and I/O error occurs. */ public Phase() throws IOException { if (currentPhase == null) { rootId = AVLNode.NULL_NODE; nrNodes = 0; } else { rootId = currentPhase.rootId; nrNodes = currentPhase.nrNodes; } avlBlockFilePhase = avlBlockFile.new Phase(); check(); currentPhase = this; }
/** * CONSTRUCTOR Phase TO DO * * @param b PARAMETER TO DO * @param offset PARAMETER TO DO * @throws IOException EXCEPTION TO DO */ Phase(Block b, int offset) throws IOException { avlFilePhase = avlFile.new Phase(b, offset); offset += AVLFile.Phase.RECORD_SIZE; for (int i = 0; i < NR_BLOCK_FILES; ++i) { blockFilePhases[i] = blockFiles[i].new Phase(b, offset); offset += ManagedBlockFile.Phase.RECORD_SIZE; } currentPhase = this; dirty = false; }
/** * CONSTRUCTOR Phase TO DO * * @throws IOException EXCEPTION TO DO */ Phase(Phase p) throws IOException { assert p != null; avlFilePhase = avlFile.new Phase(p.avlFilePhase); for (int i = 0; i < NR_BLOCK_FILES; ++i) { blockFilePhases[i] = blockFiles[i].new Phase( p.blockFilePhases[i] ); } currentPhase = this; dirty = true; }
/** * Constructs a phase, copying another phase. * * @param p The phase to copy. * @throws IOException If an I/O error occurs. */ public Phase(Phase p) throws IOException { assert p != null; rootId = p.rootId; nrNodes = p.nrNodes; avlBlockFilePhase = avlBlockFile.new Phase(p.avlBlockFilePhase); check(); currentPhase = this; }
/** * Construct a phase, copy the phase data found in an existing block. * * @param b The block containing the phase data. * @param offset The offset of the phase data within the block. * @throws IOException If an I/O error occurs. */ public Phase(Block b, int offset) throws IOException { rootId = b.getLong(offset + IDX_ROOT_ID); nrNodes = b.getLong(offset + IDX_NR_NODES); avlBlockFilePhase = avlBlockFile.new Phase(b, offset + HEADER_SIZE); check(); currentPhase = this; }
/** * CONSTRUCTOR Phase TO DO * * @throws IOException EXCEPTION TO DO */ Phase() throws IOException { avlFilePhase = avlFile.new Phase(); for (int i = 0; i < NR_BLOCK_FILES; ++i) { blockFilePhases[i] = blockFiles[i].new Phase(); } currentPhase = this; dirty = true; }