Skip to content
tshuenhau edited this page Mar 13, 2021 · 9 revisions

NUS CS2030 AY2020/21 Semester 2

Welcome to the Wiki Page of CS2030 Programming Methodology!

Introduction

What do I do here?

Well, the main reason for the creation of this website is to facilitate Peer Learning.

We hope to make CS2030 a more collaborative environment for CS2030 Students to learn from one another.

How can I contribute?

There are 3 parts of the Peer Learning Component, which takes up a certain percentage of your entire CS2030 Grade.

They are:

  • 🗨️ Discussions done on our Github Forum
  • 📖 Contribution to Github Wikis

Setting Up For CS2030

Do follow these steps in the following order

For Windows Users:

  1. Setting Up Unix

  2. Setting Up Java

  3. Setting Up Checkstyle for Files

You can set up Vim on in your Ubuntu environment. Else, you can install it locally by following this guide

For Mac Users:

  1. Setting Up Unix

  2. Setting Up Java

  3. Setting Up Checkstyle for Files

NOTE: It is not necessary to download MacVim unless you require a Graphical User Interface (GUI). If you wish to do so, you can follow this guide here

Miscellaneous Guides

To be able to access your lab nodes from home, you can follow this guide here to be able to set up as such.

Thank you and have a nice day!

ArrayList

Method name Description
add​(int index, E element) Inserts the specified element at the specified position in this list.
add​(E e) Appends the specified element to the end of this list.
clear() Removes all of the elements from this list.
contains​(Object o) Returns true if this list contains the specified element.
get​(int index) Returns the element at the specified position in this list.
indexOf​(Object o) Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
isEmpty() Returns true if this list contains no elements.
remove​(int index) Removes the element at the specified position in this list.
size() Returns the number of elements in this list.

HashMap

Method name Description
put(YourClass key, YourClass value) Adds key to the HashMap with the value value.
clear() Clears the HashMap.
containsKey(Object o) Checks if key o is in the HashMap, based off the object’s equals() method
containsValue(Object o) Checks if value o is in the HashMap, based off the object’s equals() method
isEmpty() Checks if the HashMap is empty
remove(Object o) Removes the entry with key o if it is in the HashMap, based off the object’s equals() method
size() Returns the number of elements in the HashMap
entrySet() Returns a set of all entries in the HashMap
keySet() Returns a set of all keys in the HashMap
values() Returns a collection of all values in the HashMap

Predicate

Method name Description
test(T t) Evaluates this predicate on the given argument. Returns true if the input argument matches the predicate, otherwise false
and(Predicate<? super T> other) Returns a composed predicate that represents a short-circuiting logical AND of this predicate and another.
negate() Returns a predicate that represents the logical negation of this predicate.
or(Predicate<? super T> other) Returns a composed predicate that represents a short-circuiting logical OR of this predicate and another.
isEqual(Object targetRef) Returns a predicate that tests if two arguments are equal according to Objects.equals(Object, Object).

Function

Method name Description
apply(T t) Applies this function to the given argument.
compose(Function<? super V,? extends T> before) Returns a composed function that first applies the before function to its input, and then applies this function to the result.
andThen(Function<? super R,? extends V> after) Returns a composed function that first applies this function to its input, and then applies the after function to the result.
identity() Returns a function that always returns its input argument.

Consumer

Method name Description
accept(T t) Performs this operation on the given argument.
andThen(Consumer<? super T> after) Returns a composed Consumer that performs, in sequence, this operation followed by the after operation.