This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dojo1_Roman; | |
public class RomanConverter | |
{ | |
public enum Digit | |
{ | |
UNIT, DECIMAL, HUNDRED, THOUSAND | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object ParameterizedType { | |
//class definitions | |
class Pet(val name: String) { | |
override def toString = name | |
} | |
class Dog(override val name: String) extends Pet(name) | |
//covariance example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{"name":"Alang","lat":"19.58268","long":"73.66229","elevationFeet":"4852","elevationMeter":"1479"}, | |
{"name":"Chanderi","lat":"19.06369","long":"73.24495","elevationFeet":"2605","elevationMeter":"794"}, | |
{"name":"Chavand","lat":"19.23500","long":"73.75083","elevationFeet":"3240","elevationMeter":"988"}, | |
{"name":"Dhak","lat":"18.90093","long":"73.40618","elevationFeet":"2326","elevationMeter":"709"}, | |
{"name":"Duke's Nose(Nagphani)","lat":"18.74166","long":"73.35928","elevationFeet":"2648","elevationMeter":"807"}, | |
{"name":"Ghanchakkar","lat":"19.47540","long":"73.75065","elevationFeet":"5037","elevationMeter":"1535"}, | |
{"name":"Hadsar","lat":"19.26806","long":"73.80500","elevationFeet":"4680","elevationMeter":"1426"}, | |
{"name":"HarishchandraGad Balekilla ","lat":"19.39146","long":"73.79377","elevationFeet":"4560","elevationMeter":"1390"}, | |
{"name":"HarishchandraGadTaramati Summit","lat":"19.38685","long":"73.77917","elevationFeet":"4695","elevationMeter":"1431"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ########################################################### | |
// | |
// Demonstrates how to supervise an Akka consumer actor. | |
// | |
// The consumer consumes messages from a file endpoint: | |
// - successful message processing by the consumer will | |
// positively acknowledge the message receipt, causing | |
// the file endpoint to delete the file. | |
// - an exception during message processing will cause a | |
// supervisor to restart the consumer. Before restart, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsingTraits | |
//refer notes 1,2,3 | |
trait Friend{ | |
val name:String | |
def listen()=println("Your friend "+name+" is listening") | |
} | |
class Human(val name:String) extends Friend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.chapter7.traits | |
class DecoratorTraits | |
abstract class Check { | |
def check():String ="Checked application details" | |
} | |
trait employmentCheck extends Check { | |
override def check():String="Checked employment details " +super.check() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configurable | |
@Aspect | |
public class LoggingInterceptor | |
{ | |
Log log = LogFactory.getLog(LoggingInterceptor.class); | |
@Autowired | |
private AuditData auditData; | |
@Around("execution(* *(..)) && @annotation(com.xyz.portal.util.audit.Auditable)") | |
public Object profile(ProceedingJoinPoint pjp) throws Throwable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Documented | |
@Retention(value = RetentionPolicy.RUNTIME) | |
@Target(value ={ ElementType.METHOD }) | |
public @interface Auditable | |
{ | |
String operation(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Auditable(operation = "Save/Update Login Configuration") | |
public void save(Config loginConfig) | |
{ | |
logger.debug("saving Login Config for terminalId=" + loginConfig.getTerminalId()); | |
getSession().merge(loginConfig); | |
getSession().flush(); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object MapTests extends Application { | |
override def main(args: Array[String]) { | |
//reference http://www.scala-lang.org/api/current/scala/collection/immutable/Map.html | |
val worldCupWinners = Map(1975 -> "West Indies", | |
1979 -> "West Indies", | |
1983 -> "India", | |
1987 -> "Australia", | |
1992 -> "Pakistan", | |
1996 -> "Sri Lanka", | |
1999 -> "Australia", |
OlderNewer