Wednesday, October 31, 2018

Java Object and Classes continue

Source File Declaration Rules

These rules are essential when declaring classes, import statements and package statements in a source file.
  • There can be only one public class per source file.
  • A source file can have multiple non-public classes.
  • The public class name should be the name of the source file as well which should be appended by .java at the end. For example: the class name is public class Employee{} then the source file should be as Employee.java.
  • If the class is defined inside a package, then the package statement should be the first statement in the source file.
  • If import statements are present, then they must be written between the package statement and the class declaration. If there are no package statements, then the import statement should be the first line in the source file.
  • Import and package statements will imply to all the classes present in the source file. It is not possible to declare different import and/or package statements to different classes in the source file.
Classes have several access levels and there are different types of classes; abstract classes, final classes, etc. We will be explaining about all these in the access modifiers chapter.
Apart from the above mentioned types of classes, Java also has some special classes called Inner classes and Anonymous classes.

Java Package

In simple words, it is a way of categorizing the classes and interfaces. When developing applications in Java, hundreds of classes and interfaces will be written, therefore categorizing these classes is a must as well as makes life much easier.

Import Statements

In Java if a fully qualified name, which includes the package and the class name is given, then the compiler can easily locate the source code or classes. Import statement is a way of giving the proper location for the compiler to find that particular class.
For example, the following line would ask the compiler to load all the classes available in directory java_installation/java/io −
import java.io.*;

Thursday, October 25, 2018

Java Object and Classes

Java is an Object-Oriented Language. As a language that has the Object-Oriented feature, Java supports the following fundamental concepts −
  • Polymorphism
  • Inheritance
  • Encapsulation
  • Abstraction
  • Classes
  • Objects
  • Instance
  • Method
  • Message Parsing
In this chapter, we will look into the concepts - Classes and Objects.
  • Object − Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behaviors – wagging the tail, barking, eating. An object is an instance of a class.
  • Class − A class can be defined as a template/blueprint that describes the behavior/state that the object of its type support.

Objects in Java

Let us now look deep into what are objects. If we consider the real-world, we can find many objects around us, cars, dogs, humans, etc. All these objects have a state and a behavior.
If we consider a dog, then its state is - name, breed, color, and the behavior is - barking, wagging the tail, running.
If you compare the software object with a real-world object, they have very similar characteristics.
Software objects also have a state and a behavior. A software object's state is stored in fields and behavior is shown via methods.
So in software development, methods operate on the internal state of an object and the object-to-object communication is done via methods.

Classes in Java

A class is a blueprint from which individual objects are created.
Following is a sample of a class.

Example

public class Dog {
   String breed;
   int age;
   String color;

   void barking() {
   }

   void hungry() {
   }

   void sleeping() {
   }
}
A class can contain any of the following variable types.
  • Local variables − Variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and the variable will be destroyed when the method has completed.
  • Instance variables − Instance variables are variables within a class but outside any method. These variables are initialized when the class is instantiated. Instance variables can be accessed from inside any method, constructor or blocks of that particular class.
  • Class variables − Class variables are variables declared within a class, outside any method, with the static keyword.
A class can have any number of methods to access the value of various kinds of methods. In the above example, barking(), hungry() and sleeping() are methods.
Following are some of the important topics that need to be discussed when looking into classes of the Java Language.

Constructors

When discussing about classes, one of the most important sub topic would be constructors. Every class has a constructor. If we do not explicitly write a constructor for a class, the Java compiler builds a default constructor for that class.
Each time a new object is created, at least one constructor will be invoked. The main rule of constructors is that they should have the same name as the class. A class can have more than one constructor.
Following is an example of a constructor −

Example

public class Puppy {
   public Puppy() {
   }

   public Puppy(String name) {
      // This constructor has one parameter, name.
   }
}
Java also supports Singleton Classes where you would be able to create only one instance of a class.
Note − We have two different types of constructors. We are going to discuss constructors in detail in the subsequent chapters.

Creating an Object

As mentioned previously, a class provides the blueprints for objects. So basically, an object is created from a class. In Java, the new keyword is used to create new objects.
There are three steps when creating an object from a class −
  • Declaration − A variable declaration with a variable name with an object type.
  • Instantiation − The 'new' keyword is used to create the object.
  • Initialization − The 'new' keyword is followed by a call to a constructor. This call initializes the new object.
