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

cgta.oscala.extensions.ArrayExtensions.scala Maven / Gradle / Ivy

The newest version!
package cgta.oscala
package extensions


//////////////////////////////////////////////////////////////
// Copyright (c) 2014 Ben Jackman, Jeff Gomberg
// All Rights Reserved
// please contact [email protected] or [email protected]
// for licensing inquiries
// Created by bjackman @ 8/11/14 2:59 AM
//////////////////////////////////////////////////////////////

class ArrayExtensions[A](val xs: Array[A]) extends AnyVal {
  def getOpt(i : Int) : Option[A] = if (i >= 0 && i < xs.length) Some(xs(i)) else None
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy