本文整理汇总了Java中org.apache.cassandra.db.marshal.AbstractCompositeType.CompositeComponent类的典型用法代码示例。如果您正苦于以下问题:Java CompositeComponent类的具体用法?Java CompositeComponent怎么用?Java CompositeComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CompositeComponent类属于org.apache.cassandra.db.marshal.AbstractCompositeType包,在下文中一共展示了CompositeComponent类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: composeComposite
import org.apache.cassandra.db.marshal.AbstractCompositeType.CompositeComponent; //导入依赖的package包/类
/** Deconstructs a composite type to a Tuple. */
protected Tuple composeComposite(AbstractCompositeType comparator, ByteBuffer name) throws IOException
{
List<CompositeComponent> result = comparator.deconstruct(name);
Tuple t = TupleFactory.getInstance().newTuple(result.size());
for (int i=0; i<result.size(); i++)
setTupleValue(t, i, cassandraToObj(result.get(i).comparator, result.get(i).value));
return t;
}
示例2: composeComposite
import org.apache.cassandra.db.marshal.AbstractCompositeType.CompositeComponent; //导入依赖的package包/类
/** Deconstructs a composite type to a Tuple. */
protected Tuple composeComposite(AbstractCompositeType comparator, ByteBuffer name) throws IOException
{
List<CompositeComponent> result = comparator.deconstruct(name);
Tuple t = TupleFactory.getInstance().newTuple(result.size());
for (int i=0; i<result.size(); i++)
setTupleValue(t, i, result.get(i).comparator.compose(result.get(i).value));
return t;
}