Example usage for java.lang Integer MAX_VALUE

List of usage examples for java.lang Integer MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Integer MAX_VALUE.

Prototype

int MAX_VALUE

To view the source code for java.lang Integer MAX_VALUE.

Click Source Link

Document

A constant holding the maximum value an int can have, 231-1.

Usage

From source file:com.dbschools.music.ClientSession.java

public ClientSession(User user, String databaseName) {
    this.user = user;
    this.databaseName = databaseName;
    sessionId = (int) (Math.random() * Integer.MAX_VALUE);
}

From source file:BezLab.java

public void mousePressed(MouseEvent e) {
    dragIndex = NOT_DRAGGING;/*w  ww. j  ava  2s . c o m*/
    int minDistance = Integer.MAX_VALUE;
    int indexOfClosestPoint = -1;
    for (int i = 0; i < 4; i++) {
        int deltaX = xs[i] - e.getX();
        int deltaY = ys[i] - e.getY();
        int distance = (int) (Math.sqrt(deltaX * deltaX + deltaY * deltaY));
        if (distance < minDistance) {
            minDistance = distance;
            indexOfClosestPoint = i;
        }
    }
    if (minDistance > NEIGHBORHOOD)
        return;

    dragIndex = indexOfClosestPoint;
}

From source file:org.fcrepo.client.integration.AbstractResourceIT.java

protected AbstractResourceIT() {
    connectionManager.setMaxTotal(Integer.MAX_VALUE);
    connectionManager.setDefaultMaxPerRoute(20);
    connectionManager.closeIdleConnections(3, TimeUnit.SECONDS);
}

From source file:grails.plugin.cache.web.filter.redis.RedisPageFragmentCachingFilter.java

@Override
protected int getTimeToLive(ValueWrapper wrapper) {
    // ttl not supported
    return Integer.MAX_VALUE;
}

From source file:com.machinelinking.storage.elasticsearch.ElasticJSONStorageTest.java

@Test
public void testAddGetRemove() throws JSONStorageConnectionException {
    final ElasticJSONStorage storage = createStorage();
    final ElasticJSONStorageConnection connection = storage.openConnection(TEST_COLLECTION);

    final int id = Integer.MAX_VALUE;
    final String uuid = UUID.randomUUID().toString();
    final String KEY = "rand_uuid";
    final Map<String, Object> wData = new HashMap<>();
    wData.put(KEY, uuid);/*from w ww . ja va  2s . c  om*/

    connection.addDocument(new ElasticDocument(id, 1, "test_rw", wData));
    connection.flush();

    final Map<String, Object> rData = connection.getDocument(id).getContent();
    Assert.assertEquals(rData.get(KEY).toString(), uuid);

    connection.removeDocument(id);
    Assert.assertNull(connection.getDocument(id));
}

From source file:com.itemanalysis.psychometrics.scaling.PercentileRank.java

public PercentileRank() {
    this(Integer.MIN_VALUE, Integer.MAX_VALUE);
}

From source file:com.devnexus.ting.config.DevelopmentConfig.java

@Bean
@Profile({ SpringProfile.DEVELOPMENT_ENABLED })
public FilterRegistrationBean configureWroFilter() {
    final FilterRegistrationBean registrationBean = new FilterRegistrationBean();

    registrationBean.setFilter(filter);/*w ww .  jav a 2  s. co m*/
    registrationBean.addUrlPatterns("/wro/*");
    registrationBean.setOrder(Integer.MAX_VALUE);
    return registrationBean;
}

From source file:controllers.SvnApp.java

@With(BasicAuthAction.class)
@BodyParser.Of(value = BodyParser.Raw.class, maxLength = Integer.MAX_VALUE)
public static Result service() throws ServletException, IOException, InterruptedException {
    String path;//  www.  j a  va2s  .com
    try {
        path = new java.net.URI(request().uri()).getPath();
    } catch (URISyntaxException e) {
        return badRequest();
    }

    // Remove contextPath
    path = StringUtils.removeStart(path, play.Configuration.root().getString("application.context"));

    // If the url starts with slash, remove the slash.
    if (path.startsWith("/")) {
        path = path.substring(1);
    }

    // Split the url into three segments: "svn", userName, pathInfo
    String[] segments = path.split("/", 3);
    if (segments.length < 3) {
        return forbidden();
    }

    // Get userName and pathInfo from path segments.
    final String userName = segments[1];
    String pathInfo = segments[2];

    // Get projectName from the pathInfo.
    String projectName = pathInfo.split("/", 2)[0];

    // if user is anon, currentUser is null
    User currentUser = UserApp.currentUser();
    // Check the user has a permission to access this repository.
    Project project = Project.findByOwnerAndProjectName(userName, projectName);

    if (project == null) {
        return notFound();
    }

    if (!project.vcs.equals(RepositoryService.VCS_SUBVERSION)) {
        return notFound();
    }

    PlayRepository repository = RepositoryService.getRepository(project);
    if (!AccessControl.isAllowed(currentUser, repository.asResource(),
            getRequestedOperation(request().method()))) {
        if (currentUser.isAnonymous()) {
            return BasicAuthAction.unauthorized(response());
        } else {
            return forbidden("You have no permission to access this repository.");
        }
    }

    // Start DAV Service
    PlayServletResponse response = startDavService(userName, pathInfo);

    // Wait until the status code is decided by the DAV service.
    // After that, get the status code.
    int status = response.waitAndGetStatus();

    // Send the response.
    UserApp.currentUser().visits(project);
    return sendResponse(request().method(), status, response.getInputStream());
}

From source file:Main.java

private static int selectSize(final int width, final int[] widths, final boolean forceLarger) {
    int previousBucketWidth = 0;

    for (int i = 0; i < widths.length; i++) {
        final int currentBucketWidth = widths[i];

        if (width < currentBucketWidth) {
            if (forceLarger || previousBucketWidth != 0) {
                // We're in between this and the previous bucket
                final int bucketDiff = currentBucketWidth - previousBucketWidth;
                if (width < previousBucketWidth + (bucketDiff / 2)) {
                    return previousBucketWidth;
                } else {
                    return currentBucketWidth;
                }//  w ww.  j a  v  a 2 s .  com
            } else {
                return currentBucketWidth;
            }
        } else if (i == widths.length - 1) {
            // If we get here then we're larger than a bucket
            if (width < currentBucketWidth * 2) {
                return currentBucketWidth;
            }
        }

        previousBucketWidth = currentBucketWidth;
    }
    return Integer.MAX_VALUE;
}

From source file:com.microsoft.office365.meetingmgr.HttpHelper.java

public <TResult> PagedResult<TResult> getPagedItems(String uri, Class<TResult> clazz) {
    return doGetItems(uri, Integer.MAX_VALUE, 1, clazz);
}