Example usage for com.badlogic.gdx.utils IntArray peek

List of usage examples for com.badlogic.gdx.utils IntArray peek

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils IntArray peek.

Prototype

public int peek() 

Source Link

Document

Returns the last item.

Usage

From source file:com.kotcrab.vis.editor.proxy.EntityProxy.java

License:Apache License

public int getGroupIdBefore(int gid) {
    IntArray groupIds = getGroupComponent().groupIds;
    int index = groupIds.indexOf(gid) - 1;
    if (gid == -1)
        return groupIds.peek();

    if (index < 0)
        return -1;
    else//from w w w .  ja v  a2s .  c o m
        return groupIds.get(index);
}

From source file:com.kotcrab.vis.editor.proxy.EntityProxy.java

License:Apache License

public int getGroupIdAfter(int gid) {
    IntArray groupIds = getGroupComponent().groupIds;
    int index = groupIds.indexOf(gid) + 1;
    if (gid == -1)
        return groupIds.peek();

    if (index >= groupIds.size)
        return -1;
    else//  w  w w .  ja v a  2 s.  c  o  m
        return groupIds.get(index);
}