org.eclipse.emf.emfstore.internal.server.model.versioning.impl.persistent
Class OperationEmitter

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.server.model.versioning.impl.persistent.OperationEmitter
All Implemented Interfaces:
Closeable

public class OperationEmitter
extends Object
implements Closeable

Type for emitting AbstractOperations when given an ReadLineCapable type.

Author:
emueller

Constructor Summary
OperationEmitter(Direction direction, File file)
          Constructor.
 
Method Summary
 void close()
          Closes the emitter.
 long getOffset()
          Returns the current offset.
 com.google.common.base.Optional<AbstractOperation> tryEmit()
          Tries to parse an operation in the reading directions and emits it, if parsing has been successful.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationEmitter

public OperationEmitter(Direction direction,
                        File file)
Constructor.

Parameters:
direction - the Direction that is used for reading
file - the operation file
Method Detail

getOffset

public long getOffset()
Returns the current offset.

Returns:
the current offset

tryEmit

public com.google.common.base.Optional<AbstractOperation> tryEmit()
                                                           throws IOException
Tries to parse an operation in the reading directions and emits it, if parsing has been successful.

Returns:
the successfully parsed operation
Throws:
IOException - in case reading from the ReadLineCapable fails

close

public void close()
Closes the emitter.

Specified by:
close in interface Closeable


Copyright © 2016. All Rights Reserved.