01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: RawSingleInput.java,v 1.4.2.2 2008/01/07 15:14:20 cwl Exp $
07: */
08:
09: package com.sleepycat.persist.impl;
10:
11: import java.util.IdentityHashMap;
12:
13: /**
14: * Extends RawAbstractInput to convert array (ObjectArrayFormat and
15: * PrimitiveArrayteKeyFormat) RawObject instances.
16: *
17: * @author Mark Hayes
18: */
19: class RawSingleInput extends RawAbstractInput {
20:
21: private Object singleValue;
22: private Format declaredFormat;
23:
24: RawSingleInput(Catalog catalog, boolean rawAccess,
25: IdentityHashMap converted, Object singleValue,
26: Format declaredFormat) {
27: super (catalog, rawAccess, converted);
28: this .singleValue = singleValue;
29: this .declaredFormat = declaredFormat;
30: }
31:
32: @Override
33: Object readNext() {
34: return checkAndConvert(singleValue, declaredFormat);
35: }
36: }
|