com.tc.object.dna.api
Interface DNACursor


public interface DNACursor

A ResultSet-like interface for iterating over the fields of a DNA strand. Generally the set of actions to cursor over consist of either all logical or all physical depending on the class.

TODO: Perhaps this could be better integrated into some Class hierarchy.

Author:
orion

Method Summary
 java.lang.Object getAction()
          Return the action at the current cursor location.
 int getActionCount()
          Get total number of actions
 LogicalAction getLogicalAction()
          Get a logical action at the current cursor location.
 PhysicalAction getPhysicalAction()
          Get a physical action at the current cursor location.
 boolean next()
          Move to next action
 boolean next(DNAEncoding encoding)
          Move to next action and use specific encoding
 void reset()
          Reset the cursor
 

Method Detail

getActionCount

int getActionCount()
Get total number of actions

Returns:
Action count

next

boolean next()
             throws java.io.IOException
Move to next action

Returns:
True if there is a next action, false if no more actions
Throws:
java.io.IOException - If an IO error occurs while moving the cursor

next

boolean next(DNAEncoding encoding)
             throws java.io.IOException,
                    java.lang.ClassNotFoundException
Move to next action and use specific encoding

Parameters:
encoding - The DNA encoding
Returns:
True if there is a next action, false if no more actions
Throws:
java.io.IOException - If an IO error occurs while moving the cursor
java.lang.ClassNotFoundException - If a class is not found while deserializing DNA

reset

void reset()
           throws java.lang.UnsupportedOperationException
Reset the cursor

Throws:
java.lang.UnsupportedOperationException - If this cursor implementation does not support reset()

getLogicalAction

LogicalAction getLogicalAction()
Get a logical action at the current cursor location.

Returns:
Logical action

getPhysicalAction

PhysicalAction getPhysicalAction()
Get a physical action at the current cursor location.

Returns:
Physical action

getAction

java.lang.Object getAction()
Return the action at the current cursor location. XXX: This should be removed or cleaned up at some point. It's here to support TreeMap which is treated logically, except for it's "comparator" field which is treated physically

Returns:
LogicalAction, PhysicalAction, or LiteralAction


Copyright © 2010 Terracotta, Inc.. All Rights Reserved.