Following is an example of creating an object −
public class Puppy {
   public Puppy(String name) {
      // This constructor has one parameter, name.
      System.out.println("Passed Name is :" + name );
   }

   public static void main(String []args) {
      // Following statement would create an object myPuppy
      Puppy myPuppy = new Puppy( "tommy" );
   }
}

Saturday, October 20, 2018

Java Key words

abstractassertbooleanbreak
bytecasecatchchar
classconstcontinuedefault
dodoubleelseenum
extendsfinalfinallyfloat
forgotoifimplements
importinstanceofintinterface
longnativenewpackage
privateprotectedpublicreturn
shortstaticstrictfpsuper
switchsynchronizedthisthrow
throwstransienttryvoid
volatilewhile
These are the keywords which use to java programming 

Thursday, October 18, 2018

EC04 Application continue

Section 05
Hardware Design

1) Configuration of Bluetooth connection  
2) Hall Effect  
3) Reading sensor data via the connection


Name of the component
Bluetooth Module
Objective of the component
Connection setup between glove and desktop
Input connection
Bluetooth information with device settings
Process in Brief
After powered and processed its connection data by the Arduino processor, the connection/pair request will be produced
Output connection
Connection/pair request
Constraints/ Assumptions if available

  
Name of the component
Hall Sensors
Objective of the component
Hand movements reading and communicating
Input connection
Hall effect caused by the hall sensor movement around a magnetic field.
Process in Brief
Hall effect occurs when the fingers with halls sensors fixed moves around a magnetic field and they will be communicated via Arduino processor to the desktop as coordinate information
Output connection
Coordinates identified
Constraints/ Assumptions if available


Name of the component
Magnet
Objective of the component
Creation of a magnetic field
Input connection
Hall sensor movements around it
Process in Brief
When fingers move, the hall sensors also moves around the magnetic field that is created by the magnet and will produce hall effect
Output connection
Hall readings
Constraints/ Assumptions if available
Magnet should strong enough to produce an electric output that the system needs for further process

Name of the component
Arduino Nano processor
Objective of the component
Processing wireless connection configuration requests and responses, empowers the hall effect and communicate its outputs with the system and facilitate to identify finger movements as discrete coordinate values
Input connection
Voltage supplied by the 9V battery
Process in Brief
Powered by the voltage supply, processor will develop the wireless connection/pair request after considering the Bluetooth module information directories and will communicate the hall readings to the framework via that developed connection.
Output connection
Connection pairing request, communication of hall readings
Constraints/ Assumptions if available


Name of the component
Tracking Object
Objective of the component
Plots a common point that moves with the finger movements and it will be identified via the tracking object information(color, shape)
Input connection
Hall reading coordinates per a calibration of sensors with each other
Process in Brief
The web cam of the user desktop will track after the object connected with the glove via using the color or the center point.
Output connection
Visualization of single dotted tracking
Constraints/ Assumptions if available
A round object will be easily captured with its center point.

Name of the component
9V magnetic battery connector
Objective of the component
Provides the required voltage/power supply to the processing of glove
Input connection
Voltage supply from 9v battery
Process in Brief
Continuously provides the voltage while the Arduino processor is switched on for its entire processing
Output connection
Voltage supply for glove circuitry
Constraints/ Assumptions if available
9V  connector is needed

Name of the component
Connection Wires
Objective of the component
Provision of the continuous communication flow within the glove
Input connection
Electric pulses with essential and relevant data in order to build intended interaction among components of glove
Process in Brief
Connect the components that make up the hand glove circuitry in organized and meaningful manner
Output connection
Interconnection of hand glove components
Constraints/ Assumptions if available
Different colored connectors will be used to identify each of them separately


EC04 Application continue

Section 04
Research Design



Name of the workflow unit or component
User Desktop /Framework
Objective of the workflow unit or component
Provides the background resources, data and function libraries and interfaces to all the connections and data communications.
Input
Bluetooth connection request
Process in Brief
Processing of the Bluetooth pairing request is sent by the Bluetooth module of the glove
Output
Accepting request and authenticating the wireless connection between the hand glove and   user desktop
Business rules/ constraints/ Assumptions if available
Bluetooth and web cam facilitated user desktop should be used

