All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.unlaxer.util.collection.Layer Maven / Gradle / Ivy

The newest version!
package org.unlaxer.util.collection;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Layer {//implements List{
	
	final List layers;
	
	final Map layersByKey;

	public Layer() {
		super();
		layers = new ArrayList<>();
		layersByKey = new HashMap<>();
	}

	public Layer addLayer(K key ,V value){
		layersByKey.put(key, value);
		layers.add(value);
		return this;
	}
	
	public V get(K key) {
		return layersByKey.get(key);
	}

	public List values(){
		return layers;
	}
	
	public int size() {
		return layers.size();
	}
	
	public V getByIndex(int index) {
		return layers.get(index);
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy