The document provides an introduction to collections and generics in Java. It discusses key interfaces like Collection, List, Set, and Map. It covers using iterators and comparators with collections. Examples are provided for implementing generic classes and methods as well as binding generic types. The document concludes with a questionnaire to test the reader's understanding.
Presented by Stephen Murtagh, Etsy.com, Inc.
TF-IDF (term frequency, inverse document frequency) is a standard method of weighting query terms for scoring documents, and is the method that is used by default in Solr/Lucene. Unfortunately, TF-IDF is really only a measure of rarity, not quality or usefulness. This means it would give more weight to a useless, rare term, such as a misspelling, than to a more useful, but more common, term.
In this presentation, we will discuss our experiences replacing Lucene's TF-IDF based scoring function with a more useful one using information gain, a standard machine-learning measure that combines frequency and specificity. Information gain is much more expensive to compute, however, so this requires periodically computing the term weights outside of Solr/Lucene and making the results accessible within Solr/Lucene.
Computer Vision using Ruby and libJIT - RubyConf 2009Jan Wedekind
Ruby originated in Japan, the country which is world-leading in robotic research. It suggests itself to put the two together and to start using Ruby as a language to program robots. However at the moment the performance of available Ruby interpreters is not sufficient. It is hard to achieve performance comparable to compiled C++-code since manipulation of Ruby-integers and Ruby-arrays requires frequent bounds-checking. It can be shown that universal bounds-check elimination is actually impossible.
Presented by Stephen Murtagh, Etsy.com, Inc.
TF-IDF (term frequency, inverse document frequency) is a standard method of weighting query terms for scoring documents, and is the method that is used by default in Solr/Lucene. Unfortunately, TF-IDF is really only a measure of rarity, not quality or usefulness. This means it would give more weight to a useless, rare term, such as a misspelling, than to a more useful, but more common, term.
In this presentation, we will discuss our experiences replacing Lucene's TF-IDF based scoring function with a more useful one using information gain, a standard machine-learning measure that combines frequency and specificity. Information gain is much more expensive to compute, however, so this requires periodically computing the term weights outside of Solr/Lucene and making the results accessible within Solr/Lucene.
Computer Vision using Ruby and libJIT - RubyConf 2009Jan Wedekind
Ruby originated in Japan, the country which is world-leading in robotic research. It suggests itself to put the two together and to start using Ruby as a language to program robots. However at the moment the performance of available Ruby interpreters is not sufficient. It is hard to achieve performance comparable to compiled C++-code since manipulation of Ruby-integers and Ruby-arrays requires frequent bounds-checking. It can be shown that universal bounds-check elimination is actually impossible.
Free Monads are a powerful technique that can separate the representation of programs from the messy details of how they get run.
I'll go into the details of how they work, how to use them for fun and profit in your own code, and demonstrate a live Free Monad-driven tank game.
Supporting code at https://github.com/kenbot/free
Understanding the assembly generated by Go programs can help you better understand the language, it's runtime, and how things operate behind the scenes.
Pybelsberg is a project allowing constraint-based programming in Python using the Z3 theorem prover [1].
It is available on Github [2] and is licensed under the BSD 3-Clause License.
By Robert Lehmann, Christoph Matthies, Conrad Calmez, Thomas Hille.
See also Babelsberg/R [4] and Babelsberg/JS [5].
[1] https://github.com/Z3Prover/z3
[2] https://github.com/babelsberg/pybelsberg
[3] http://opensource.org/licenses/BSD-3-Clause
[4] https://github.com/timfel/babelsberg-r
[5] https://github.com/timfel/babelsberg-js
Clips basics how to make expert system in clips | facts adding | rules makin...NaumanMalik30
AOA #CS607 k is tutorials ma meny #clips programming ma ES bnana sikhaya
Facebook: https://web.facebook.com/Nauman1
.Here is my #slideshare #link for downloading slides..
Asssignments k lia facebook link per contact krain
umeed hai ki aapko ye video achi lgi.
Please Share, Support, follow , Subscribe!!! or if u Need help me?
Facebook: https://web.facebook.com/Nauman1
Linkedin : https://bit.ly/2DYFgTg
Download #Artificial_intelligence_slides https://bit.ly/2HTb3dD
Subscribe Nauman Malik channel: https://bit.ly/2t1P3Dd
Cs607 #playlist on Youtube: https://bit.ly/2DNUjQM
Instagram: https://www.instagram.com/nauman_mlik/
Google Plus: https://bit.ly/2MSJq3n
BLOGspot https://naumanai.blogspot.com/
About : Nauman Malik is actually a YouTube Channel, where you will find #University
courses videos #Artificial_intelligence #cs607 #robotic technological videos in Urdu_
Hindi, #keep in touch for your Future #needs So don’t forgot to subscribe :)
Java 8, lambdas, generics: How to survive? - NYC Java Meetup GroupHenri Tremblay
Lambdas are sexy. But they are adding complexity. Mixed with generics, it creates a dangerous cocktail. Together, we will start from the bottom of generics and go straight through lambda inference. To explain why it is the way it is and tell you how to survive.
Generics and Lambdas cocktail explained - Montreal JUGHenri Tremblay
We are in 2015 and Java 8 will slowly but surely become the new standard. Our world will be filled with lambdas. Generics, for themselves, have appeared in 2004. They brought benefits and complexity. Enough to blow up the complexity quota of Java according to Josh Bloch.
But lambdas, whatever are sexy they are, are going to add even more complexity. Mix with generics your now playing with nitroglycerin.
We will travel together through the bottom of the generics, through inference and through lambdas type resolution. To explain why. To provide solutions. To ease Java 8 adoption.
Free Monads are a powerful technique that can separate the representation of programs from the messy details of how they get run.
I'll go into the details of how they work, how to use them for fun and profit in your own code, and demonstrate a live Free Monad-driven tank game.
Supporting code at https://github.com/kenbot/free
Understanding the assembly generated by Go programs can help you better understand the language, it's runtime, and how things operate behind the scenes.
Pybelsberg is a project allowing constraint-based programming in Python using the Z3 theorem prover [1].
It is available on Github [2] and is licensed under the BSD 3-Clause License.
By Robert Lehmann, Christoph Matthies, Conrad Calmez, Thomas Hille.
See also Babelsberg/R [4] and Babelsberg/JS [5].
[1] https://github.com/Z3Prover/z3
[2] https://github.com/babelsberg/pybelsberg
[3] http://opensource.org/licenses/BSD-3-Clause
[4] https://github.com/timfel/babelsberg-r
[5] https://github.com/timfel/babelsberg-js
Clips basics how to make expert system in clips | facts adding | rules makin...NaumanMalik30
AOA #CS607 k is tutorials ma meny #clips programming ma ES bnana sikhaya
Facebook: https://web.facebook.com/Nauman1
.Here is my #slideshare #link for downloading slides..
Asssignments k lia facebook link per contact krain
umeed hai ki aapko ye video achi lgi.
Please Share, Support, follow , Subscribe!!! or if u Need help me?
Facebook: https://web.facebook.com/Nauman1
Linkedin : https://bit.ly/2DYFgTg
Download #Artificial_intelligence_slides https://bit.ly/2HTb3dD
Subscribe Nauman Malik channel: https://bit.ly/2t1P3Dd
Cs607 #playlist on Youtube: https://bit.ly/2DNUjQM
Instagram: https://www.instagram.com/nauman_mlik/
Google Plus: https://bit.ly/2MSJq3n
BLOGspot https://naumanai.blogspot.com/
About : Nauman Malik is actually a YouTube Channel, where you will find #University
courses videos #Artificial_intelligence #cs607 #robotic technological videos in Urdu_
Hindi, #keep in touch for your Future #needs So don’t forgot to subscribe :)
Java 8, lambdas, generics: How to survive? - NYC Java Meetup GroupHenri Tremblay
Lambdas are sexy. But they are adding complexity. Mixed with generics, it creates a dangerous cocktail. Together, we will start from the bottom of generics and go straight through lambda inference. To explain why it is the way it is and tell you how to survive.
Generics and Lambdas cocktail explained - Montreal JUGHenri Tremblay
We are in 2015 and Java 8 will slowly but surely become the new standard. Our world will be filled with lambdas. Generics, for themselves, have appeared in 2004. They brought benefits and complexity. Enough to blow up the complexity quota of Java according to Josh Bloch.
But lambdas, whatever are sexy they are, are going to add even more complexity. Mix with generics your now playing with nitroglycerin.
We will travel together through the bottom of the generics, through inference and through lambdas type resolution. To explain why. To provide solutions. To ease Java 8 adoption.
lab08/build.bat
@echo off
cls
set DRIVE_LETTER=%1:
set PATH=%DRIVE_LETTER%\MinGW\bin;%DRIVE_LETTER%\MinGW\msys\1.0\bin;%DRIVE_LETTER%\MinGW\gtkmm3\bin;%DRIVE_LETTER%\MinGW\gtk\bin;c:\Windows;c:\Windows\system32
set PROJECT_PATH=.
make DRIVE_LETTER="%DRIVE_LETTER%" PROJECT_DIR="%PROJECT_PATH%"
lab08/CSC2110/CD.h
#if !defined CD_H
#define CD_H
#include "Song.h"
#include "Text.h"
using CSC2110::String;
#include "ListArray.h"
using CSC2110::ListArray;
namespace CSC2110
{
class CD
{
private:
String* artist;
String* title;
int year;
int rating;
int num_tracks;
ListArray<Song>* songs;
public:
CD(String* artist, String* title, int year, int rating, int num_tracks);
virtual ~CD();
String* getKey();
void addSong(String* title, String* length);
void displayCD();
static ListArray<CD>* readCDs(const char* file_name);
static int compare_items(CD* one, CD* two);
static int compare_keys(String* sk, CD* cd);
static char getRadixChar(CD* cd, int index); //1-based
};
}
#endif
lab08/CSC2110/Double.h
#if !defined (DOUBLE_H)
#define DOUBLE_H
namespace CSC2110
{
class Double
{
private:
double value;
public:
Double(double val);
~Double();
double getValue();
};
}
#endif
lab08/CSC2110/HighPerformanceCounter.h
#if !defined (HIGHPERFORMANCECOUNTER_H)
#define HIGHPERFORMANCECOUNTER_H
namespace CSC2110
{
class HighPerformanceCounter
{
private:
double micro_spt; //micro_seconds per tick
HighPerformanceCounter();
static HighPerformanceCounter* hpc;
static int getTicksPerSecond();
public:
virtual ~HighPerformanceCounter();
static HighPerformanceCounter* getHighPerformanceCounter();
int getCurrentTimeInTicks();
double getTimeDifferenceInMicroSeconds(int start_time, int end_time);
};
}
#endif
lab08/CSC2110/Integer.h
#if !defined (INTEGER_H)
#define INTEGER_H
namespace CSC2110
{
class Integer
{
private:
int value;
public:
Integer(int val);
virtual ~Integer();
int getValue();
};
}
#endif
lab08/CSC2110/Keyboard.h
#if !defined KEYBOARD_H
#define KEYBOARD_H
#include "Text.h"
using CSC2110::String;
#include <string>
using namespace std;
namespace CSC2110
{
class Keyboard
{
private:
Keyboard();
public:
virtual ~Keyboard();
static Keyboard* getKeyboard();
//pre: the string (character literal) that will prompt the user for input
//post: the input read from the keyboard interpreted as an int is returned
int readInt(string prompt);
int getValidatedInt(string prompt, int min, int max);
//pre: the string that will prompt the user for input
//post: the input read from the keyboard interpreted as a double is returned
double readDouble(string prompt);
double getValidatedDouble(string prom ...
Lambdas and Generics (long version) - Bordeaux/Toulouse JUGHenri Tremblay
Lambda expressions are coming soon. They promise to be a nice complexity cocktail with the 9 years old generics.
Lets go deep into the generics to get a better understanding. Mix them with lambdas and wait calmly for Java 8 to arrive.
User Defined Aggregation in Apache Spark: A Love StoryDatabricks
Defining customized scalable aggregation logic is one of Apache Spark’s most powerful features. User Defined Aggregate Functions (UDAF) are a flexible mechanism for extending both Spark data frames and Structured Streaming with new functionality ranging from specialized summary techniques to building blocks for exploratory data analysis.
This is my attempt at a look at some of the features of C++11, and more importantly, describing some of the style changes in C++11 that will make programmers more productive and programs more efficient.
An AVL tree, ordered by key insert: a standard insert; (log n) find: a standard find (without removing, of course); (log n) remove: a standard remove; (log n)
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
3. Utilisation d’un Iterable
Seule façon d’accéder au contenu d’une
collection quelconque:
for( final T item: collection) {
... faire quelque chose...
}
3
Hortis GRC SA - www.hortis.ch
Collections & Generics
4. Utilisation d’un Iterator
Seule façon d’accéder et de modifier le
contenu d’une collection quelconque:
final Iterator<T> iter =
collection.iterator();
while(iter.hasNext()) {
final T item = iter.next();
... faire quelque chose...
if (... condition...) {
iter.remove();
}
}
4
Hortis GRC SA - www.hortis.ch
Collections & Generics
5. Utilisation d’un Iterator dans un “for”
Le contenu reste identique:
for(final Iterator<T> iter =
collection.iterator();
iter.hasNext();) {
final T item = iter.next();
... faire quelque chose...
if (... condition...) {
iter.remove();
}
}
5
Hortis GRC SA - www.hortis.ch
Collections & Generics
6. Comparable
Donne un ordre “naturel”:
Interface Comparable<T> {
int compareTo(T o);
}
Exemple pour une liste:
final List<T extends Comparable<T>>
myList = ...
Collections.sort(myList);
6
Hortis GRC SA - www.hortis.ch
Collections & Generics
7. Comparator
Pour mettre de l’ordre dans les collections:
Interface Comparator<T> {
int compare(T o1, To2);
}
Exemple pour une liste:
final List<T> myList = ...
final Comparator<T> myComparator = ...
Collections.sort(myList, myComparator);
7
Hortis GRC SA - www.hortis.ch
Collections & Generics
8. Lists and Sets
Une liste possède un ordre,
Un Set ne contient aucun doublon.
8
Hortis GRC SA - www.hortis.ch
Collections & Generics
10. Maps
Permet un accès indexé par n’importe quel
object:
“buckets” adressés par le hashCode,
Séparation à l’intérieur d’un “bucket” à l’aide de la
méthode equals .
10
Hortis GRC SA - www.hortis.ch
Collections & Generics
19. Déclarations générique
Déclaration pour le compilateur seulement,
Le type “générique” n’a pas d’existence dans
la machine virtuelle,
Un type se déclare au niveau:
de la classe,
d’une méthode (non-static ou static);
Il s’agit donc d’un simple “pattern-matching”
19
Hortis GRC SA - www.hortis.ch
Collections & Generics
20. Différences fondamentale
Les arrays ont accès à l’héritage:
Number[] measures = new Integer[4];
Les collections pas!
List<Number> measures =
new ArrayList<Integer>();
... parce que le type de la déclaration de la
collection n’existe pas en dehors du
compilateur.
20
Hortis GRC SA - www.hortis.ch
Collections & Generics
21. Comment faire?
On utilise la notation <? extends xxx>,
Par exemple :
List<? extends Number> measures =
new ArrayList<Integer>();
Par contre :
Number meter = measures.get(0);
Integer mm = (Integer) measures.get(1);
21
Hortis GRC SA - www.hortis.ch
Collections & Generics
22. Exemple: filtre générique
public abstract class AbstractObjectFilter<T> {
private final EventListenerList listenerList = new EventListenerList();
public void addChangeListener(ChangeListener listener) {
listenerList.add(ChangeListener.class, listener);
}
public void removeChangeListener(ChangeListener listener) {
listenerList.remove(ChangeListener.class, listener);
}
protected void fireChanged() {
final ChangeEvent event = new ChangeEvent(this);
final Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == ChangeListener.class) {
((ChangeListener) listeners[i + 1]).stateChanged(event);
}
}
}
public abstract boolean accept(T object);
}
22
Hortis GRC SA - www.hortis.ch
Collections & Generics
23. Exemple: utilisation filtre
public boolean collect(List<D> adaptedObjects,
IObjectListModel<? extends D> model) {
final boolean added = false;
for (final D object : model) {
if (filter.accept(object)) {
adaptedObjects.add(object);
}
}
return added;
}
23
Hortis GRC SA - www.hortis.ch
Collections & Generics
24. Exemple: binding sur une sous-classe
public class WayPointDifferentiator extends
AbstractNamedAdaptationDataDifferentiator<WayPoint> {
public final static WayPointDifferentiator
instance = new WayPointDifferentiator();
private WayPointDifferentiator() {
super();
}
@Override
public boolean equals(final WayPoint o1, final WayPoint o2) {
return super.equals(o1, o2) && (o1 == null ||
valueEquals(o1.getArea(), o2.getArea()));
}
@Override
public Class<WayPoint> getObjectClass() {
return WayPoint.class;
}
@Override
protected void collectAccessors(ArrayList<String> accessorList) {
super.collectAccessors(accessorList);
accessorList.add(quot;ShortNamequot;);
accessorList.add(quot;Wgs84Latitudequot;);
accessorList.add(quot;Wgs84Longitudequot;);
}
}
24
Hortis GRC SA - www.hortis.ch
Collections & Generics
25. Exemple: binding sur une méthode
public abstract class AbstractAdaptationData<T>
implements Serializable, IVersionable<T>, Comparable<T> {
public static <D extends Comparable<D>> int compare(final D v1, final D v2) {
if (v2 == null) {
return v1 == null ? 0 : 1;
} else if (v1 == null) {
return -1;
}
return v1.compareTo(v2);
}
25
Hortis GRC SA - www.hortis.ch
Collections & Generics
26. Exemple: binding sur une méthode
public <T extends AbstractAdaptationData<T>> void loadDescriptorData(
final AdaptationDataManager manager,
final AdaptationDataRepository dataRepository,
final AbstractAdaptationDataDescriptor<T> _descriptor,
final SubtableController _subtableController,
final T selectedObject, final boolean activateSearchField) {
setName(_descriptor.getName());
final ObjectTableModel<T> tableModel =
_descriptor.getTableModel(manager, selectedObject);
tableModel.setResourceBundle(manager.getResourceBundle());
table = new JTableWithToolTips(tableModel);
table.setName(_descriptor.getName());
final String searchColumn = _descriptor.getSearchColumn();
MutableDynamicTableFilter<T> dynamicTableFilter = null;
MutableDynamicTableSorter<T> dynamicTableSorter = null;
final DefaultColumnFilterFactory<T> filterFactory =
_descriptor.getFilterFactory(manager);
26
Hortis GRC SA - www.hortis.ch
Collections & Generics