Name of the workflow unit or component
Bluetooth Module
Objective of the workflow unit or component
Configuration of the data communication of glove with the user desktop
Input
Arduino processing command for connection request
Process in Brief
When the Bluetooth module is powered on, the Arduino processor would send a connection request for the user desktop via Bluetooth module.
Output
Connection request/pairing request
Business rules/ constraints/ Assumptions if available
Only HC-05 and HC-06 Bluetooth modules required

Name of the workflow unit or component
Hall Sensors
Objective of the workflow unit or component
Reading the user finger motions
Input
Hall effect caused from finger movement
Process in Brief
Hall effect will be created with the motion of fingers(hall sensors) around the magnet
Output
Electric pulse containing data for coordinate position information
Business rules/ constraints/ Assumptions if available
A3144 model of hall sensors required
  
Name of the workflow unit or component
Arduino Processor
Objective of the workflow unit or component
Processing the wireless connection and hall effect readings and communicating them
Input
Hall sensor readings
Process in Brief
Read the hall sensor data and processing them into a fine secondary input to be entered in to the software framework.
Output
Secondary digital output of hall readings
Business rules/ constraints/ Assumptions
Arduino Nano board is required

Name of the workflow unit or component
User Database
Objective of the workflow unit or component
Act as a repository that maintains and manages the user profile information, framework functions and their states
Input
User authentication and profile data
Process in Brief
It will update and enter the user information and their activities itself, each time the user completes an action.
Output
Data portions with standard defined constraints of their accessibility
Business rules/ constraints/ Assumptions if available


Name of the workflow unit or component
Framework libraries
Objective of the workflow unit or component
Provides the reusability of data directories for all possible functions
Input
Hall readings coordinate information
Process in Brief
Stores reusable data directories with constraints
Output
Framework libraries
Business rules/ constraints/ Assumptions if available
Abstract framework libraries

Name of the workflow unit or component
User Profile
Objective of the workflow unit or component
Maintains user integrity and confidentiality
Input
User authentication details
Process in Brief
Request for several data to be provided by the user prior to user authentication
Output
Distinct user profiles with authentication and authorization information
Business rules/ constraints/ Assumptions if available
Different users should be maintained via different user accounts

Name of the workflow unit or component
Authenticator
Objective of the workflow unit or component
Allowing a user or a connection to communicate with the system
Input
Authentication details
Process in Brief
Checks for the validity and compatibility of the entered request data with the stored values and decides how to respond the request
Output
Authentication of user
Business rules/ constraints/ Assumptions if available
Distinct users should have distinct authentication data, agreed by the system constraints.

Name of the workflow unit or component
Level Selector
Objective of the workflow unit or component
Identify the levels completed
Input
Selection of a level by user
Process in Brief
When user selects a particular level, the accessibility will be provided after considering the sequence of level and activity completion. Reference of the database will be involved to take decisions.
Output
Provision of accessibility to a level
Business rules/ constraints/ Assumptions if available
Predefined number of levels

Name of the workflow unit or component
Activity Selector
Objective of the workflow unit or component
Identify the activities completed within a level
Input
Selection of an activity by user
Process in Brief
When user selects a particular activity within a level, the sequence of activity completion will be checked and then will grant the permission response
Output
Provision of accessibility to an activity
Business rules/ constraints/ Assumptions
Predefined number of activities per each level

Name of the workflow unit or component
Evaluator
Objective of the workflow unit or component
Evaluating the user performance for each activity
Input
User performed activity
Process in Brief
Compares the coordinate values and their sequence and pattern of combination, developed by the user, along with the standard set of coordinate values identified for that activity
Output
Performance evaluation as both a percentage and a feedback
Business rules/ constraints/ Assumptions if available
Evaluator process will be based on stored sequence of coordinate values, categorized and built in for reference.

Name of the workflow unit or component
Hologram like structure
Objective of the workflow unit or component
Emerging 3D platform
Input
Visual output of user desktop for the system
Process in Brief
Visual outputs in 2D from will be sent through hologram and will emerge in 3D platform
Output
3d visualization of system
Business rules/ constraints/ Assumptions if available
Specifications will be applied with the glass types used for hologram
  

How our entire system works