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 (www.opensource.org) /
package org.fuzzydb.attrs.layout;
public class FloatConstraintCodec extends LayoutConstraintCodec {
    private static final int FLOAT_MIN_VALUE_OFFSET = 0; // length length
    private static final int FLOAT_MAX_VALUE_OFFSET = 1;
    private static final int FLOAT_CONSTRAINT_LENGTH = 2;
	private static FloatConstraintCodec instance = null;
	public static synchronized FloatConstraintCodec getInstance() {
		if ( == null) {
		}
		return ;
	}
	public void encode(LayoutAttrMap<IAttributeConstraintmapint attrIdObject value) {
		int index = map.getIndexForFloatsWrite(attrId);
    	FloatConstraint constraint = (FloatConstraint)value;
		if (constraint.isIncludesNotSpecified()){
		}
		map.getFloats()[index + ] = constraint.getMin();
		map.getFloats()[index + ] = constraint.getMax();
	}
		int index = map.getIndexQuick(attrId);
		boolean inclNS = ((LayoutConstraintMapmap).getIncludesNotSpecified(attrId);
		float min = map.getFloats()[index + ];
		float max = map.getFloats()[index + ];
		return new FloatConstraintattrIdminmaxinclNS );
	}
	protected boolean expandInternal(LayoutConstraintMap mapIAttribute attrint attrId) {
		float v = ((FloatValueattr).getValue();
		int index = map.getIndexQuick(attrId);
		float min = map.getFloats()[index + ];
		if (v < min) {
			map.getFloats()[index + ] = v;
			return true;
		}
		float max = map.getFloats()[index + ];
		if (v > max) {
			map.getFloats()[index + ] = v;
			return true;
		}
		return false;
	}
New to GrepCode? Check out our FAQ X