Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2005-2008 Whirlwind Match Limited. All rights reserved. This is open source software; you can use, redistribute and/or modify it under the terms of the Open Software Licence v 3.0 as published by the Open Source Initiative. You should have received a copy of the Open Software Licence along with this application. if not, contact the Open Source Initiative ( /
package org.fuzzydb.attrs.layout;
	private static IDimensionCodec instance = null;
	public static synchronized IDimensionCodec getInstance() {
		if ( == null) {
		return ;
	public void encode(LayoutAttrMap<IAttributemapint attrIdObject value) {
		IDimensions idim = (IDimensions)value;
		byte dims = (byteidim.getNumDimensions();
		int index = map.getIndexForFloatsWrite(attrIddims);
		// Write in whatever form has been stored as IDimensions (in fact... 
		for (int d = 0; d < dimsd++) {
			map.getFloats()[index + d] = idim.getDimension(d);

Populates an object implementing the IDimensions interface with the appropriate number of floats read from supplied ByteArray

	protected void populateIDimensions(LayoutAttrMap<IAttributemapint indexIDimensions idim) {
		for (int d = 0; d < idim.getNumDimensions(); d++) {
			float floatValue = map.getFloats()[index + d];
	protected boolean consistentForInternal(LayoutAttrMap<IAttributemapint attrIdIAttributeConstraint constraint) {
		int index = map.getIndexQuick(attrId);
		if (constraint instanceof DimensionsNodeSelector){
			return dns.consistentmap.getFloats(), index );
		return drc.consistentmap.getFloats(), index );
New to GrepCode? Check out our FAQ X