summaryrefslogtreecommitdiff
path: root/java/demo/Freeze/transform/ReadNew.java
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2015-03-18 12:58:16 -0230
committerMatthew Newhook <matthew@zeroc.com>2015-03-18 12:58:16 -0230
commit9b7668c7c92cf9cb311fe444cdddb489cd2a219d (patch)
tree5016567c58c81f5654e9d01935e199c6bf4761d2 /java/demo/Freeze/transform/ReadNew.java
parentVS add-in & build updates: (diff)
downloadice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.bz2
ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.xz
ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.zip
Removed demos.
Moved demoscript to distribution.
Diffstat (limited to 'java/demo/Freeze/transform/ReadNew.java')
-rw-r--r--java/demo/Freeze/transform/ReadNew.java87
1 files changed, 0 insertions, 87 deletions
diff --git a/java/demo/Freeze/transform/ReadNew.java b/java/demo/Freeze/transform/ReadNew.java
deleted file mode 100644
index 2c8ff43f8ae..00000000000
--- a/java/demo/Freeze/transform/ReadNew.java
+++ /dev/null
@@ -1,87 +0,0 @@
-// **********************************************************************
-//
-// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
-//
-// This copy of Ice is licensed to you under the terms described in the
-// ICE_LICENSE file included in this distribution.
-//
-// **********************************************************************
-
-import Demo.*;
-import Freeze.*;
-
-class ReadNew extends Ice.Application
-{
- @Override
- public int
- run(String[] args)
- {
- if(args.length > 0)
- {
- System.err.println(appName() + ": too many arguments");
- return 1;
- }
-
- Connection connection = Util.createConnection(communicator(), "dbnew");
-
- final java.util.Comparator<String> less = new java.util.Comparator<String>()
- {
- @Override
- public int compare(String s1, String s2)
- {
- if(s1 == s2)
- {
- return 0;
- }
- else if(s1 == null)
- {
- return -s2.compareTo(s1);
- }
- else
- {
- return s1.compareTo(s2);
- }
- }
- };
-
- try
- {
- NewContacts.IndexComparators indexComparators = new NewContacts.IndexComparators(less);
- boolean createDb = true;
- NewContacts contacts = new NewContacts(connection, "contacts", createDb, less, indexComparators);
-
- System.out.println("All contacts (default order)");
- for(java.util.Map.Entry<String, NewContactData> entry : contacts.entrySet())
- {
- NewContactData data = entry.getValue();
- System.out.println(entry.getKey() + ":\t\t" + data.phoneNumber + " " + data.emailAddress);
- }
-
- System.out.println("\nAll contacts (ordered by phone number)");
- java.util.SortedMap<String, java.util.Set<java.util.Map.Entry<String, NewContactData>>> phoneNumberMap =
- contacts.mapForPhoneNumber();
- for(java.util.Set<java.util.Map.Entry<String, NewContactData>> entries : phoneNumberMap.values())
- {
- for(java.util.Map.Entry<String, NewContactData> entry : entries)
- {
- NewContactData data = entry.getValue();
- System.out.println(entry.getKey() + ":\t\t" + data.phoneNumber + " " + data.emailAddress);
- }
- }
- }
- finally
- {
- connection.close();
- }
-
- return 0;
- }
-
- static public void
- main(String[] args)
- {
- ReadNew app = new ReadNew();
- int status = app.main("demo.Freeze.transform.ReadNew", args);
- System.exit(status);
- }
-}