Packages

  • package root
    Definition Classes
    root
  • package o1

    O1Library is a toolkit designed for the course Programming 1 (a.k.a. O1) at Aalto University.

    O1Library is a toolkit designed for the course Programming 1 (a.k.a. O1) at Aalto University. It contains an assortment of tools; most prominently, it provides a framework for simple graphical programming and utilities for playing sound.

    This is the front page of O1Library’s documentation. However, this is probably not the best place to start learning about O1Library as a student. That’s because the relevant content of this library is introduced bit by bit in the chapters of O1’s custom ebook alongside the associated programming concepts and assignments.

    You may still find this documentation useful as a reference. You can also find some optional content here that you may wish to try.

    This front page lists the content available in the top-level package called simply o1. These tools are available with the simple command import o1._ in your Scala programs. Some of them you’ll use a lot; some of them you won’t necessarily need at all.

    The tools listed here are actually implemented in a number of subpackages (o1.gui, o1.sound, etc.); what you see here are just “shortcut aliases” to those actual implementations. The aliases are here to make that convenient import command work and to provide you with this list of links to some of the more commonly used tools in O1Library. The subpackages also contain additional content not listed here.

    O1Library has been developed by Aleksi Lukkarinen and Juha Sorva. Several of the key components in o1.gui and o1.world are built upon Aleksi’s Scala Media Computation Library. Some parts of O1Library draw inspiration from the “teachpacks” of the Racket programming language.

    We are grateful to Riku Autio, Joonatan Honkamaa, Juhani Numminen, Leo Varis, Veera Kahva, and anonymous students for bug reports and fixes. We thank Otto Seppälä for helpful discussions.

    Definition Classes
    root
  • package util

    The package o1.util contains miscellaneous tools that are used internally by some of the given programs in O1 for added convenience.

    The package o1.util contains miscellaneous tools that are used internally by some of the given programs in O1 for added convenience.

    NOTE TO STUDENTS: In this course, you don't need to understand how this package works or can be used.

    This documentation lists only some of the tools in the package. The listed tools are largely a mix of:

    • functions for simple I/O from files and URLs;
    • aliases for easy access (via import o1.util._) to some of the tools from scala.util; and
    • implicit classes that add a few convenience methods to selected types from the Scala API.
    Definition Classes
    o1
  • ConvenientCollection
  • ConvenientDouble
  • ConvenientFloat
  • ConvenientInt
  • ConvenientLong
  • ConvenientMap
  • ConvenientOption
  • ConvenientPath
  • ConvenientSeq
c

o1.util

ConvenientInt

implicit final class ConvenientInt extends AnyVal

This class extends the interface of Int with convenience methods.

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConvenientInt
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ConvenientInt(value: Int)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def atLeast(minimum: Int): Int

    num atLeast limit is equivalent to num.max(limit).

  6. def atMost(maximum: Int): Int

    num atMost limit is equivalent to num.min(limit).

  7. def clamp(low: Int, high: Int): Int

    num.clamp(low, high) is equivalent to num.max(low).min(high).

  8. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  9. def isBetween(low: Int, high: Int): Boolean

    Determines if the at least as large as low and less than high.

    Determines if the at least as large as low and less than high. Note that the lower bound is inclusive and the upper bound exclusive.

  10. def isEven: Boolean

    Determines if the integer is divisible by two.

  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. def isOdd: Boolean

    Determines if the integer isn’t divisible by two.

  13. def toString: String
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped