Here you can find the source of clampLevel(float level)
public static float clampLevel(float level)
//package com.java2s; //License from project: Open Source License public class Main { private static final float UPPER_CLAMP_LIMIT = 0.95f; private static final float UPPER_CLAMP_VALUE = 1.0f; private static final float LOWER_CLAMP_LIMIT = 0.05f; public static final float LOWER_CLAMP_VALUE = 0.05f; public static float clampLevel(float level) { if (level <= LOWER_CLAMP_LIMIT) return LOWER_CLAMP_VALUE; if (level >= UPPER_CLAMP_LIMIT) return UPPER_CLAMP_VALUE; return level; }/*w w w .j av a 2 s. c o m*/ }